25#include "proto/mythprotomonitor.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);
39 Control& WithAuthorization(
const std::string& user,
const std::string& password)
41 m_wsapi.WithAuthorization(user, password);
44 Control& WithSSL(
bool yesno)
46 m_wsapi.WithSSL(yesno);
52 bool IsOpen() {
return m_monitor.IsOpen(); }
53 bool HasHanging()
const {
return m_monitor.HasHanging(); }
54 void CleanHanging() { m_monitor.CleanHanging(); }
55 ProtoBase::ERROR_t GetProtoError()
const {
return m_monitor.GetProtoError(); }
63 return m_wsapi.CheckService();
72 return m_wsapi.GetServerHostName();
81 return m_wsapi.GetBaseURL();
90 return m_wsapi.GetVersion();
101 return m_monitor.QueryFreeSpaceSummary(total, used);
111 return m_monitor.QueryGenpixmap(program);
122 return m_monitor.CancelNextRecording(rnum, cancel);
133 return m_wsapi.GetHostSetting(key, hostname);
144 return m_wsapi.GetSetting(key, myhost);
154 return m_wsapi.GetHostSettings(hostname);
164 return m_wsapi.GetSettings(myhost);
174 bool PutSetting(
const std::string& key,
const std::string& value,
bool myhost)
176 return m_wsapi.PutSetting(key, value, myhost);
208 return m_wsapi.GetRecordedList(n, descending);
219 return m_wsapi.GetRecorded(chanid, recstartts);
229 return m_wsapi.GetRecorded(recordedid);
241 if (wsv.ranking >= 0x00060000)
242 return m_wsapi.UpdateRecordedWatchedStatus(program.recording.recordedId, watched);
243 return m_wsapi.UpdateRecordedWatchedStatus(program.channel.chanId, program.recording.startTs, watched);
256 if (wsv.ranking >= 0x00060000)
257 return m_wsapi.DeleteRecording(program.recording.recordedId, forceDelete, allowRerecord);
258 if (wsv.ranking >= 0x00020001)
259 return m_wsapi.DeleteRecording(program.channel.chanId, program.recording.startTs, forceDelete, allowRerecord);
260 return m_monitor.DeleteRecording(program, forceDelete, allowRerecord);
263 bool UndeleteRecording(
const Program& program)
266 if (wsv.ranking >= 0x00060000)
268 if (wsv.ranking >= 0x00020001)
269 return m_wsapi.
UnDeleteRecording(program.channel.chanId, program.recording.startTs);
270 return m_monitor.UndeleteRecording(program);
273 bool StopRecording(
const Program& program)
275 return m_monitor.StopRecording(program);
284 return m_wsapi.GetCaptureCardList();
293 return m_wsapi.GetVideoSourceList();
304 return m_wsapi.GetChannelList(sourceid, onlyVisible);
314 return m_wsapi.GetChannel(chanid);
326 return m_wsapi.GetProgramGuide(chanid, starttime, endtime);
337 return m_wsapi.GetProgramGuide(starttime, endtime);
346 return m_wsapi.GetRecordScheduleList();
356 return m_wsapi.GetRecordSchedule(recordid);
366 return m_wsapi.AddRecordSchedule(record);
376 return m_wsapi.UpdateRecordSchedule(record);
386 return m_wsapi.DisableRecordSchedule(recordid);
396 return m_wsapi.EnableRecordSchedule(recordid);
406 return m_wsapi.RemoveRecordSchedule(recordid);
415 return m_wsapi.GetUpcomingList();
424 return m_wsapi.GetConflictList();
433 return m_wsapi.GetExpiringList();
442 return m_wsapi.GetRecGroupList();
451 WSStreamPtr
GetFile(
const std::string& filename,
const std::string& sgname)
453 return m_wsapi.GetFile(filename, sgname);
463 WSStreamPtr
GetChannelIcon(uint32_t chanid,
unsigned width = 0,
unsigned height = 0)
465 return m_wsapi.GetChannelIcon(chanid, width, height);
477 return m_wsapi.GetChannelIconUrl(chanid, width, height);
489 return m_wsapi.GetPreviewImage(program.channel.chanId, program.recording.startTs, width, height);
501 return m_wsapi.GetPreviewImageUrl(program.channel.chanId, program.recording.startTs, width, height);
514 return m_wsapi.GetRecordingArtwork(type, program.inetref, program.season, width, height);
527 return m_wsapi.GetRecordingArtworkUrl(type, program.inetref, program.season, width, height);
538 return m_wsapi.GetRecordingArtworkList(chanid, recstartts);
557 if (wsv.ranking >= 0x00060001)
558 return m_wsapi.GetRecordedCutList(program.recording.recordedId, unit);
560 return m_monitor.GetCutList(program);
562 return MarkListPtr(
new MarkList);
574 if (wsv.ranking >= 0x00060001)
575 return m_wsapi.GetRecordedCommBreak(program.recording.recordedId, unit);
577 return m_monitor.GetCommBreakList(program);
579 return MarkListPtr(
new MarkList);
588 return m_monitor.BlockShutdown();
597 return m_monitor.AllowShutdown();
608 return m_wsapi.SetSavedBookmark(program.recording.recordedId, unit, value);
619 return m_wsapi.GetSavedBookmark(program.recording.recordedId, unit);
StringListPtr GetRecGroupList()
Get list of recording group.
CaptureCardListPtr GetCaptureCardList()
Get all configured capture devices.
std::string GetBaseURL()
Returns the base URL of WS-API.
std::string GetBackendServerIP(const std::string &hostName)
Query backend server IP.
unsigned GetBackendServerPort(const std::string &hostName)
Query backend server port for protocol commands.
ArtworkListPtr GetRecordingArtworkList(uint32_t chanid, time_t recstartts)
Get a list of artwork available for a recording by start time and channel id.
std::string GetChannelIconUrl(uint32_t chanid, unsigned width=0, unsigned height=0)
Get URL of icon for a given channel.
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.
bool PutSetting(const std::string &key, const std::string &value, bool myhost)
Put setting.
ProgramMapPtr GetProgramGuide(uint32_t chanid, time_t starttime, time_t endtime)
Query the guide information for a particular time period and a channel.
unsigned CheckService()
Check availability of API services.
std::string GetServerHostName()
Query server host name.
bool AddRecordSchedule(RecordSchedule &record)
Add a new recording rule.
SettingPtr GetHostSetting(const std::string &key, const std::string &hostname)
Query setting by its key.
ChannelListPtr GetChannelList(uint32_t sourceid, bool onlyVisible=true)
Get all configured channels for a video source.
bool CancelNextRecording(int rnum, bool cancel)
Ask the backend to cancel/continue next recording.
VideoSourceListPtr GetVideoSourceList()
Get all video sources.
bool AllowShutdown()
Allows backend to shut down again after a previous call to BlockShutdown().
bool UpdateRecordedWatchedStatus(const Program &program, bool watched)
Update watched status for a recorded.
RecordSchedulePtr GetRecordSchedule(uint32_t recordid)
Get a single recording rule, by record id.
bool RefreshRecordedArtwork(Program &program)
Refresh artwork available for a recording.
ProgramPtr GetRecorded(uint32_t recordedid)
Query information on a single item from recordings.
VersionPtr GetVersion()
Query server version infos.
SettingPtr GetSetting(const std::string &key, bool myhost)
Query setting by its key.
bool EnableRecordSchedule(uint32_t recordid)
Enable a recording rule.
bool QueryGenPixmap(const Program &program)
Triggers preview image generation on the backend for a specified show.
bool QueryFreeSpaceSummary(int64_t *total, int64_t *used)
Queries the backend for free space summary.
ProgramListPtr GetConflictList()
Query information on upcoming items which will not record due to conflicts.
bool DeleteRecording(const Program &program, bool forceDelete=false, bool allowRerecord=false)
Remove a Recording from the database and disk.
bool DisableRecordSchedule(uint32_t recordid)
Disable a recording rule.
ProgramListPtr GetRecordedList(unsigned n=0, bool descending=false)
Query information on all recorded programs.
SettingMapPtr GetSettings(bool myhost)
Query all settings.
ProgramPtr GetRecorded(uint32_t chanid, time_t recstartts)
Query information on a single item from recordings.
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...
bool SetSavedBookmark(const Program &program, int unit, int64_t value)
Set saved bookmark for a program.
bool UpdateRecordSchedule(RecordSchedule &record)
Update a recording rule.
WSStreamPtr GetPreviewImage(const Program &program, unsigned width=0, unsigned height=0)
Get, and optionally scale, an preview thumbnail for a given recording by timestamp,...
bool RemoveRecordSchedule(uint32_t recordid)
Remove a recording rule.
ProgramListPtr GetExpiringList()
Query information on recorded programs which are set to expire.
SettingMapPtr GetHostSettings(const std::string &hostname)
Query all settings.
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...
WSStreamPtr GetChannelIcon(uint32_t chanid, unsigned width=0, unsigned height=0)
Get the icon file for a given channel.
std::string GetBackendServerIP6(const std::string &hostName)
Query backend server IP6.
int64_t GetSavedBookmark(const Program &program, int unit)
Retrieve saved bookmark for a program.
std::map< uint32_t, ProgramMapPtr > GetProgramGuide(time_t starttime, time_t endtime)
Query the guide information for a particular time period.
RecordScheduleListPtr GetRecordScheduleList()
Query all configured recording rules.
MarkListPtr GetCommBreakList(const Program &program, int unit=0)
Request a set of commercial break marks for a recording.
ProgramListPtr GetUpcomingList()
Query information on all upcoming programs matching recording rules.
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.
ChannelPtr GetChannel(uint32_t chanid)
Retrieve a single channel, by channel id.
bool BlockShutdown()
Prevents backend from shutting down until a the next call to AllowShutdown().
bool UnDeleteRecording(uint32_t chanid, time_t recstartts)
POST Dvr/UnDeleteRecording.
This is the main namespace that encloses all public classes.