diff options
author | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-03 21:43:21 +0000 |
---|---|---|
committer | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-03 21:43:21 +0000 |
commit | c5a0ac492575efb83ecc76524ff3c13fe1a9799b (patch) | |
tree | 7b4af9bb32c58e5d3aed9ac039180ac7533db052 /live.cpp | |
parent | 95739a127dc2b85fe831ac13553578490fea34b0 (diff) | |
download | vdr-plugin-live-c5a0ac492575efb83ecc76524ff3c13fe1a9799b.tar.gz vdr-plugin-live-c5a0ac492575efb83ecc76524ff3c13fe1a9799b.tar.bz2 |
- renamed Setup::Get() to LiveSetup()
- added method that fetches plugin class from vdr and gets its setup object
- demo code in channels.ecpp
Diffstat (limited to 'live.cpp')
-rw-r--r-- | live.cpp | 38 |
1 files changed, 13 insertions, 25 deletions
@@ -3,12 +3,12 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: live.cpp,v 1.4 2007/01/03 15:54:31 lordjaxom Exp $ + * $Id: live.cpp,v 1.5 2007/01/03 21:43:21 lordjaxom Exp $ */ -#include <memory> #include <vdr/plugin.h> #include "i18n.h" +#include "live.h" #include "setup.h" #include "thread.h" @@ -16,26 +16,8 @@ namespace vdrlive { using namespace std; -static const char *VERSION = "0.0.1"; -static const char *DESCRIPTION = "Live Integrated VDR Environment"; - -class Plugin : public cPlugin { -public: - Plugin(void); - virtual const char *Version(void) { return VERSION; } - virtual const char *Description(void) { return DESCRIPTION; } - virtual const char *CommandLineHelp(void); - virtual bool ProcessArgs(int argc, char *argv[]); - virtual bool Start(void); - virtual void Stop(void); - virtual void MainThreadHook(void); - virtual cString Active(void); - virtual cMenuSetupPage *SetupMenu(void); - virtual bool SetupParse(const char *Name, const char *Value); - -private: - auto_ptr< ServerThread > m_thread; -}; +const char *Plugin::VERSION = "0.0.1"; +const char *Plugin::DESCRIPTION = "Live Integrated VDR Environment"; Plugin::Plugin(void) { @@ -43,12 +25,12 @@ Plugin::Plugin(void) const char *Plugin::CommandLineHelp(void) { - return Setup::Get().Help(); + return LiveSetup().CommandLineHelp(); } bool Plugin::ProcessArgs(int argc, char *argv[]) { - return Setup::Get().Parse( argc, argv ); + return LiveSetup().ParseCommandLine( argc, argv ); } bool Plugin::Start(void) @@ -80,7 +62,13 @@ cMenuSetupPage *Plugin::SetupMenu(void) bool Plugin::SetupParse(const char *Name, const char *Value) { - return true; + return LiveSetup().ParseSetupEntry( Name, Value ); +} + +Setup& Plugin::GetLiveSetup() +{ + static Setup instance; + return instance; } } // namespace vdrlive |