Hi,
I really like queuing up songs on the squeezebox and really don't like
to have to pause tracks in the middle or wait until a track is over to
work with a playlist. So I have two simple (related) ideas that would
help improve playlist control.
I would love to develop them myself, but I have no experience with Perl
and I still can't find the actual documentation for how to manage the
playlist from a plugin. Does one simple use the "command line
interface" commands? Anyway, the ideas are:
STOP AFTER THIS SONG
This would be an item that comes up when you hit "right" on a song in
the playlist. It would delete all subsequent tracks in the playlist.
PAUSE AFTER THIS SONG
Similarly, this would cause the player to pause when that song is over
(but leave the playlist in tact).
I think the first one is easier to code because you just edit the
playlist immediately on the action. Some pseudocode would look like:
Code:
--------------------
stop_after_song(int song_index) { // call this method when the user hits
"right" on a track in the playlist
for (i song_index + 1; i < playlist_length; i++)
playlist.delete(i);
}
--------------------
Pausing is a little trickier because you have to take action later. A
complicated implementation would probably store a list of song IDs to
pause after. When you hit "right" there would be a checkbox "[ ] Pause
After This Song". The complication would come because after deciding to
pause after a song, that song might be deleted from the playlist. Worse
yet, it might be re-added later. Ideally that second instance of the
track should not get paused after...
But to be honest I'd be satisfied with a much simpler implementation
that only operated on the currently playing track as that is how I
personally would actually use the feature. In that case we just have a
checkbox entry "Pause After This Song" that comes up if the user hits
"right" on the currently playing song.
Code:
--------------------
boolean pause = false;
pause_after_song() {
pause = !pause;
}
song_ended() { // a method that needs to get called whenever a track is
finished playing
if pause {
playlist.pause();
pause = false;
}
}
--------------------
We also should take care of the case that the user selects the option
but then skips the track or deletes it.
I hope (for the sake of the plugin architecture) that this stuff is
really easy to write! Anyone want to help me? I'd greatly appreciate
it!
--
saucerful
------------------------------------------------------------------------
saucerful's Profile: http://forums.slimdevices.com/member.php?userid=41312
View this thread: http://forums.slimdevices.com/showthread.php?t=83054
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins