diff options
Diffstat (limited to 'vdr-vdrmanager/vdrmanager.cpp')
-rw-r--r-- | vdr-vdrmanager/vdrmanager.cpp | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/vdr-vdrmanager/vdrmanager.cpp b/vdr-vdrmanager/vdrmanager.cpp index 6542c89..2b81464 100644 --- a/vdr-vdrmanager/vdrmanager.cpp +++ b/vdr-vdrmanager/vdrmanager.cpp @@ -12,11 +12,10 @@ #include <vdr/device.h> #include <vdr/player.h> #include "vdrmanagerthread.h" -#include "compressor.h" #define VDRMANAGER_PORT 6420 -static const char *VERSION = "0.10"; +static const char *VERSION = "0.9"; static const char *DESCRIPTION = "VDR-Manager support plugin"; class cVdrManager: public cPlugin { @@ -26,7 +25,7 @@ private: int port; const char * password; bool forceCheckSvdrp; - int compressionMode; + bool forceDelete; protected: public: cVdrManager(void); @@ -58,6 +57,7 @@ cVdrManager::cVdrManager(void) { port = VDRMANAGER_PORT; password = ""; forceCheckSvdrp = false; + forceDelete = false; } cVdrManager::~cVdrManager() { @@ -73,15 +73,12 @@ cMenuSetupPage * cVdrManager::SetupMenu(void) { } const char * cVdrManager::CommandLineHelp(void) { - return " -p port port number to listen to\n" - " -P password password (none if not given). No password forces check against svdrphosts.conf.\n" - " -s force check against svdrphosts.conf, even if a password was given\n" - " -c compression selects the compression mode to use (zlib or gzip). Default is zlib"; + return " -p port port number to listen to\n -P password password (none if not given). No password forces check against svdrphosts.conf.\n -s force check against svdrphosts.conf, even if a password was given\n -f force delete of a timer or a recording even if they are active\n"; } bool cVdrManager::ProcessArgs(int argc, char *argv[]) { int c; - while ((c = getopt(argc, argv, "c::p:P:s")) != -1) + while ((c = getopt(argc, argv, "p:P:s:f")) != -1) switch (c) { case 'p': port = atoi(optarg); @@ -92,18 +89,16 @@ bool cVdrManager::ProcessArgs(int argc, char *argv[]) { case 's': forceCheckSvdrp = true; break; - case 'c': - if (!optarg) { - compressionMode = COMPRESSION_ZLIB; - } else if (optarg[0] == 'g') { - compressionMode = COMPRESSION_GZIP; - } else if (optarg[0] == 'z') { - compressionMode = COMPRESSION_ZLIB; - } else { - return false; - } + case 'f': + forceDelete = true; break; case '?': + if (optopt == 'c') { + fprintf(stderr, "Option -%c requires an argument.\n", optopt); + } else if (isprint(optopt)) + fprintf(stderr, "Unknown option `-%c'.\n", optopt); + else + fprintf(stderr, "Unknown option character `\\x%x'.\n", optopt); return false; default: return false; @@ -120,8 +115,7 @@ bool cVdrManager::Initialize(void) { // Initialize any background activities the plugin shall perform. // Start any background activities the plugin shall perform. - Thread = new cVdrManagerThread(port, password, forceCheckSvdrp, - compressionMode); + Thread = new cVdrManagerThread(port, password, forceCheckSvdrp); return Thread != NULL; } |