summaryrefslogtreecommitdiff
path: root/streamdev-server.c
blob: b09a85d5ff6d60a8443618a3fa32bf3600903f24 (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
/*
 * streamdev.c: A plugin for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id: streamdev-server.c,v 1.1 2004/12/30 22:43:59 lordjaxom Exp $
 */

#include "streamdev-server.h"
#include "server/setup.h"
#include "server/server.h"
#include "server/suspend.h"
#include "i18n.h"

const char *cPluginStreamdevServer::DESCRIPTION = "VDR Streaming Server";

cPluginStreamdevServer::cPluginStreamdevServer(void) {
}

cPluginStreamdevServer::~cPluginStreamdevServer() {
	cStreamdevServer::Exit();
}

const char *cPluginStreamdevServer::Description(void) {
	return tr(DESCRIPTION);
}

bool cPluginStreamdevServer::Start(void) {
	i18n_name = Name();
	RegisterI18n(Phrases);

	if (!StreamdevHosts.Load(STREAMDEVHOSTS, true, true)) {
		esyslog("streamdev-server: error while loading %s", STREAMDEVHOSTS);
		fprintf(stderr, "streamdev-server: error while loading %s\n");
		if (access(STREAMDEVHOSTS, F_OK) != 0)
			fprintf(stderr, "  Please install streamdevhosts.conf into the path "
			                "printed above. Without it\n" 
                      "  no client will be able to access your streaming-"
                      "server. An example can be\n"
                      "  found together with this plugin's sources.\n");
		return false;
	}

	cStreamdevServer::Init();

  return true;
}

bool cPluginStreamdevServer::Active(void) {
	return cStreamdevServer::Active();
}

const char *cPluginStreamdevServer::MainMenuEntry(void) {
	if (StreamdevServerSetup.SuspendMode == smOffer && !cSuspendCtl::IsActive())
		return tr("Suspend Live TV");
	return NULL;
}

cOsdObject *cPluginStreamdevServer::MainMenuAction(void) {
	cControl::Launch(new cSuspendCtl);
	return NULL;
}

cMenuSetupPage *cPluginStreamdevServer::SetupMenu(void) {
  return new cStreamdevServerMenuSetupPage;
}

bool cPluginStreamdevServer::SetupParse(const char *Name, const char *Value) {
  return StreamdevServerSetup.SetupParse(Name, Value);
}

VDRPLUGINCREATOR(cPluginStreamdevServer); // Don't touch this!