Bug 2151 - Sleep after current song
: Sleep after current song
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Player UI
: 6.2.0
: PC Windows XP
: P2 enhancement (vote)
: ---
Assigned To: Blackketter Dean
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-09-19 08:56 UTC by Aynsley Blake
Modified: 2008-09-15 14:39 UTC (History)
2 users (show)

See Also:
Category: ---


Attachments
simple fix (780 bytes, patch)
2006-07-29 23:51 UTC, KDF
Details | Diff
remove ints (770 bytes, patch)
2006-07-30 13:01 UTC, KDF
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aynsley Blake 2005-09-19 08:56:59 UTC
It would be nice if you could enhance the sleep function to allow the SB to go
into "Off" mode once the currently playing song has finished. I would suggest
press-and-hold the sleep button to enter this mode.
Comment 1 Blackketter Dean 2005-09-22 16:11:17 UTC
Reasonable suggestion, will have to wait post-6.2.
Comment 2 Dan Sully 2006-07-23 19:24:34 UTC
kdf - how easy is this?
Comment 3 KDF 2006-07-23 20:28:12 UTC
adding a new function isn't simple.  it needs a CLI, button and web access to be considered. Plus the UI.  Sleeptime is curently reported on player and web UI.  How would this distinctly different option be reported?

not to mention, facing an onslaught of "options".

given a solid design, building wouldn't be too hard.  CLI command, dispatcher to trigger it, and a button function.  Strings and buttom map would be needed too.
Comment 4 Blackketter Dean 2006-07-29 12:47:08 UTC
Actually, it's not that hard.  Right now when you press the sleep button, it sets to sleep in 15 minutes, pressing again does 30, then 45, etc.  To add this feature, the first press would sleep at the end of the current song, then the next one would be 15 minutes, and so on.  Use the remaining time in the song to set the value, but the initial feedback would be "Sleep at end of song."  (this option would be skipped if the current song had an unknown or infinite length, like a radio station).
Comment 5 KDF 2006-07-29 23:32:09 UTC
ok, trying it out.  complication is that sleep time is in minutes, remaining time is in seconds.
how accurate do we need this to be?  to teh second, and we'll need to rework the sleep api, to the minute and it's easy, but we might have the problem of a new song starting playback before sleep happens.
Comment 6 KDF 2006-07-29 23:51:00 UTC
Created attachment 1385 [details]
simple fix

this fixes on minutes.  the sleep setting is based on minutes remaining in playback, if they exist or the norm.  if the user then stops playback, too bad.  the sleep time is already set.  it also doesn't acccount for the extra seconds in playback, but this is the 'simple' case you mention.

more complex...we'd have to stop and start a check on track start, and end, when we don't really check on an endd at all now (aside from, "oops, nothing left")

still simple?
Comment 7 Blackketter Dean 2006-07-30 08:27:14 UTC
Subject: Re:  Sleep after current song

Can't the duration be in fractional minutes?

Comment 8 KDF 2006-07-30 13:01:13 UTC
Created attachment 1386 [details]
remove ints

might work.
limitation is that this won't deal with any song changes once active.
might be good to also add sanity checks in case songtime or duration are bad values, but I'm not sure how often that might crop up or in what form.
Comment 9 Dan Sully 2006-08-04 16:31:31 UTC
Add a few comments in there (and refer to this bug report), and that looks ok.
Comment 10 KDF 2006-08-04 17:29:39 UTC
added at change 8801