File: osd.h

package info (click to toggle)
vdr-plugin-markad 4.2.15-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,084 kB
  • sloc: cpp: 22,441; python: 613; makefile: 270; sh: 95
file content (63 lines) | stat: -rw-r--r-- 1,563 bytes parent folder | download | duplicates (2)
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
/*
 * osd.h: A program for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 */

#include "global.h"
#if !defined(__osd_h_) && defined(POSIX)
#define __osd_h_

#include "debug.h"

#define trcs(c) bind_textdomain_codeset("markad",c)
#define tr(s) dgettext("markad",s)

/**
 * send OSD message to VDR
 */
class cOSDMessage {
public:

    /** constructor
     * @param hostName   name or IP address of VDR
     * @param portNumber port number for OSD messages
     */
    cOSDMessage(const char *hostName, int portNumber);

    ~cOSDMessage();

    /**
     * send message to VDR OSD
     * @param format message format
     * @return 0 for success, -1 otherwise
     */
    int Send(const char *format, ...);

private:

    /**
     * copy OSM object (not used)
     */
    cOSDMessage(const cOSDMessage &cOSDMessageCopy);

    /**
     * = operator for OSM object (not used)
     */
    cOSDMessage &operator=(const cOSDMessage &foo);

    char *host;                                      //!< VDR host name or IP address
    //!<
    int port;                                        //!< VDR port number to send OSD messages
    //!<
    char *msg     = nullptr;                            //!< OSD message
    //!<
    pthread_t tid = 0;                               //!< thread id of the OSD message
    //!<
    static void *SendMessage(void *posd);             //!< send OSD message
    //!<
    static bool ReadReply(int fd, char **reply = nullptr);     //!< read reply from OSD
    //!<
};
#endif