summaryrefslogtreecommitdiff
path: root/live.cpp
blob: da7c3006eb4157c83a92621070e9e6b996b66e7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
 * httpd.c: A plugin for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id: live.cpp,v 1.1 2007/01/02 19:18:27 lordjaxom Exp $
 */

#include <memory>
#include <vdr/plugin.h>
#include "setup.h"
#include "thread.h"

namespace vdrlive {

using namespace std;

static const char *VERSION        = "0.0.1";
static const char *DESCRIPTION    = "Enter description for 'httpd' plugin";

class Plugin : public cPlugin {
public:
	Plugin(void);
	virtual const char *Version(void) { return VERSION; }
	virtual const char *Description(void) { return DESCRIPTION; }
	virtual const char *CommandLineHelp(void);
	virtual bool ProcessArgs(int argc, char *argv[]);
	virtual bool Start(void);
	virtual void Stop(void);
	virtual void MainThreadHook(void);
	virtual cString Active(void);
	virtual cMenuSetupPage *SetupMenu(void);
	virtual bool SetupParse(const char *Name, const char *Value);

private:
	auto_ptr< ServerThread > m_thread;
};

Plugin::Plugin(void)
{
}

const char *Plugin::CommandLineHelp(void)
{
	return "-L DIR   --lib=DIR       libtnt-live.so will be searched in DIR\n";
}

bool Plugin::ProcessArgs(int argc, char *argv[])
{
	return Setup::Get().Parse( argc, argv );
}

bool Plugin::Start(void)
{
	// XXX error handling
	m_thread.reset( new ServerThread );
	m_thread->Start();
	return true;
}

void Plugin::Stop(void)
{
}

void Plugin::MainThreadHook(void)
{
}

cString Plugin::Active(void)
{
	return NULL;
}

cMenuSetupPage *Plugin::SetupMenu(void)
{
	return NULL;
}

bool Plugin::SetupParse(const char *Name, const char *Value)
{
	return true;
}

} // namespace vdrlive

VDRPLUGINCREATOR(vdrlive::Plugin); // Don't touch this!