summaryrefslogtreecommitdiff
path: root/upnp.h
blob: 45c7c2227d9cb8c65d83bcb031df3483da286d6b (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/* 
 * File:   upnp.h
 * Author: savop
 *
 * Created on 17. April 2009, 20:53
 */

#ifndef _UPNP_H
#define	_UPNP_H

#include <vdr/thread.h>
#include <vdr/plugin.h>
#include "common.h"
#include "server.h"

class cUPnPServer;

/**
 * The UPnP/DLNA plugin
 *
 * This is a UPnP/DLNA media server plugin. It supports live-TV and recordings
 * of the VDR as well as custom video files.
 */
class cPluginUpnp : public cPlugin {
private:
    // Add any member variables or functions you may need here.
    cUPnPServer* mUpnpServer;
    static const char*  mConfigDirectory;
public:
    cPluginUpnp(void);
    virtual ~cPluginUpnp();
    /**
     * Get the version of the plugin
     *
     * Returns the version string of the plugin
     *
     * @return a string representation of the plugin version
     */
    virtual const char *Version(void);
    /**
     * Get the description
     *
     * This returns a brief description of the plugin and what it does.
     *
     * @return the description of the plugin
     */
    virtual const char *Description(void);
    /**
     * Get the command line help
     *
     * This returns the command line help output, which comes, when the user
     * types \c --help into the command line.
     *
     * @return the command line help
     */
    virtual const char *CommandLineHelp(void);
    /*! @copydoc cUPnPConfig::processArgs */
    virtual bool ProcessArgs(int argc, char *argv[]);
    /**
     * Initializes the plugin
     *
     * This initializes any background activities of the plugin.
     *
     * @return returns
     * - \bc true, if initializing was successful
     * - \bc false, otherwise
     */
    virtual bool Initialize(void);
    /**
     * Starts the plugin
     *
     * This starts the plugin. It starts additional threads, which are required
     * by the plugin.
     *
     * @return returns
     * - \bc true, if starting was successful
     * - \bc false, otherwise
     */
    virtual bool Start(void);
    /**
     * Stops the plugin
     *
     * This stops the plugin and all its components
     */
    virtual void Stop(void);
    /**
     * Message if still active
     *
     * This returns a message if the plugin is still active when a user attempts
     * to shut down the VDR.
     *
     * @return the message shown on the screen.
     */
    virtual cString Active(void);
    /**
     * Setup menu
     *
     * This creates a new instance of the setup menu, which is shown to the user
     * when he enters the VDR plugin setup menu
     *
     * @return the menu of the plugin
     */
    virtual cMenuSetupPage *SetupMenu(void);
    /*! @copydoc cUPnPConfig::parseSetup */
    virtual bool SetupParse(const char *Name, const char *Value);
    /**
     * Get the configuration directory
     *
     * This returns the directory, where configuration files are stored.
     *
     * @return the directory of the configuration files.
     */
    static const char* getConfigDirectory();
};

extern cCondWait DatabaseLocker;        ///< Locks the database to be loaded only if
                                        ///< the configuration file directory is set

#endif	/* _UPNP_H */