summaryrefslogtreecommitdiff
path: root/setup.cpp
diff options
context:
space:
mode:
authorSascha Volkenandt <sascha (at) akv-soft (dot) de>2007-01-03 21:43:21 +0000
committerSascha Volkenandt <sascha (at) akv-soft (dot) de>2007-01-03 21:43:21 +0000
commitc5a0ac492575efb83ecc76524ff3c13fe1a9799b (patch)
tree7b4af9bb32c58e5d3aed9ac039180ac7533db052 /setup.cpp
parent95739a127dc2b85fe831ac13553578490fea34b0 (diff)
downloadvdr-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.cpp22
1 files changed, 13 insertions, 9 deletions
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