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