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.h | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'setup.h') diff --git a/setup.h b/setup.h index 6d08ccf..ef1cba3 100644 --- a/setup.h +++ b/setup.h @@ -3,37 +3,54 @@ #include #include +#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 -- cgit v1.2.3