~ubuntu-branches/ubuntu/quantal/vdr-plugin-xine/quantal

« back to all changes in this revision

Viewing changes to xineExternal.h

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Schmidt
  • Date: 2008-04-06 21:34:14 UTC
  • Revision ID: james.westby@ubuntu.com-20080406213414-54lbe5pj1cbbquon
Tags: upstream-0.8.2
ImportĀ upstreamĀ versionĀ 0.8.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
#ifndef __XINEEXTERNAL_H
 
3
#define __XINEEXTERNAL_H
 
4
 
 
5
 
 
6
 
 
7
#include "xineCommon.h"
 
8
 
 
9
#include <vdr/thread.h>
 
10
 
 
11
 
 
12
 
 
13
#define FIFO_NAME_EXT_CONTROL "/external.control"
 
14
#define FIFO_NAME_EXT_RESULT  "/external.result"
 
15
 
 
16
#define EXTERNAL_COMMAND_MAX_LEN (1000)
 
17
 
 
18
 
 
19
 
 
20
namespace PluginXine
 
21
{
 
22
 
 
23
  class cXineLib;
 
24
  
 
25
  class cXineExternal : public cThread
 
26
  {
 
27
    int m_fdControl;
 
28
    int m_fdResult;
 
29
 
 
30
    bool m_shutdown;
 
31
    cMutex m_shutdownMutex;
 
32
    cCondVar m_shutdownCondVar;
 
33
 
 
34
    bool m_connected;
 
35
 
 
36
    cXineLib *m_xineLib;
 
37
 
 
38
    bool m_enabled;
 
39
    
 
40
    char m_command[ EXTERNAL_COMMAND_MAX_LEN ];
 
41
    
 
42
    virtual void Action(void);
 
43
 
 
44
    bool checkConnect();
 
45
    bool isConnected();
 
46
 
 
47
    bool readCommand();
 
48
 
 
49
    void cmdPlay(const char *const mrl);
 
50
    bool writeResult(const char *result);
 
51
 
 
52
  public:
 
53
    cXineExternal();
 
54
    virtual ~cXineExternal();
 
55
 
 
56
    void setXineLib(cXineLib *const xineLib)
 
57
    {
 
58
      m_xineLib = xineLib;
 
59
    }
 
60
 
 
61
    void enable(const bool enable);
 
62
    void externalStreamFinished();
 
63
    void disconnect();
 
64
    
 
65
    void StartExternal();
 
66
    void StopExternal();
 
67
  };
 
68
 
 
69
};
 
70
 
 
71
 
 
72
 
 
73
#endif //__XINEEXTERNAL_H