25 #include "proto/mythprotomonitor.h" 26 #include "mythtypes.h" 27 #include "mythwsapi.h" 35 Control(
const std::string& server,
unsigned protoPort,
unsigned wsapiPort,
const std::string& wsapiSecurityPin);
36 Control(
const std::string& server,
unsigned protoPort,
unsigned wsapiPort,
const std::string& wsapiSecurityPin,
bool frontend);
41 bool IsOpen() {
return m_monitor.IsOpen(); }
42 bool HasHanging()
const {
return m_monitor.HasHanging(); }
43 void CleanHanging() { m_monitor.CleanHanging(); }
44 ProtoBase::ERROR_t GetProtoError()
const {
return m_monitor.GetProtoError(); }
52 return m_wsapi.CheckService();
61 return m_wsapi.GetServerHostName();
70 return m_wsapi.GetVersion();
81 return m_monitor.QueryFreeSpaceSummary(total, used);
91 return m_monitor.QueryGenpixmap(program);
102 return m_monitor.CancelNextRecording(rnum, cancel);
111 SettingPtr
GetSetting(
const std::string& key,
const std::string& hostname)
154 bool PutSetting(
const std::string& key,
const std::string& value,
bool myhost)
156 return m_wsapi.
PutSetting(key, value, myhost);
221 if (wsv.ranking >= 0x00060000)
236 if (wsv.ranking >= 0x00060000)
237 return m_wsapi.
DeleteRecording(program.recording.recordedId, forceDelete, allowRerecord);
238 if (wsv.ranking >= 0x00020001)
239 return m_wsapi.
DeleteRecording(program.channel.chanId, program.recording.startTs, forceDelete, allowRerecord);
240 return m_monitor.DeleteRecording(program, forceDelete, allowRerecord);
243 bool UndeleteRecording(
const Program& program)
246 if (wsv.ranking >= 0x00060000)
248 if (wsv.ranking >= 0x00020001)
249 return m_wsapi.
UnDeleteRecording(program.channel.chanId, program.recording.startTs);
250 return m_monitor.UndeleteRecording(program);
253 bool StopRecording(
const Program& program)
255 return m_monitor.StopRecording(program);
431 WSStreamPtr
GetFile(
const std::string& filename,
const std::string& sgname)
433 return m_wsapi.
GetFile(filename, sgname);
443 WSStreamPtr
GetChannelIcon(uint32_t chanid,
unsigned width = 0,
unsigned height = 0)
469 return m_wsapi.
GetPreviewImage(program.channel.chanId, program.recording.startTs, width, height);
481 return m_wsapi.
GetPreviewImageUrl(program.channel.chanId, program.recording.startTs, width, height);
537 if (wsv.ranking >= 0x00060001)
540 return m_monitor.GetCutList(program);
542 return MarkListPtr(
new MarkList);
554 if (wsv.ranking >= 0x00060001)
557 return m_monitor.GetCommBreakList(program);
559 return MarkListPtr(
new MarkList);
568 return m_monitor.BlockShutdown();
577 return m_monitor.AllowShutdown();
bool CancelNextRecording(int rnum, bool cancel)
Ask the backend to cancel/continue next recording.
ProgramMapPtr GetProgramGuide(uint32_t chanid, time_t starttime, time_t endtime)
Query the guide information for a particular time period and a channel.
ChannelPtr GetChannel(uint32_t chanid)
GET Channel/GetChannelInfo.
WSStreamPtr GetPreviewImage(uint32_t chanid, time_t recstartts, unsigned width=0, unsigned height=0)
GET Content/GetPreviewImage.
bool AddRecordSchedule(RecordSchedule &record)
POST Dvr/AddRecordSchedule.
bool AllowShutdown()
Allows backend to shut down again after a previous call to BlockShutdown().
SettingMapPtr GetSettings(const std::string &hostname)
GET Myth/GetSetting.
CaptureCardListPtr GetCaptureCardList()
GET Capture/GetCaptureCardList.
bool UpdateRecordSchedule(RecordSchedule &record)
Update a recording rule.
std::string GetChannelIconUrl(uint32_t chanid, unsigned width=0, unsigned height=0)
Returns URL for channel icon.
SettingPtr GetSetting(const std::string &key, bool myhost)
Query setting by its key.
ProgramListPtr GetConflictList()
GET Dvr/GetConflictList.
MarkListPtr GetCommBreakList(const Program &program, int unit=0)
Request a set of commercial break marks for a recording.
WSStreamPtr GetPreviewImage(const Program &program, unsigned width=0, unsigned height=0)
Get, and optionally scale, an preview thumbnail for a given recording by timestamp, chanid and starttime.
RecordSchedulePtr GetRecordSchedule(uint32_t recordid)
Get a single recording rule, by record id.
bool RemoveRecordSchedule(uint32_t recordid)
Remove a recording rule.
ChannelListPtr GetChannelList(uint32_t sourceid, bool onlyVisible=true)
GET Channel/GetChannelInfoList.
ProgramListPtr GetRecordedList(unsigned n=0, bool descending=false)
Query information on all recorded programs.
bool QueryFreeSpaceSummary(int64_t *total, int64_t *used)
Queries the backend for free space summary.
std::string GetServerHostName()
Query server host name.
CaptureCardListPtr GetCaptureCardList()
Get all configured capture devices.
ChannelPtr GetChannel(uint32_t chanid)
Retrieve a single channel, by channel id.
std::map< uint32_t, ProgramMapPtr > GetProgramGuide(time_t starttime, time_t endtime)
Query the guide information for a particular time period.
StringListPtr GetRecGroupList()
Get list of recording group.
ProgramPtr GetRecorded(uint32_t chanid, time_t recstartts)
Query information on a single item from recordings.
ProgramListPtr GetExpiringList()
GET Dvr/GetExpiringList.
StringListPtr GetRecGroupList()
GET Dvr/GetRecGroupList.
bool DeleteRecording(const Program &program, bool forceDelete=false, bool allowRerecord=false)
Remove a Recording from the database and disk.
WSStreamPtr GetRecordingArtwork(const std::string &type, const std::string &inetref, uint16_t season, unsigned width=0, unsigned height=0)
GET Content/GetRecordingArtwork.
ProgramListPtr GetConflictList()
Query information on upcoming items which will not record due to conflicts.
RecordScheduleListPtr GetRecordScheduleList()
Query all configured recording rules.
bool DisableRecordSchedule(uint32_t recordid)
POST Dvr/DisableRecordSchedule.
std::string GetRecordingArtworkUrl(const std::string &type, const std::string &inetref, uint16_t season, unsigned width=0, unsigned height=0)
Returns URL for recording artwork.
SettingPtr GetSetting(const std::string &key, const std::string &hostname)
Query setting by its key.
ProgramListPtr GetRecordedList(unsigned n=0, bool descending=false)
GET Dvr/GetRecordedList.
RecordSchedulePtr GetRecordSchedule(uint32_t recordid)
GET Dvr/GetRecordSchedule.
bool RefreshRecordedArtwork(Program &program)
Refresh artwork available for a recording.
std::string GetBackendServerIP(const std::string &hostName)
Query backend server IP.
bool AddRecordSchedule(RecordSchedule &record)
Add a new recording rule.
bool UpdateRecordedWatchedStatus(uint32_t chanid, time_t recstartts, bool watched)
POST Dvr/UpdateRecordedWatchedStatus.
ProgramListPtr GetExpiringList()
Query information on recorded programs which are set to expire.
bool QueryGenPixmap(const Program &program)
Triggers preview image generation on the backend for a specified show.
std::string GetPreviewImageUrl(uint32_t chanid, time_t recstartts, unsigned width=0, unsigned height=0)
Returns URL for preview image.
bool SetSavedBookmark(const Program &program, int unit, int64_t value)
Set saved bookmark for a program.
MarkListPtr GetRecordedCommBreak(uint32_t recordedid, int unit)
GET Dvr/GetRecordedCommBreak.
VersionPtr GetVersion()
Query server version infos.
VideoSourceListPtr GetVideoSourceList()
GET Channel/GetVideoSourceList.
std::string GetRecordingArtworkUrl(const std::string &type, const Program &program, unsigned width=0, unsigned height=0)
Get an image URL of a given type (coverart, banner, fanart) for a given recording's inetref and seaso...
ProgramPtr GetRecorded(uint32_t recordedid)
Query information on a single item from recordings.
bool PutSetting(const std::string &key, const std::string &value, bool myhost)
Put setting.
SettingMapPtr GetSettings(const std::string &hostname)
Query all settings.
WSStreamPtr GetFile(const std::string &filename, const std::string &sgname)
Download a given file from a given storage group.
MarkListPtr GetCutList(const Program &program, int unit=0)
Request a set of cut list marks for a recording.
std::string GetBackendServerIP6(const std::string &hostName)
Query backend server IP6.
WSStreamPtr GetChannelIcon(uint32_t chanid, unsigned width=0, unsigned height=0)
GET Guide/GetChannelIcon.
ProgramListPtr GetUpcomingList()
Query information on all upcoming programs matching recording rules.
RecordScheduleListPtr GetRecordScheduleList()
GET Dvr/GetRecordScheduleList.
WSStreamPtr GetFile(const std::string &filename, const std::string &sgname)
GET Content/GetFile.
std::string GetChannelIconUrl(uint32_t chanid, unsigned width=0, unsigned height=0)
Get URL of icon for a given channel.
ProgramPtr GetRecorded(uint32_t chanid, time_t recstartts)
GET Dvr/GetRecorded.
WSStreamPtr GetRecordingArtwork(const std::string &type, const Program &program, unsigned width=0, unsigned height=0)
Get, and optionally scale, an image file of a given type (coverart, banner, fanart) for a given recor...
ArtworkListPtr GetRecordingArtworkList(uint32_t chanid, time_t recstartts)
Get a list of artwork available for a recording by start time and channel id.
ArtworkListPtr GetRecordingArtworkList(uint32_t chanid, time_t recstartts)
GET Content/GetRecordingArtworkList.
bool EnableRecordSchedule(uint32_t recordid)
POST Dvr/EnableRecordSchedule.
unsigned CheckService()
Check availability of API services.
int64_t GetSavedBookmark(const Program &program, int unit)
Retrieve saved bookmark for a program.
bool UpdateRecordSchedule(RecordSchedule &record)
POST Dvr/UpdateRecordSchedule.
This is the main namespace that encloses all public classes.
WSStreamPtr GetChannelIcon(uint32_t chanid, unsigned width=0, unsigned height=0)
Get the icon file for a given channel.
bool BlockShutdown()
Prevents backend from shutting down until a the next call to AllowShutdown().
unsigned GetBackendServerPort(const std::string &hostName)
Query backend server port for protocol commands.
ChannelListPtr GetChannelList(uint32_t sourceid, bool onlyVisible=true)
Get all configured channels for a video source.
bool SetSavedBookmark(uint32_t recordedid, int unit, int64_t value)
POST Dvr/SetSavedBookmark.
bool RemoveRecordSchedule(uint32_t recordid)
POST Dvr/RemoveRecordSchedule.
MarkListPtr GetRecordedCutList(uint32_t recordedid, int unit)
GET Dvr/GetRecordedCutList.
bool DeleteRecording(uint32_t chanid, time_t recstartts, bool forceDelete=false, bool allowRerecord=false)
POST Dvr/DeleteRecording.
VideoSourceListPtr GetVideoSourceList()
Get all video sources.
int64_t GetSavedBookmark(uint32_t recordedid, int unit)
GET Dvr/GetSavedBookmark.
ProgramListPtr GetUpcomingList()
GET Dvr/GetUpcomingList.
bool DisableRecordSchedule(uint32_t recordid)
Disable a recording rule.
ProgramMapPtr GetProgramGuide(uint32_t chanid, time_t starttime, time_t endtime)
GET Guide/GetProgramGuide for the given channel.
bool EnableRecordSchedule(uint32_t recordid)
Enable a recording rule.
bool UpdateRecordedWatchedStatus(const Program &program, bool watched)
Update watched status for a recorded.
SettingPtr GetSetting(const std::string &key, const std::string &hostname)
GET Myth/GetSetting.
bool UnDeleteRecording(uint32_t chanid, time_t recstartts)
POST Dvr/UnDeleteRecording.
bool PutSetting(const std::string &key, const std::string &value, bool myhost)
POST Myth/PutSetting.
std::string GetPreviewImageUrl(const Program &program, unsigned width=0, unsigned height=0)
Get URL of preview thumbnail for a given recording by timestamp, chanid and starttime.
SettingMapPtr GetSettings(bool myhost)
Query all settings.