Re: USB Music Widget script installation

I was just reading the documentation on this. One suggestion that I have from my reading is . . . I see two sets of buttons similar to ">>" and "<<". One set is for going to the next song and the other skips forward/back 30 seconds. From what I have seen, those buttons are generally used for skipping forward/back (fast forward/reverse) and ">|" & "|<" are usually used for next/previous song. That would be my suggestion from my reading (of course, I did not read everything in this thread yet and maybe someone else has already made this suggestion).

Re: USB Music Widget script installation

Does this app still work?

The site that hosted the script is down.

http://notjunior.net/chumby/usbmusic.zip

Does anyone have that script that needs to be loaded?  If so please post it.

Re: USB Music Widget script installation

Steevo wrote:

Does this app still work?

The site that hosted the script is down.

http://notjunior.net/chumby/usbmusic.zip

Does anyone have that script that needs to be loaded?  If so please post it.

Is anyone here?

Re: USB Music Widget script installation

Sorry - I don't have information this widget.

What precisely did it do? Perhaps I can come up with something to replace it.  I'm already working on a Youstreams replacement.

Re: USB Music Widget script installation

I am still looking for something that can play some mp3 files once off the network or off usb.  The chumby player repeats even if you don't push the repeat button.

That is really irritating. Who came up with that idea? 

I don't know exactly what it did, I just read where it needed a script.  That site is down.

Re: USB Music Widget script installation

Duane wrote:

Sorry - I don't have information this widget.

What precisely did it do? Perhaps I can come up with something to replace it.  I'm already working on a Youstreams replacement.

I think the most pertinent piece of information about this widget can be found in this post by its author, Nigel S:

NigelS wrote:
KenHoltPgh wrote:

Chumby N00b with a question here:

I just got my Chumby One a few days ago.  [...irrelevant discussion of problem deleted - steelpaw]

What am I doing wrong?  What can I do to fix this?  Any enlightenment would be greatly appreciated!

Thanks.

Ken

Hi Ken,
     sorry for the delay here but I didn't get notified of your post. Anyhow a couple of thoughts are 1. reduce the number of files on your USB stick and if you have any strange directiry name reduce these to standard characters etc and 2. Use the stadard music feature on chumby that now has good support for USB as it pretty well copies the widget.

cheers

Nigel
smile smile smile

[emphasis added - steelpaw]

In short, the widget was developed before Chumby acquired the 'My Music Files' feature. Its author didn't seem to think that there was much to choose between the two.

Re: USB Music Widget script installation

steelpaw wrote:


In short, the widget was developed before Chumby acquired the 'My Music Files' feature. Its author didn't seem to think that there was much to choose between the two.

The problem with my music files is there is a repeat button, but you never need to press it since the music player keeps playing everything in the directory forever.   The repeat button is essentially stuck.
It's one line of code.

Since I want it to play a file once, and then stop, it's broken.  Essentially I want to play a file while I fall asleep.  After that, it cannot keep playing.

So I am looking for a solution.  I was hoping this was one.
Is it?

Re: USB Music Widget script installation

Use the sleep time. I have used this for a long time. I think it works on any music source.

Owner of 3 Sony Dash, 2 Info 8.

Re: USB Music Widget script installation

Yeah, but I want it to stop at the end of the file.

Re: USB Music Widget script installation

Well, one alternative is to add a button to My Streams and My Music Files to control "repeat".

Re: USB Music Widget script installation

Duane wrote:

Well, one alternative is to add a button to My Streams and My Music Files to control "repeat".

There's a button now, but it doesn't work.

Re: USB Music Widget script installation

I know there's a "shuffle" button (which randomizes the files from a directory), but I didn't know there was a "repeat" button.  I'll look into it.

Re: USB Music Widget script installation

I put some files in a directory on a usb drive, stuck it into a I3.
I could pick the file to play, and it played.
After that, regardless of the state of the repeat button the unit would play everything in the directory after that, forever.

So I put each file in a separate folder.
Now, it will play that file forever, regardless of the state of the only available button.

I just wanted it to play one file. One time.  I select the file, it plays it and stops.  Like every other media player I tested, windows media, winamp, you name it.  I pick the file, it plays the file.

On chumby I selected it and it played, but it never stops.

That's the problem I am trying to solve.

Re: USB Music Widget script installation

Where are you seeing a "repeat" button?

The button with the two arrows crossing each other is "shuffle".  As far as I can tell from looking at the source code, the player basically creates a playlist (with only one file if that's what you chose) and plays it indefinitely until it's stopped.  The shuffle button randomizes the tracks if there's more than one. I can't find any remnant of any code that played a file or a playlist only once.

I can probably add it, though.

Re: USB Music Widget script installation

Shuffle.  OK, that explains it. I thought it was so weird that I push the play button once, and that means play forever. 
I thought based on the symbol that was repeat.  Similar idea.

Re: USB Music Widget script installation

Sorry about the confusion.  We tended to use the most universal icons we could for these types of things, and everyone seems to use that particular icon for "shuffle".  The icon for "repeat" is typically either a single arrow looping around on itself, or two arrows in a loop.  Apple used to use another variant with two arrows in a loop that optionally had a number badge on it to indicate the number of loops.

42 (edited by Steevo 2015-07-16 16:28:33)

Re: USB Music Widget script installation

I guess I am not really up on those conventions.

I got a response from the author of this widget, the script is at

http://www.bruceprewer.com/chumby/usbmusic.zip

Here is docs on the widget.

http://www.bruceprewer.com//chumby/help … chelp.html

Re: USB Music Widget script installation

Typically the loop symbol with a "1" means "repeat the 1 song" (repeat current song) as opposed to "repeat all songs in selection" (eg repeat album).  Depending on the logo source (Apple, Ubuntu, whoever) the 1 may be inside the loop or on the edge of the loop, but it's generally consistent in meaning.

I'm pretty sure this existed on the first CD player I ever bought (a Technics, back in 1986; my first CD I owned was Kate Bush "The Whole Story") and on a friends Sony from the same era... but that was so long ago now that I could be misremembering!

I don't recall what the symbol for random play was; I didn't use it much!

Re: USB Music Widget script installation

OK, I installed the USB music player, and I downloaded and unzipped the two files contained therein to the root of a usb drive.
Rebooted.
There is no indication that the script was installed, which is run by the
debugchumby command file that I downloaded. 
The file has no extension.

When I rebooted, and the usbmusic widget started it complained that it needs a script installed.
It's unclear whether the popup about the script needing to be installed should have appeared if the script had been installed, so I assume this means it's not installed.

It's contents are:

debugchumby

#!/bin/sh
cp -f /mnt/usb/usbmusic.pl /psp/cgi-bin/
chmod a+x /psp/cgi-bin/usbmusic.pl

The contents of the usbmusic.pl are

usbmusic.pl

#! /usr/bin/perl

# 
#  usefull 
#  print "Content-type: text\/html\n\n";
#  system("echo \"$fields[1]\" >> photos.log");
#  binmode STDOUT;
#


#
# get the arguments in the URL
#

$request = $ENV{'QUERY_STRING'};  # get the URL parameters
$request =~ s/\%20/ /g;           # unencode spaces - may need other later
@fields = split/\?/, $request;    # split into seperate arguments
$fields[0] = uc($fields[0]);      # convert to upper case

if ($fields[0] eq "FILELIST") #URL get a file list 
{

  #  
  # make sure the drive is mountded
  #

  system("umount /tmp/usb > /psp/cgi-bin/photos.tmp");
  system("mount /tmp/usb > /psp/cgi-bin/photos.tmp");

  #
  # make sure we have a symbolic link setup
  #

  system("rm usb > /psp/cgi-bin/photos.tmp");
  system("ln -s /mnt/usb usb > /psp/cgi-bin/photos.tmp");

  #  
  # start the xml return file
  #

  print "Content-type:text/xml\r\n\r\n";
  print "\<\?xml version=\"1.0\" encoding=\"utf-8\"\?\>\n";
  print "<USBFiles>\n";

  #
  # get a list of files
  #

  system("cd usb > /psp/cgi-bin/photos.tmp");
  system("find -follow > /psp/cgi-bin/photos.tmp");

  $file = "/psp/cgi-bin/photos.tmp" ;
  open(INFO, $file) ;
  while ($line = <INFO>)
  {
    $line =~ s/\n// ; # remove linefeed
    $line =~ s/([\&\'\"])/sprintf("%%%02X", ord($1))/seg; # encode elements that are special in XML
    print "   <File ";
    print "Name = \"$line\"> ";
    print "\<\/File\>\n";
  }

  #
  # end the xml return file
  #

  print "<\/USBFiles>\n";

}

if ($fields[0] eq "FILE") #URL get a file  
{

  #
  # send back the file
  #

  #
  # Output the right content type for a PNG-format image
  #

  print "Content-type: $fields[1]\n\n";  # image/jpeg etc
  
  #
  # send the file
  #

  system("cat \"$fields[1]\"");

}

if ($fields[0] eq "NIGHT") #set night mode  
{

  #
  # set night mode by creating events
  #  

  $file = ">/tmp/flashplayer.event" ;
  open(DAT, $file) ;

  printf DAT "<event type=\"NightMode\" value=\"on\" comment=\"\"\/>\n";

  close (DAT);

  #
  # tell chumby to process the event
  #

  system("/usr/bin/chumbyflashplayer.x -F1");

  $file = ">/tmp/flashplayer.event" ;
  open(DAT, $file) ;

  if ($fields[1] eq "DARK") #set dark night mode
  {
    printf DAT "<event type=\"NightMode\" value=\"dark\" comment=\"\"\/>\n";
  }
  if ($fields[1] eq "DIM") #set dark night mode
  {
    printf DAT "<event type=\"NightMode\" value=\"dim\" comment=\"\"\/>\n";    
  }

  close (DAT);

  #
  # tell chumby to process the event
  #

  system("/usr/bin/chumbyflashplayer.x -F1");

  #
  # send a response to client
  #

  print "Content-type:text/xml\r\n\r\n";
  print "\<\?xml version=\"1.0\" encoding=\"utf-8\"\?\>\n";
  print "<OK>\n";
  print "<\/OK>\n";

}

if ($fields[0] eq "VERSION") # get version

{
  # send the script version

  print "Content-type:text/xml\r\n\r\n";
  print "\<\?xml version=\"1.0\" encoding=\"utf-8\"\?\>\n";
  print "<Script>Version=1.0\n";
  print "<\/Script>\n";

}


if ($fields[0] eq "POLICY") # URL get policy

{
  # send the crossdomain policy file

  print "Content-type:text\/xml\r\n\r\n";
  print "<\?xml version=\"1.0\"\?>\r\n\r\n";
  print "<\!-- my crossdomain file -->\n";
  print "<cross-domain-policy>\n";
  print "  <allow-access-from domain=\"\*.chumby.com\" \/>\n";
  print "<\/cross-domain-policy>\n";

}

I am getting to the realization this is maybe not worth it.

Re: USB Music Widget script installation

Duane wrote:

Where are you seeing a "repeat" button?

The button with the two arrows crossing each other is "shuffle".  As far as I can tell from looking at the source code, the player basically creates a playlist (with only one file if that's what you chose) and plays it indefinitely until it's stopped.  The shuffle button randomizes the tracks if there's more than one. I can't find any remnant of any code that played a file or a playlist only once.

I can probably add it, though.

That would be excellent.  If you can do that I plan on having a Chumby by my bed until the end.