Interruptions

From LinuxMCE
Revision as of 19:51, 6 February 2007 by Wikiadmin (Talk | contribs)

(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search
This page was written by Pluto and imported with their permission when LinuxMCE branched off in February, 2007. In general any information should apply to LinuxMCE. However, this page should be edited to reflect changes to LinuxMCE and remove old references to Pluto.
The Orbiter can change screen to display messages in response to events, such as when you insert a new plug and play device and need to tell the system if you want to use it. However sometimes you don't want to be interrupted. For example, when you're watching TV you probably don't want to be alerted because a new device is detected on the network. However, you probably do still want to be alerted if someone is ringing the door. In general, low priority tasks will not interrupt you if you are watching tv or doing some computing application, like browsing the web. These prompts are queued and you will only see them when you either stop the activity, or manually switch to another screen, like the main menu, which the system understands to mean it's ok to interrupt you. So, if you are trying to add plug and play devices, or do other tasks that would normally popup messages on the screen, but you are not seeing the messages because you are watching a movie or browsing the web, then simply switch screens to the main menu and then the popup messages will appear.

Technical Explanation for Developers

In the Screen table in the pluto_main database is a field AllowInterruptions, which by default is 1, or true. If it's left at the default, then if that screen is currently active on the orbiter when the orbiter gets a request to display an alert or change screens, it will always do it. If the setting for the screen is 0, which it normally is for full-screen media screens like the dvd playback, live tv, etc., then the following rules will be evaluated to see if the user should be interrupted.

First, Goto_Screen takes a Parameter #251 Interruption, which is defined in AllScreens.h: enum eInterruption {interuptAlways=0, /* always interupt his activity and change screens */ interuptNever=1, /* never interupt, only change the screen if the system is idle */ interuptNoVideo=2, /* will interrupt a web browser but not a movie */ interuptOnlyAudio=3 /* will not interrupt a web browser, only when audio is playing */ };

This value can also be specified when using the pre-generated class helpers to do screen changes: DCE::Screen_[screen name].

If the interrupt is not interuptAlways, then the function OkayToInterrupt() in Orbiter.cpp will determine if it's okay to interrupt. If the answer is 'no', then it looks at another paramter to Goto_Screen: #253 Queue. If that parameter is 0, the screen change is lost. If it is 1, then if the screen doesn't change because of Interrupt rules, the screen change is added to a queue (m_listPendingGotoScreens) and the next time the screen changes the entries in the queue will be evaluated to see which ones are safe to do then. See Orbiter.cpp::ServiceInterruptionQueue()