From c5a0ac492575efb83ecc76524ff3c13fe1a9799b Mon Sep 17 00:00:00 2001 From: Sascha Volkenandt Date: Wed, 3 Jan 2007 21:43:21 +0000 Subject: - renamed Setup::Get() to LiveSetup() - added method that fetches plugin class from vdr and gets its setup object - demo code in channels.ecpp --- setup.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'setup.cpp') diff --git a/setup.cpp b/setup.cpp index bb11f60..7ee2f82 100644 --- a/setup.cpp +++ b/setup.cpp @@ -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 -- cgit v1.2.3