Your Digital Media Has Never Looked So Good

Topic Author
Posts: 2
Joined: Sun Aug 26, 2007 11:29 pm

soundbridge on your homepage

Mon Aug 27, 2007 1:23 am

i've been trying to create an itunes browser based frontend to my soundbridge. Due some unsolveable problems i cant realize a full featured (itunes like) player. but at least there is something possible with the code, feel free to use the php-soundbridge-class.


here are some applications:

Print the Display as Gif

$soundbridge = new SoundBridge('',true);


Create an WebBased Remote
$remote = new SoundBridge("",false);
   echo "test".$_POST['key'];
function key(key)


<img src="remote.jpg" width="135" height="320" style="border:1px dashed #000;padding:4px;" border="0" usemap="#map"/>
      <td>Unbenutzte Tasten<br>
<a href="javascript:key('CK_SNOOZE')">CK_SNOOZE (Sleep)</a>
<br><a href="javascript:key('CK_ALARM')">CK_ALARM (Wecker)</a>
<br><a href="javascript:key('CK_BROWSE')">CK_BROWSE (Browse)</a>
<br><a href="javascript:key('CK_PRESET_A1')">Spiele Alle MP3's</a></td>

<map name="map">
<area shape="poly" coords="25,86,42,98,42,116,24,130,22,126,22,88,24,84,24,85" href="javascript:key('CK_WEST')" />
<area shape="poly" coords="49,92,75,92,92,76,64,74,32,77,33,77" href="javascript:key('CK_NORTH')" />
<area shape="poly" coords="85,114,85,96,103,84,103,128,104,128" href="javascript:key('CK_EAST')" />
<area shape="poly" coords="91,132,78,120,51,120,34,134,63,137" href="javascript:key('CK_SOUTH')" />
<area shape="rect" coords="25,32,41,45" href="javascript:key('CK_POWER')" />
<area shape="rect" coords="84,30,102,43" href="javascript:key('CK_BRIGHTNESS')" />
<area shape="rect" coords="83,55,100,67" href="javascript:key('CK_EXIT')" />
<area shape="rect" coords="54,55,72,68" href="javascript:key('CK_SEARCH')" />
<area shape="rect" coords="24,57,41,68" href="javascript:key('CK_MENU')" />
<area shape="rect" coords="55,170,75,192" href="javascript:key('CK_VOLUME_UP')" />
<area shape="rect" coords="55,192,74,212" href="javascript:key('CK_VOLUME_DOWN')" />
<area shape="rect" coords="80,175,99,188" href="javascript:key('CK_SHUFFLE')" />
<area shape="rect" coords="82,201,99,214" href="javascript:key('CK_REPEAT')" />
<area shape="rect" coords="30,175,48,188" href="javascript:key('CK_PAUSE')" />
<area shape="rect" coords="30,202,48,214" href="javascript:key('CK_ADD')" />
<area shape="rect" coords="50,100,76,114" href="javascript:key('CK_SELECT')" />
<area shape="rect" coords="80,146,98,160" href="javascript:key('CK_NEXT')" />
<area shape="rect" coords="54,148,74,160" href="javascript:key('CK_PLAY')" />
<area shape="rect" coords="29,147,48,160" href="javascript:key('CK_PREVIOUS')" />

<form name="remote" id="remote" method="post">
<input type="hidden" name="key" id="key">

Posts: 10
Joined: Fri Apr 13, 2007 4:15 am

Sun Oct 07, 2007 5:27 am

Hi thakoman,

that´s exactly what i´m looking for!

But your server seems to be down.

Could you upload the file again, please?

Many thanks in advance!


Posts: 191
Joined: Wed May 03, 2006 5:46 am
Location: Austria

Mon Oct 08, 2007 2:52 am

Looking sweet. Some mirror that doesn't rely on a dyndns host would be incredibly nice. :)
Soundbridge M1001
de-u/c'd NSLU2 Unslung 6.8 - mt-daapd svn-1696
Topic Author
Posts: 2
Joined: Sun Aug 26, 2007 11:29 pm

Wed Oct 10, 2007 12:00 am

he is up again ^^
Posts: 10
Joined: Fri Apr 13, 2007 4:15 am

Wed Oct 10, 2007 1:58 am

Posts: 1
Joined: Thu Oct 11, 2007 6:52 am

Thu Oct 11, 2007 7:05 am

Nice work.

I own a M1001, fairly new, and it has the "small and tall VFD direct" display with a resolution of 280x32.

Now I fiddled around a bit with the PHP but run into a problem. The image that gets displayed is black from x-position 256 to 280 for all y-positions.

Or, put somewhat clearer..., the current time gets displayed only half.

So, after fiddling around a bit (never really programmed PHP, always preferred Java), I took the freedom to write an enhanced Display-routine.

You can now pass the resolution as parameters. It also uses the built-in hex/dec/bin conversion from php.

My thanks go to thakoman for providing an excellent basis to start from. Please, you all, feel free to use the enhanced function with thakoman's php-script.
If you, however plan to use the function in a commercial environment, please drop me a PM.

OK, enough explained, here comes the code:
function PrintDisplayEnhanced($max_x, $max_y)
   // number of chars from displaydata needed to fill one column
   $num_col_chars = $max_y/4;
   $display_data_length = strlen($this->displaydata);
   // create image with given size
   $image = @ImageCreate ($max_x, $max_y)
      or die ("Unable to create GD-Imagestream");
   $background_color = ImageColorAllocate($image, 0, 0, 0);
   $white = imagecolorallocate($image,255,255,255);
   // start outer loop, the columns
   for($col_num=0; $col_num<$max_x;$col_num++)
      $col_map = "";
      $count_start = $col_num * $num_col_chars;
      // start building up one column as binary string
      for($count=$count_start; $count<$count_start + $num_col_chars;$count++)
         $col_map = $col_map.sprintf("%04s", decbin(hexdec($this->displaydata[$count])));
      // transfer $col_map data to image
         if( "1" == $col_map[$c] )
            imagesetpixel( $image, $col_num, $c, $white);
   header("Content-type: image/png");
   ImagePNG ($image);

Posts: 175
Joined: Tue Jun 07, 2005 3:06 pm
Location: southern cal, usa

Thu Nov 15, 2007 2:24 pm

i got this to work on the ipod touch. loaded apache and php onto it and it runs ok. however, the display is not showing. i'm not sure if it's the build of apache or php that's preventing the display from showing.

nice work, though.
roku digital video player wireless
m500 hard-wired (2)
m1000 hard-wired (1)
firefly mediaserver on winxp
firefly mediaserver on mss+
d-link dgl-4300 router
(static ip on everything...except the netflix player)
Posts: 4
Joined: Sun Feb 24, 2008 11:00 am

Sun Feb 24, 2008 2:23 pm

If the server goes down again, I have uploaded it to my downloads section..

Posts: 74
Joined: Wed Jul 06, 2005 12:05 pm
Location: UK

Wed Feb 27, 2008 3:55 am

Steed wrote:
Nice work.
I own a M1001, fairly new, and it has the "small and tall VFD direct" display with a resolution of 280x32.

This works a treat with my M2000 (512x32).

Posts: 23
Joined: Thu Nov 16, 2006 1:46 pm

How to use this?

Wed Feb 27, 2008 2:37 pm

I see that rem had made this work on the iPod Touch. How do we use this code (for us novices)?
Jim Hanlon

Who is online

Users browsing this forum: No registered users and 2 guests