Hi Alan,
okay, you mean the Switcher in Morphine.TV and not the default MMSSwitcher in Disko.
This is historical grown
The first Switcher was implemented in Morphine.TV because it was the first application based on Disko framework. Later we have implemented the mmsInit() and registerSwitcher() in the mmscore lib to make it a lot easier to initialize an application.
In the next release of Morphine.TV we should change to mmsInit() and registerSwitcher(). This is not a question about the functionality of the Switcher. It is only a question about to use the right API.
Under
http://diskohq.org/index.php/tutorials/fsid/16-fsid-chapter-10 i have added an chapter 10.5.
To your questions about the Morphine.TV switcher:
With loadPreviewDialog() and loadInfoBarDialog() you can set one or more plugin-specific dialogs to the switcher. It is recommended to have at least one preview dialog window. A plugin-specific infobar window is not required.
This preview and infobar windows are child windows within the Switcher windows.
The Switcher does not show()/hide() the plugin-specific windows. This is the task of each plugin within its context. But inside the loadPreviewDialog() and loadInfoBarDialog() methods, the Switcher connects different callbacks to the loaded child windows. So the Switcher will be informed if a plugin is calling show()/hide() to such windows. So the Switcher can react.
OSD and Central plugins have a showPreview() and show() method. This both methods will be called by the Switcher.
If showPreview() is called (if user changes the selection in the switcher menu), the plugin should show() one of its preview windows and return true. If it returns false, the Switcher will display an error preview window.
If show() is called (if user is choosing a plugin), the plugin should show() one of its Main or Root windows or can show() another preview window (see Weather Plugin). If it returns false, the Switcher will be informed that it cannot switch to the plugin.
The switcher does not send events to a plugin. The event interface is designed to send events between different plugins using onEvent() plugin interface method. E.g. a Backend plugin will inform a Central plugin that something is happend in the system (DVD inserted...).
XML dialogs will be loaded with use of MMSDialogManager. One dialog manager is working for one window.
What informations do you need for this matter?
Best regards
Jens