![]() |
CPPMyth
Library to interoperate with MythTV server
|

Public Member Functions | |
| Control (const std::string &server, unsigned protoPort, unsigned wsapiPort, const std::string &wsapiSecurityPin) | |
| Control (const std::string &server, unsigned protoPort, unsigned wsapiPort, const std::string &wsapiSecurityPin, bool frontend) | |
| bool | Open () |
| void | Close () |
| bool | IsOpen () |
| bool | HasHanging () const |
| void | CleanHanging () |
| ProtoBase::ERROR_t | GetProtoError () const |
| unsigned | CheckService () |
| Check availability of API services. More... | |
| std::string | GetServerHostName () |
| Query server host name. More... | |
| VersionPtr | GetVersion () |
| Query server version infos. More... | |
| bool | QueryFreeSpaceSummary (int64_t *total, int64_t *used) |
| Queries the backend for free space summary. More... | |
| bool | QueryGenPixmap (const Program &program) |
| Triggers preview image generation on the backend for a specified show. More... | |
| bool | CancelNextRecording (int rnum, bool cancel) |
| Ask the backend to cancel/continue next recording. More... | |
| SettingPtr | GetSetting (const std::string &key, const std::string &hostname) |
| Query setting by its key. More... | |
| SettingPtr | GetSetting (const std::string &key, bool myhost) |
| Query setting by its key. More... | |
| SettingMapPtr | GetSettings (const std::string &hostname) |
| Query all settings. More... | |
| SettingMapPtr | GetSettings (bool myhost) |
| Query all settings. More... | |
| bool | PutSetting (const std::string &key, const std::string &value, bool myhost) |
| Put setting. More... | |
| std::string | GetBackendServerIP (const std::string &hostName) |
| Query backend server IP. More... | |
| std::string | GetBackendServerIP6 (const std::string &hostName) |
| Query backend server IP6. More... | |
| unsigned | GetBackendServerPort (const std::string &hostName) |
| Query backend server port for protocol commands. More... | |
| ProgramListPtr | GetRecordedList (unsigned n=0, bool descending=false) |
| Query information on all recorded programs. More... | |
| ProgramPtr | GetRecorded (uint32_t chanid, time_t recstartts) |
| Query information on a single item from recordings. More... | |
| ProgramPtr | GetRecorded (uint32_t recordedid) |
| Query information on a single item from recordings. More... | |
| bool | UpdateRecordedWatchedStatus (const Program &program, bool watched) |
| Update watched status for a recorded. More... | |
| bool | DeleteRecording (const Program &program, bool forceDelete=false, bool allowRerecord=false) |
| Remove a Recording from the database and disk. More... | |
| bool | UndeleteRecording (const Program &program) |
| bool | StopRecording (const Program &program) |
| CaptureCardListPtr | GetCaptureCardList () |
| Get all configured capture devices. More... | |
| VideoSourceListPtr | GetVideoSourceList () |
| Get all video sources. More... | |
| ChannelListPtr | GetChannelList (uint32_t sourceid, bool onlyVisible=true) |
| Get all configured channels for a video source. More... | |
| ChannelPtr | GetChannel (uint32_t chanid) |
| Retrieve a single channel, by channel id. More... | |
| ProgramMapPtr | GetProgramGuide (uint32_t chanid, time_t starttime, time_t endtime) |
| Query the guide information for a particular time period and a channel. More... | |
| std::map< uint32_t, ProgramMapPtr > | GetProgramGuide (time_t starttime, time_t endtime) |
| Query the guide information for a particular time period. More... | |
| RecordScheduleListPtr | GetRecordScheduleList () |
| Query all configured recording rules. More... | |
| RecordSchedulePtr | GetRecordSchedule (uint32_t recordid) |
| Get a single recording rule, by record id. More... | |
| bool | AddRecordSchedule (RecordSchedule &record) |
| Add a new recording rule. More... | |
| bool | UpdateRecordSchedule (RecordSchedule &record) |
| Update a recording rule. More... | |
| bool | DisableRecordSchedule (uint32_t recordid) |
| Disable a recording rule. More... | |
| bool | EnableRecordSchedule (uint32_t recordid) |
| Enable a recording rule. More... | |
| bool | RemoveRecordSchedule (uint32_t recordid) |
| Remove a recording rule. More... | |
| ProgramListPtr | GetUpcomingList () |
| Query information on all upcoming programs matching recording rules. More... | |
| ProgramListPtr | GetConflictList () |
| Query information on upcoming items which will not record due to conflicts. More... | |
| ProgramListPtr | GetExpiringList () |
| Query information on recorded programs which are set to expire. More... | |
| StringListPtr | GetRecGroupList () |
| Get list of recording group. More... | |
| WSStreamPtr | GetFile (const std::string &filename, const std::string &sgname) |
| Download a given file from a given storage group. More... | |
| WSStreamPtr | GetChannelIcon (uint32_t chanid, unsigned width=0, unsigned height=0) |
| Get the icon file for a given channel. More... | |
| std::string | GetChannelIconUrl (uint32_t chanid, unsigned width=0, unsigned height=0) |
| Get URL of icon for a given channel. More... | |
| 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. More... | |
| 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. More... | |
| 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 recording's inetref and season number. More... | |
| 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 season number. More... | |
| ArtworkListPtr | GetRecordingArtworkList (uint32_t chanid, time_t recstartts) |
| Get a list of artwork available for a recording by start time and channel id. More... | |
| bool | RefreshRecordedArtwork (Program &program) |
| Refresh artwork available for a recording. More... | |
| MarkListPtr | GetCutList (const Program &program, int unit=0) |
| Request a set of cut list marks for a recording. More... | |
| MarkListPtr | GetCommBreakList (const Program &program, int unit=0) |
| Request a set of commercial break marks for a recording. More... | |
| bool | BlockShutdown () |
| Prevents backend from shutting down until a the next call to AllowShutdown(). More... | |
| bool | AllowShutdown () |
| Allows backend to shut down again after a previous call to BlockShutdown(). More... | |
| bool | SetSavedBookmark (const Program &program, int unit, int64_t value) |
| Set saved bookmark for a program. More... | |
| int64_t | GetSavedBookmark (const Program &program, int unit) |
| Retrieve saved bookmark for a program. More... | |
Private Attributes | |
| ProtoMonitor | m_monitor |
| WSAPI | m_wsapi |
Definition at line 32 of file mythcontrol.h.
|
inline |
Add a new recording rule.
| record |
Definition at line 344 of file mythcontrol.h.
References Myth::WSAPI::AddRecordSchedule().
|
inline |
Allows backend to shut down again after a previous call to BlockShutdown().
Definition at line 575 of file mythcontrol.h.
|
inline |
Prevents backend from shutting down until a the next call to AllowShutdown().
Definition at line 566 of file mythcontrol.h.
|
inline |
Ask the backend to cancel/continue next recording.
| rnum | recorder Id |
| cancel |
Definition at line 100 of file mythcontrol.h.
|
inline |
Check availability of API services.
Definition at line 50 of file mythcontrol.h.
|
inline |
Remove a Recording from the database and disk.
| program | |
| forceDelete | (default false) |
| allowRerecord | (default false) |
Definition at line 233 of file mythcontrol.h.
References Myth::WSAPI::DeleteRecording(), and Myth::WSAPI::UnDeleteRecording().
|
inline |
Disable a recording rule.
| recordid |
Definition at line 364 of file mythcontrol.h.
References Myth::WSAPI::DisableRecordSchedule().
|
inline |
Enable a recording rule.
| recordid |
Definition at line 374 of file mythcontrol.h.
References Myth::WSAPI::EnableRecordSchedule().
| std::string Control::GetBackendServerIP | ( | const std::string & | hostName | ) |
Query backend server IP.
| hostName |
Definition at line 58 of file mythcontrol.cpp.
References GetSetting().
Referenced by PutSetting().

| std::string Control::GetBackendServerIP6 | ( | const std::string & | hostName | ) |
Query backend server IP6.
| hostName |
Definition at line 68 of file mythcontrol.cpp.
References GetSetting().
Referenced by PutSetting().

| unsigned Control::GetBackendServerPort | ( | const std::string & | hostName | ) |
Query backend server port for protocol commands.
| hostName |
Definition at line 78 of file mythcontrol.cpp.
References GetSetting().
Referenced by PutSetting().

|
inline |
Get all configured capture devices.
Definition at line 262 of file mythcontrol.h.
References Myth::WSAPI::GetCaptureCardList().
|
inline |
Retrieve a single channel, by channel id.
| chanid |
Definition at line 292 of file mythcontrol.h.
References Myth::WSAPI::GetChannel().
|
inline |
Get the icon file for a given channel.
| chanid | |
| width | (default 0) |
| height | (default 0) |
Definition at line 443 of file mythcontrol.h.
References Myth::WSAPI::GetChannelIcon().
|
inline |
Get URL of icon for a given channel.
| chanid | |
| width | (default 0) |
| height | (default 0) |
Definition at line 455 of file mythcontrol.h.
References Myth::WSAPI::GetChannelIconUrl().
|
inline |
Get all configured channels for a video source.
| sourceid | |
| onlyVisible | (default true) |
Definition at line 282 of file mythcontrol.h.
References Myth::WSAPI::GetChannelList().
|
inline |
Request a set of commercial break marks for a recording.
| program | |
| unit | 0 = Frame count, 1 = Position, 2 = Duration ms |
Definition at line 551 of file mythcontrol.h.
References Myth::WSAPI::GetRecordedCommBreak().
|
inline |
Query information on upcoming items which will not record due to conflicts.
Definition at line 402 of file mythcontrol.h.
References Myth::WSAPI::GetConflictList().
|
inline |
Request a set of cut list marks for a recording.
| program | |
| unit | 0 = Frame count, 1 = Position, 2 = Duration ms |
Definition at line 534 of file mythcontrol.h.
References Myth::WSAPI::GetRecordedCutList().
|
inline |
Query information on recorded programs which are set to expire.
Definition at line 411 of file mythcontrol.h.
References Myth::WSAPI::GetExpiringList().
|
inline |
Download a given file from a given storage group.
| filename | |
| sgname |
Definition at line 431 of file mythcontrol.h.
References Myth::WSAPI::GetFile().
|
inline |
Get, and optionally scale, an preview thumbnail for a given recording by timestamp, chanid and starttime.
| program | |
| width | (default 0) |
| height | (default 0) |
Definition at line 467 of file mythcontrol.h.
References Myth::WSAPI::GetPreviewImage().
|
inline |
Get URL of preview thumbnail for a given recording by timestamp, chanid and starttime.
| program | |
| width | (default 0) |
| height | (default 0) |
Definition at line 479 of file mythcontrol.h.
References Myth::WSAPI::GetPreviewImageUrl().
|
inline |
Query the guide information for a particular time period and a channel.
| chanid | |
| starttime | |
| endtime |
Definition at line 304 of file mythcontrol.h.
References Myth::WSAPI::GetProgramGuide().
|
inline |
Query the guide information for a particular time period.
| starttime | |
| endtime |
Definition at line 315 of file mythcontrol.h.
References Myth::WSAPI::GetProgramGuide().
|
inline |
Get list of recording group.
Definition at line 420 of file mythcontrol.h.
References Myth::WSAPI::GetRecGroupList().
|
inline |
Query information on a single item from recordings.
| chanid | |
| recstartts |
Definition at line 197 of file mythcontrol.h.
References Myth::WSAPI::GetRecorded().
|
inline |
Query information on a single item from recordings.
| recordedid |
Definition at line 207 of file mythcontrol.h.
References Myth::WSAPI::GetRecorded().
|
inline |
Query information on all recorded programs.
| n | |
| descending |
Definition at line 186 of file mythcontrol.h.
References Myth::WSAPI::GetRecordedList().
|
inline |
Get, and optionally scale, an image file of a given type (coverart, banner, fanart) for a given recording's inetref and season number.
| type | |
| program | |
| width | (default 0) |
| height | (default 0) |
Definition at line 492 of file mythcontrol.h.
References Myth::WSAPI::GetRecordingArtwork().
|
inline |
Get a list of artwork available for a recording by start time and channel id.
| chanid | |
| recstartts |
Definition at line 516 of file mythcontrol.h.
References Myth::WSAPI::GetRecordingArtworkList(), and RefreshRecordedArtwork().
Referenced by RefreshRecordedArtwork().

|
inline |
Get an image URL of a given type (coverart, banner, fanart) for a given recording's inetref and season number.
| type | |
| program | |
| width | (default 0) |
| height | (default 0) |
Definition at line 505 of file mythcontrol.h.
References Myth::WSAPI::GetRecordingArtworkUrl().
|
inline |
Get a single recording rule, by record id.
| recordid |
Definition at line 334 of file mythcontrol.h.
References Myth::WSAPI::GetRecordSchedule().
|
inline |
Query all configured recording rules.
Definition at line 324 of file mythcontrol.h.
References Myth::WSAPI::GetRecordScheduleList().
|
inline |
Retrieve saved bookmark for a program.
| program | |
| unit | 1 = Position, 2 = Duration ms |
Definition at line 597 of file mythcontrol.h.
References Myth::WSAPI::GetSavedBookmark().
|
inline |
|
inline |
Query setting by its key.
| key | |
| hostname |
Definition at line 111 of file mythcontrol.h.
References Myth::WSAPI::GetSetting().
Referenced by GetBackendServerIP(), GetBackendServerIP6(), and GetBackendServerPort().

|
inline |
Query setting by its key.
| key | |
| myhost |
Definition at line 122 of file mythcontrol.h.
References Myth::WSAPI::GetSetting().
|
inline |
Query all settings.
| hostname |
Definition at line 132 of file mythcontrol.h.
References Myth::WSAPI::GetSettings().
|
inline |
Query all settings.
| myhost |
Definition at line 142 of file mythcontrol.h.
References Myth::WSAPI::GetSettings().
|
inline |
Query information on all upcoming programs matching recording rules.
Definition at line 393 of file mythcontrol.h.
References Myth::WSAPI::GetUpcomingList().
|
inline |
|
inline |
Get all video sources.
Definition at line 271 of file mythcontrol.h.
References Myth::WSAPI::GetVideoSourceList().
|
inline |
Put setting.
| key | |
| value | |
| myhost |
Definition at line 154 of file mythcontrol.h.
References GetBackendServerIP(), GetBackendServerIP6(), GetBackendServerPort(), and Myth::WSAPI::PutSetting().
|
inline |
Queries the backend for free space summary.
| total | |
| used |
Definition at line 79 of file mythcontrol.h.
|
inline |
Triggers preview image generation on the backend for a specified show.
| program |
Definition at line 89 of file mythcontrol.h.
| bool Control::RefreshRecordedArtwork | ( | Program & | program | ) |
Refresh artwork available for a recording.
| program |
Definition at line 88 of file mythcontrol.cpp.
References GetRecordingArtworkList().
Referenced by GetRecordingArtworkList().

|
inline |
Remove a recording rule.
| recordid |
Definition at line 384 of file mythcontrol.h.
References Myth::WSAPI::RemoveRecordSchedule().
|
inline |
Set saved bookmark for a program.
| program | |
| unit | 1 = Position, 2 = Duration ms |
Definition at line 586 of file mythcontrol.h.
References Myth::WSAPI::SetSavedBookmark().
|
inline |
Update watched status for a recorded.
| chanid | |
| recstartts |
Definition at line 218 of file mythcontrol.h.
References Myth::WSAPI::UpdateRecordedWatchedStatus().
|
inline |
Update a recording rule.
| record |
Definition at line 354 of file mythcontrol.h.
References Myth::WSAPI::UpdateRecordSchedule().