vdr-plugin-streamdev/server/connectionVTP.h

82 lines
1.9 KiB
C
Raw Normal View History

2004-12-30 23:43:55 +01:00
#ifndef VDR_STREAMDEV_SERVERS_CONNECTIONVTP_H
#define VDR_STREAMDEV_SERVERS_CONNECTIONVTP_H
#include "server/connection.h"
#include "server/livestreamer.h"
2004-12-30 23:43:55 +01:00
class cTBSocket;
2005-05-09 22:22:29 +02:00
class cLSTEHandler;
class cLSTCHandler;
class cLSTTHandler;
2004-12-30 23:43:55 +01:00
class cConnectionVTP: public cServerConnection {
2005-05-09 22:22:29 +02:00
friend class cLSTEHandler;
// if your compiler doesn't understand the following statement
// (e.g. gcc 2.x), simply remove it and try again ;-)
using cServerConnection::Respond;
2005-05-09 22:22:29 +02:00
2004-12-30 23:43:55 +01:00
private:
2005-05-09 22:22:29 +02:00
cTBSocket *m_LiveSocket;
2004-12-30 23:43:55 +01:00
cStreamdevLiveStreamer *m_LiveStreamer;
2005-05-09 22:22:29 +02:00
char *m_LastCommand;
bool m_NoTSPIDS;
// Members adopted for SVDRP
2004-12-30 23:43:55 +01:00
cRecordings Recordings;
2005-05-09 22:22:29 +02:00
cLSTEHandler *m_LSTEHandler;
cLSTCHandler *m_LSTCHandler;
cLSTTHandler *m_LSTTHandler;
protected:
template<class cHandler>
bool CmdLSTX(cHandler *&Handler, char *Option);
2004-12-30 23:43:55 +01:00
public:
cConnectionVTP(void);
virtual ~cConnectionVTP();
virtual void Welcome(void);
virtual void Reject(void);
virtual bool Abort(void) const;
2004-12-30 23:43:55 +01:00
virtual void Detach(void);
virtual void Attach(void);
2005-05-09 22:22:29 +02:00
virtual bool Command(char *Cmd);
2004-12-30 23:43:55 +01:00
bool CmdCAPS(char *Opts);
bool CmdPROV(char *Opts);
bool CmdPORT(char *Opts);
bool CmdTUNE(char *Opts);
bool CmdADDP(char *Opts);
bool CmdDELP(char *Opts);
bool CmdADDF(char *Opts);
bool CmdDELF(char *Opts);
bool CmdABRT(char *Opts);
bool CmdQUIT(char *Opts);
bool CmdSUSP(char *Opts);
2005-05-09 22:22:29 +02:00
// Thread-safe implementations of SVDRP commands
2004-12-30 23:43:55 +01:00
bool CmdLSTE(char *Opts);
2005-05-09 22:22:29 +02:00
bool CmdLSTC(char *Opts);
2004-12-30 23:43:55 +01:00
bool CmdLSTT(char *Opts);
2005-05-09 22:22:29 +02:00
// Commands adopted from SVDRP
bool CmdMODT(const char *Option);
bool CmdNEWT(const char *Option);
bool CmdDELT(const char *Option);
//bool CmdLSTR(char *Opts);
//bool CmdDELR(char *Opts);
bool Respond(int Code, const char *Message, ...)
__attribute__ ((format (printf, 3, 4)));
2004-12-30 23:43:55 +01:00
};
inline bool cConnectionVTP::Abort(void) const
{
return m_LiveStreamer && m_LiveStreamer->Abort();
}
2004-12-30 23:43:55 +01:00
#endif // VDR_STREAMDEV_SERVERS_CONNECTIONVTP_H