diff options
author | lordjaxom <lordjaxom> | 2004-12-30 22:43:55 +0000 |
---|---|---|
committer | lordjaxom <lordjaxom> | 2004-12-30 22:43:55 +0000 |
commit | 302fa2e67276bd0674e81e2a9a01b9e91dd45d8c (patch) | |
tree | a454884a16e0ffa48b5ce3e4ce1a66eb874a9de0 /client/socket.h | |
download | vdr-plugin-streamdev-302fa2e67276bd0674e81e2a9a01b9e91dd45d8c.tar.gz vdr-plugin-streamdev-302fa2e67276bd0674e81e2a9a01b9e91dd45d8c.tar.bz2 |
Initial revision
Diffstat (limited to 'client/socket.h')
-rw-r--r-- | client/socket.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/client/socket.h b/client/socket.h new file mode 100644 index 0000000..d4f360a --- /dev/null +++ b/client/socket.h @@ -0,0 +1,71 @@ +/* + * $Id: socket.h,v 1.1 2004/12/30 22:44:04 lordjaxom Exp $ + */ + +#ifndef VDR_STREAMDEV_CLIENT_CONNECTION_H +#define VDR_STREAMDEV_CLIENT_CONNECTION_H + +#include <tools/socket.h> + +#include "common.h" + +#define CMD_LOCK cMutexLock CmdLock((cMutex*)&m_Mutex) + +class cRemoteRecordings; +class cRemoteRecording; +class cRemoteTimers; +class cRemoteTimer; +class cPES2TSRemux; + +class cClientSocket: public cTBSocket { +private: + bool m_StreamPIDS; + cTBSocket *m_DataSockets[si_Count]; + cMutex m_Mutex; + +protected: + /* Send Command, and return true if the command results in Expected. + Returns false on failure, setting errno appropriately if it has been + a system failure. If Expected is zero, returns immediately after + sending the command. */ + bool Command(const cTBString &Command, uint Expected = 0, + uint TimeoutMs = 1500); + + /* Fetch results from an ongoing Command called with Expected == 0. Returns + true if the response has the code Expected, returning an internal buffer + in the array pointer pointed to by Result. Returns false on failure, + setting errno appropriately if it has been a system failure. */ + bool Expect(uint Expected, cTBString *Result = NULL, uint TimeoutMs = 1500); + +public: + cClientSocket(void); + virtual ~cClientSocket(); + + void Reset(void); + + bool CheckConnection(void); + bool ProvidesChannel(const cChannel *Channel, int Priority); + bool CreateDataConnection(eSocketId Id); + bool SetChannelDevice(const cChannel *Channel); + bool SetPid(int Pid, bool On); +#if VDRVERSNUM >= 10300 + bool SetFilter(ushort Pid, uchar Tid, uchar Mask, bool On); +#endif + bool CloseDvr(void); + bool SynchronizeEPG(void); + bool LoadRecordings(cRemoteRecordings &Recordings); + bool StartReplay(const char *Filename); + bool AbortReplay(void); + bool DeleteRecording(cRemoteRecording *Recording); + bool LoadTimers(cRemoteTimers &Timers); + bool SaveTimer(cRemoteTimer *Old, cRemoteTimer &New); + bool DeleteTimer(cRemoteTimer *Timer); + bool SuspendServer(void); + bool Quit(void); + + cTBSocket *DataSocket(eSocketId Id) const; +}; + +extern class cClientSocket ClientSocket; + +#endif // VDR_STREAMDEV_CLIENT_CONNECTION_H |