C++ MythTV client library
You can check out the project and build it
$ git clone https://github.com/janbar/cppmyth.git cppmyth
$ mkdir build
$ cd build
$ cmake ../cppmyth
$ make
Finally trying the "livetvdemo" on your MythTV backend host
$ ./demo/livetvdemo <backendip> <channum> | mplayer -
You can easily edit the source file demo.cpp . After writing your demo, rebuild the project typing again command 'make'.
$ nano ../cppmyth/demo/src/demo.cpp
You can easily write your MythTV client. All structures provided by the library are wrapped within shared or smart pointer. Just use them ...
Myth::Control clientMonitor(server, 6543, 6544, "0000");
if (!clientMonitor.IsOpen())
return;
//Types ...Ptr are shared pointer.
//You can copy or forget without care.
Myth::ProgramListPtr progs = clientMonitor.GetRecordedList();
DoSomething(progs);
m_recordings = progs;
//Container pointer and its element pointers are always allocated.
//Only checking its size.
for (size_t i = 0; i < progs->size(); ++i) {
Myth::ProgramPtr prog = (*progs)[i];
if (prog->recording.recGroup == "LiveTV") {
m_liveRecordings.push_back(prog);
Myth::ProgramPtr prog = clientMonitor.GetRecorded(chanid, startts);
//Standalone element pointer could be null_ptr.
//You have to check before deref.
if (prog) {
m_title = prog->title;