Sleep timer specification

From MythTV Official Wiki
Revision as of 06:35, 5 January 2010 by Sentinel (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Mythtv currently has a sleep timer within LiveTV (Internal player?) which will automatically close livetv and return to the main menu.

This is a specification for a more full-featured, frontend-wide sleep timer.

Use Cases

Requirements

  • Sleep action should be configurable. For example, user may want to exit to main menu or shutdown the machine. Should probably fall back to main menu if other commands fail.
  • Sleep function should be available from all plugins.

Implementation

  • Function activateSleepTimer(int timeout:seconds).
  • Function to get time intervals (eg. 15mins,30mins etc).
  • Configuration option to set command. If blank will fall back to default and exit to main menu.
  • Mythshutdown -x would be ideal as the default command to execute here.

Logic:

Sleep Timer triggered ->

Execute command if set ->

- - If result is true then DONE.

- - If result is false then exit to main menu. DONE

Resources

Suggestions

Global Dialog I am not sure if there is this functionality already but... Rather than modifying each plugin maybe it would be useful to implement a global dialog box that can be displayed over the top of the current mythtv context, whether that be livetv, mythmusic, menu etc. The idea being that you could configure the global sleep timer from anywhere within myth and when the dialog was dismissed return to the context that you were in prior to setting the sleep timer.

There has been talk about changing mythmusic so it can continue playing after "exiting" the plugin so you could play music while using mythgallery etc. The global dialog approach could be used to provide a method to control mythmusic after leaving the mythmusic plugin as well. It could also be useful with mythweather (when it stabilises again) to display a summary of current conditions etc.

Alarm Function A nice complement to the sleep timer would be an alarm function whereby Myth could be configured to play a particular playlist in mythmusic or tune to a particular channel in livetv.

Bookmark It would be nice to have the option for the sleep timer to add a bookmark to the recording when it does what it does. That way you could have a better idea of where you left off.

Display Off I would like the ability for it to turn my screen off with a command such as xset dpms force off. Others may prefer to send a power-off signal through their IR blaster. (Either of these could be accommodated with the ability to run a custom command or script when the timer is triggered.)