2004-12-30 23:43:55 +01:00
|
|
|
#ifndef VDR_STREAMDEV_SERVERS_CONNECTIONVTP_H
|
|
|
|
#define VDR_STREAMDEV_SERVERS_CONNECTIONVTP_H
|
|
|
|
|
|
|
|
#include "server/connection.h"
|
2009-07-01 12:46:15 +02:00
|
|
|
#include "server/recplayer.h"
|
2004-12-30 23:43:55 +01:00
|
|
|
|
|
|
|
class cTBSocket;
|
2007-04-24 13:03:41 +02:00
|
|
|
class cStreamdevLiveStreamer;
|
|
|
|
class cStreamdevFilterStreamer;
|
2005-05-09 22:22:29 +02:00
|
|
|
class cLSTEHandler;
|
|
|
|
class cLSTCHandler;
|
|
|
|
class cLSTTHandler;
|
2009-07-01 12:46:15 +02:00
|
|
|
class cLSTRHandler;
|
2004-12-30 23:43:55 +01:00
|
|
|
|
|
|
|
class cConnectionVTP: public cServerConnection {
|
2005-05-09 22:22:29 +02:00
|
|
|
friend class cLSTEHandler;
|
2008-07-16 08:00:48 +02:00
|
|
|
#if !defined __GNUC__ || __GNUC__ >= 3
|
2007-03-19 13:06:13 +01:00
|
|
|
using cServerConnection::Respond;
|
2008-07-16 08:00:48 +02:00
|
|
|
#endif
|
2005-05-09 22:22:29 +02:00
|
|
|
|
2004-12-30 23:43:55 +01:00
|
|
|
private:
|
2007-04-24 13:03:41 +02:00
|
|
|
cTBSocket *m_LiveSocket;
|
|
|
|
cStreamdevLiveStreamer *m_LiveStreamer;
|
|
|
|
cTBSocket *m_FilterSocket;
|
|
|
|
cStreamdevFilterStreamer *m_FilterStreamer;
|
2009-07-01 12:46:15 +02:00
|
|
|
cTBSocket *m_RecSocket;
|
|
|
|
cTBSocket *m_DataSocket;
|
2004-12-30 23:43:55 +01:00
|
|
|
|
2005-05-09 22:22:29 +02:00
|
|
|
char *m_LastCommand;
|
2007-09-21 14:45:31 +02:00
|
|
|
eStreamType m_StreamType;
|
2008-03-13 17:01:17 +01:00
|
|
|
bool m_FiltersSupport;
|
2009-07-01 12:46:15 +02:00
|
|
|
RecPlayer *m_RecPlayer;
|
2005-05-09 22:22:29 +02:00
|
|
|
|
2010-12-02 09:57:17 +01:00
|
|
|
// Priority is only known in PROV command
|
|
|
|
// Store in here for later use in TUNE call
|
|
|
|
const cChannel *m_TuneChannel;
|
|
|
|
int m_TunePriority;
|
|
|
|
|
2005-05-09 22:22:29 +02:00
|
|
|
// Members adopted for SVDRP
|
|
|
|
cLSTEHandler *m_LSTEHandler;
|
|
|
|
cLSTCHandler *m_LSTCHandler;
|
|
|
|
cLSTTHandler *m_LSTTHandler;
|
2009-07-01 12:46:15 +02:00
|
|
|
cLSTRHandler *m_LSTRHandler;
|
2005-05-09 22:22:29 +02:00
|
|
|
|
|
|
|
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);
|
|
|
|
|
2011-11-28 16:23:57 +01:00
|
|
|
virtual cString ToText() const;
|
|
|
|
|
2007-04-02 12:32:34 +02:00
|
|
|
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);
|
2009-07-01 12:46:15 +02:00
|
|
|
bool CmdREAD(char *Opts);
|
2004-12-30 23:43:55 +01:00
|
|
|
bool CmdTUNE(char *Opts);
|
2009-07-01 12:46:15 +02:00
|
|
|
bool CmdPLAY(char *Opts);
|
2010-12-02 09:57:17 +01:00
|
|
|
bool CmdPRIO(char *Opts);
|
2011-07-06 09:13:50 +02:00
|
|
|
bool CmdSGNL(char *Opts);
|
2004-12-30 23:43:55 +01:00
|
|
|
bool CmdADDP(char *Opts);
|
|
|
|
bool CmdDELP(char *Opts);
|
|
|
|
bool CmdADDF(char *Opts);
|
|
|
|
bool CmdDELF(char *Opts);
|
|
|
|
bool CmdABRT(char *Opts);
|
2007-04-24 13:03:41 +02:00
|
|
|
bool CmdQUIT(void);
|
|
|
|
bool CmdSUSP(void);
|
2004-12-30 23:43:55 +01:00
|
|
|
|
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);
|
2009-07-01 12:46:15 +02:00
|
|
|
bool CmdLSTR(char *Opts);
|
2004-12-30 23:43:55 +01:00
|
|
|
|
2005-05-09 22:22:29 +02:00
|
|
|
// Commands adopted from SVDRP
|
2009-07-01 12:46:15 +02:00
|
|
|
bool CmdSTAT(const char *Option);
|
2005-05-09 22:22:29 +02:00
|
|
|
bool CmdMODT(const char *Option);
|
|
|
|
bool CmdNEWT(const char *Option);
|
|
|
|
bool CmdDELT(const char *Option);
|
2009-07-01 12:46:15 +02:00
|
|
|
bool CmdNEXT(const char *Option);
|
|
|
|
bool CmdNEWC(const char *Option);
|
|
|
|
bool CmdMODC(const char *Option);
|
|
|
|
bool CmdMOVC(const char *Option);
|
|
|
|
bool CmdDELC(const char *Option);
|
|
|
|
bool CmdDELR(const char *Option);
|
|
|
|
bool CmdRENR(const char *Option);
|
2005-05-09 22:22:29 +02:00
|
|
|
|
|
|
|
bool Respond(int Code, const char *Message, ...)
|
|
|
|
__attribute__ ((format (printf, 3, 4)));
|
2004-12-30 23:43:55 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VDR_STREAMDEV_SERVERS_CONNECTIONVTP_H
|