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 /setup.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 'setup.cpp')
-rw-r--r-- | setup.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
@@ -19,11 +19,12 @@ using namespace std; Setup::Setup(): m_libraryPath( "/usr/local/lib" ), - m_serverPort( 8001 ) + m_serverPort( 8001 ), + m_lastChannel( 0 ) { } -bool Setup::Parse( int argc, char* argv[] ) +bool Setup::ParseCommandLine( int argc, char* argv[] ) { static struct option opts[] = { { "lib", required_argument, NULL, 'L' }, @@ -47,7 +48,7 @@ bool Setup::Parse( int argc, char* argv[] ) CheckServerIps(); } -char const* Setup::Help() const +char const* Setup::CommandLineHelp() const { if ( m_helpString.empty() ) { ostringstream builder; @@ -63,6 +64,15 @@ char const* Setup::Help() const return m_helpString.c_str(); } +bool Setup::ParseSetupEntry( char const* name, char const* value ) +{ + cout << "Parsing " << name << " = " << value << endl; + if ( strcmp( name, "LastChannel" ) == 0 ) m_lastChannel = atoi( value ); + else return false; + return true; +} + + bool Setup::CheckLibraryPath() { ostringstream builder; @@ -102,10 +112,4 @@ bool Setup::CheckServerIps() return true; } -Setup& Setup::Get() -{ - static Setup instance; - return instance; -} - } // namespace vdrlive |