Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: VDR Plugin System - First Step



Stefan Huelswitt wrote:
> 
> Well, heavy programming today :-)
> 
> Another question:
> I don't understand how to handle the plugin setup options.
> Normaly all options are part of cSetup and cMenuSetupPage
> maintains a code (member data). If I leave the setup page,
> cMenuSetupPage takes care of saving setup.conf (in
> cMenuSetupPage::Process()).
> 
> So what is the correct organisation for my setup options (need to
> create a own class?) and where is the point to call SetupStore()
> for them?
> 
> My SetupMenu class looks (doesn't works as my options are not
> part of cSetup):
> 
> class cMenuSetupMP3 : public cMenuSetupPage {
> private:
>   virtual void Set(void);
> public:
>   cMenuSetupMP3(void) { Set(); }
>   };
> 
> void cMenuSetupMP3::Set(void)
> {
>   Clear();
>   SetupTitle("MP3");
>   Add(new cMenuEditBoolItem(tr("Setup.MP3$Audio mode"),      &data.MP3AudioMode, tr("Round"), tr("Dither")));
> [...]
> }

The 'data' member is not supposed to be used by plugins.
I guess I should make the more abtract to keep that private.

Where and how a plugin keeps its setup variables is completely up to the
plugin. You can have them in separate global variables or define your
own struct or class that contains them.

Looks like there should be an additional function that gets called
when the user presses "Ok", in which a plugin's setup menu can call
SetupStore() for each of its parameters. I'll do that in the next release,
together with an example implementation of a setup menu.

Klaus
-- 
_______________________________________________________________

Klaus Schmidinger                       Phone: +49-8635-6989-10
CadSoft Computer GmbH                   Fax:   +49-8635-6989-40
Hofmark 2                               Email:   kls@cadsoft.de
D-84568 Pleiskirchen, Germany           URL:     www.cadsoft.de
_______________________________________________________________



Home | Main Index | Thread Index