summaryrefslogtreecommitdiff
path: root/upnp.cpp
blob: 7bcaf206067ada39b62b38a480e482283037c3a3 (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
/*
 * upnp.c: A plugin for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id$
 */

#include <iostream>
#include "upnp.h"
#include "include/setup.h"

using namespace std;
using namespace upnp;

cPluginUpnp::cPluginUpnp(void)
{
  mMediaServer = cMediaServer::GetInstance();
}

cPluginUpnp::~cPluginUpnp()
{
  // Clean up after yourself!
}

const char *cPluginUpnp::CommandLineHelp(void)
{
  // Return a string that describes all known command line options.
  return NULL;
}

bool cPluginUpnp::ProcessArgs(int argc, char *argv[])
{
  // Implement command line argument processing here if applicable.
  return true;
}

bool cPluginUpnp::Initialize(void)
{
  // Initialize any background activities the plugin shall perform.
  return mMediaServer->Initialize();
}

bool cPluginUpnp::Start(void)
{
  // Start any background activities the plugin shall perform.
  return mMediaServer->Start();
}

void cPluginUpnp::Stop(void)
{
  // Stop any background activities the plugin is performing.
  mMediaServer->Stop();
}

void cPluginUpnp::Housekeeping(void)
{
  // Perform any cleanup or other regular tasks.
}

void cPluginUpnp::MainThreadHook(void)
{
  // Perform actions in the context of the main program thread.
  // WARNING: Use with great care - see PLUGINS.html!
}

cMenuSetupPage *cPluginUpnp::SetupMenu(void)
{
  // Return a setup menu in case the plugin supports one.
  return new cMenuSetupUPnP();
}

bool cPluginUpnp::SetupParse(const char *Name, const char *Value)
{
  // Parse your own setup parameters and store their values.
  upnp::cConfig config = mMediaServer->GetConfiguration();

  if(!cMenuSetupUPnP::SetupParse(Name, Value, config)) return false;

  mMediaServer->SetConfiguration(config);

  return true;
}

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