Interruptions
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. |
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()