summaryrefslogtreecommitdiff
path: root/setup.h
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.h
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.h')
-rw-r--r--setup.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/setup.h b/setup.h
index 6d08ccf..ef1cba3 100644
--- a/setup.h
+++ b/setup.h
@@ -3,37 +3,54 @@
#include <string>
#include <list>
+#include "live.h"
namespace vdrlive {
+class Plugin;
+
class Setup
{
+ friend Setup& Plugin::GetLiveSetup();
+
public:
typedef std::list< std::string > IpList;
- static Setup& Get();
-
+ // commandline
std::string const& GetLibraryPath() const { return m_libraryPath; }
int GetServerPort() const { return m_serverPort; }
IpList const& GetServerIps() const { return m_serverIps; }
+ // vdr-setup
+ int GetLastChannel() const { return m_lastChannel; }
- bool Parse( int argc, char* argv[] );
- char const* Help() const;
+ bool ParseCommandLine( int argc, char* argv[] );
+ char const* CommandLineHelp() const;
+
+ bool ParseSetupEntry( char const* name, char const* value );
private:
Setup();
Setup( Setup const& );
mutable std::string m_helpString;
+ // commandline
std::string m_libraryPath;
int m_serverPort;
- std::list< std::string > m_serverIps;
+ IpList m_serverIps;
+ // vdr-setup
+ int m_lastChannel;
bool CheckLibraryPath();
bool CheckServerPort();
bool CheckServerIps();
};
+inline Setup& LiveSetup()
+{
+ static PluginBase& plugin = *static_cast< Plugin* >( cPluginManager::GetPlugin( PLUGIN_NAME_I18N ) );
+ return plugin.GetLiveSetup();
+}
+
} // namespace vdrlive
#endif // VDR_LIVE_SETUP_H