]> git.vomp.tv Git - vompserver.git/blob - vompserver.c
New structure
[vompserver.git] / vompserver.c
1 /*
2     Copyright 2004-2005 Chris Tallon
3
4     This file is part of VOMP.
5
6     VOMP is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     VOMP is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with VOMP; if not, write to the Free Software
18     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20
21 /*
22  * vomp-server.c: A plugin for the Video Disk Recorder
23  *
24  * See the README file for copyright information and how to reach the author.
25  *
26  * $Id$
27  */
28
29 #include <vdr/plugin.h>
30
31 #include "mvpserver.h"
32
33 static const char *VERSION        = "0.1.2";
34 static const char *DESCRIPTION    = "VDR on MVP plugin by Chris Tallon";
35
36 class cPluginVompserver : public cPlugin
37 {
38 public:
39   cPluginVompserver(void);
40   virtual ~cPluginVompserver();
41   virtual const char *Version(void) { return VERSION; }
42   virtual const char *Description(void) { return DESCRIPTION; }
43   virtual const char *CommandLineHelp(void);
44   virtual bool ProcessArgs(int argc, char *argv[]);
45   virtual bool Initialize(void);
46   virtual bool Start(void);
47   virtual bool SetupParse(const char *Name, const char *Value);
48
49 private:
50
51   MVPServer mvpserver;
52 };
53
54 cPluginVompserver::cPluginVompserver(void)
55 {
56   // Initialize any member variables here.
57   // DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL
58   // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT!
59 }
60
61 bool cPluginVompserver::Start(void)
62 {
63   // Start any background activities the plugin shall perform.
64   int success = mvpserver.run();
65   if (success) return true;
66   else return false;
67 }
68
69 cPluginVompserver::~cPluginVompserver()
70 {
71   // Clean up after yourself!
72   mvpserver.stop();
73 }
74
75 const char *cPluginVompserver::CommandLineHelp(void)
76 {
77   // Return a string that describes all known command line options.
78   return NULL;
79 }
80
81 bool cPluginVompserver::ProcessArgs(int argc, char *argv[])
82 {
83   // Implement command line argument processing here if applicable.
84   return true;
85 }
86
87 bool cPluginVompserver::Initialize(void)
88 {
89   // Initialize any background activities the plugin shall perform.
90   return true;
91 }
92
93 bool cPluginVompserver::SetupParse(const char *Name, const char *Value)
94 {
95   // Parse your own setup parameters and store their values.
96   return false;
97 }
98
99 VDRPLUGINCREATOR(cPluginVompserver); // Don't touch this!