00001 #ifndef REMOTEENCODER_H_
00002 #define REMOTEENCODER_H_
00003
00004 #include <qstringlist.h>
00005 #include <qmutex.h>
00006 #include <qmap.h>
00007
00008 #include "mythexp.h"
00009 #include "videoouttypes.h"
00010 #include "tv.h"
00011
00012 class ProgramInfo;
00013 class MythSocket;
00014
00015 class MPUBLIC RemoteEncoder
00016 {
00017 public:
00018 RemoteEncoder(int num, const QString &host, short port);
00019 ~RemoteEncoder(void);
00020
00021 void Setup(void);
00022 bool IsValidRecorder(void);
00023 int GetRecorderNumber(void);
00024
00025 ProgramInfo *GetRecording(void);
00026 bool IsRecording(void);
00027 float GetFrameRate(void);
00028 long long GetFramesWritten(void);
00030 long long GetCachedFramesWritten(void) const { return cachedFramesWritten; }
00031 long long GetFilePosition(void);
00032 long long GetFreeDiskSpace();
00033 long long GetMaxBitrate();
00034 long long GetKeyframePosition(long long desired);
00035 void FillPositionMap(int start, int end,
00036 QMap<long long, long long> &positionMap);
00037 void StopPlaying(void);
00038 void SpawnLiveTV(QString chainid, bool pip, QString startchan);
00039 void StopLiveTV(void);
00040 void PauseRecorder(void);
00041 void FinishRecording(void);
00042 void FrontendReady(void);
00043 void CancelNextRecording(bool cancel);
00044
00045 void SetLiveRecording(bool recording);
00046 QString GetInput(void);
00047 QString SetInput(QString);
00048 int GetPictureAttribute(PictureAttribute attr);
00049 int ChangePictureAttribute(
00050 PictureAdjustType type, PictureAttribute attr, bool up);
00051 void ChangeChannel(int channeldirection);
00052 void ChangeDeinterlacer(int deint_mode);
00053 void ToggleChannelFavorite(void);
00054 void SetChannel(QString channel);
00055 int SetSignalMonitoringRate(int msec, bool notifyFrontend = true);
00056 uint GetSignalLockTimeout(QString input);
00057 bool CheckChannel(QString channel);
00058 bool ShouldSwitchToAnotherCard(QString channelid);
00059 bool CheckChannelPrefix(const QString&,uint&,bool&,QString&);
00060 void GetNextProgram(int direction,
00061 QString &title, QString &subtitle, QString &desc,
00062 QString &category, QString &starttime, QString &endtime,
00063 QString &callsign, QString &iconpath,
00064 QString &channelname, QString &chanid,
00065 QString &seriesid, QString &programid);
00066 void GetChannelInfo(QMap<QString, QString> &infoMap, uint chanid = 0);
00067 bool SetChannelInfo(const QMap<QString, QString> &infoMap);
00068 bool GetErrorStatus(void) { bool v = backendError; backendError = false;
00069 return v; }
00070
00071 private:
00072 MythSocket *openControlSocket(const QString &host, short port);
00073 void SendReceiveStringList(QStringList &strlist);
00074
00075 int recordernum;
00076
00077 MythSocket *controlSock;
00078 QMutex lock;
00079
00080 QString remotehost;
00081 short remoteport;
00082
00083 QString lastchannel;
00084 QString lastinput;
00085
00086 bool backendError;
00087 long long cachedFramesWritten;
00088 QMap<QString,uint> cachedTimeout;
00089 };
00090
00091 #endif
00092