Bugzilla – Bug 2151
Sleep after current song
Last modified: 2008-09-15 14:39:24 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.
Reasonable suggestion, will have to wait post-6.2.
kdf - how easy is this?
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.
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).
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.
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?
Subject: Re: Sleep after current song Can't the duration be in fractional minutes?
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.
Add a few comments in there (and refer to this bug report), and that looks ok.
added at change 8801