File: xineExternal.h

package info (click to toggle)
vdr-plugin-xine 0.9.4-16
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,756 kB
  • sloc: ansic: 14,014; makefile: 86; sh: 34
file content (74 lines) | stat: -rw-r--r-- 1,141 bytes parent folder | download | duplicates (5)
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

#ifndef __XINEEXTERNAL_H
#define __XINEEXTERNAL_H



#include "xineCommon.h"

#include <vdr/thread.h>



#define FIFO_NAME_EXT_CONTROL "/external.control"
#define FIFO_NAME_EXT_RESULT  "/external.result"

#define EXTERNAL_COMMAND_MAX_LEN (1000)



namespace PluginXine
{

  class cXineLib;
  
  class cXineExternal : public cThread
  {
    int m_fdControl;
    int m_fdResult;

    bool m_shutdown;
    cMutex m_shutdownMutex;
    cCondVar m_shutdownCondVar;

    bool m_connected;

    cXineLib *m_xineLib;

    cMutex m_enabledMutex;
    bool m_enabled;
    
    char m_command[ EXTERNAL_COMMAND_MAX_LEN ];
    
    virtual void Action(void);

    bool checkConnect();
    bool isConnected();

    bool readCommand();

    void cmdPlay(const char *const mrl);
    bool writeResult(const char *result);

  public:
    cXineExternal();
    virtual ~cXineExternal();

    void setXineLib(cXineLib *const xineLib)
    {
      m_xineLib = xineLib;
    }

    void enable(const bool enable);
    void externalStreamFinished();
    void disconnect();
    
    void StartExternal();
    void StopExternal();
  };

};



#endif //__XINEEXTERNAL_H