jMythAPI is a java library to query and control a MythTV backend and MythTV database. It uses the Myth protocol to communicate with the MythTV backend and the MySQL JDBC driver to query the MythTV database. It provides a high level API enabling java developers to easily access MythTV, without the need to know all the details about the underlying protocol and differences between various protocol versions.
MythTV is a free and open source digital video recorder (DVR) for watching and recording television. It turns a computer into a powerfull home theater, supporting network streaming, digital video recording and provides additional plugins to watch and archive DVDs, listen to digital music collections, and many more.
The MythTV system is split into the following components:
The communication between the frontends and backends is done using the Myth protocol.
See www.mythtv.org to learn more about MythTV.
The following things can be done with jMythAPI:
If jMythAPI does not fulfill all your requirements, take a look at other projects implementing the Myth protocol.
Requirements to use jMythAPI:
The library ostermiller-syntax, which is additionally listed in the Project Dependencies, is just used for code highlighting in JavaDoc.
The following MythTV versions are supported:
Depending on the MythTV protocol version that a backend is speaking, different protocol commands are supported and the required request- and received response-parameters may be different.
Please read the JavaDoc to see which features are available in which MythTV protocol version.
A changelog of all protocol version changes can be found here.
The main documentation of jMythAPI is written in JavaDoc.
The JavaDoc API documents are available here.
Beyond a typical JavaDoc documentation, the jMythAPI JavaDoc pages provide additional infos, which are important for developers:
Please read the Documentation for a more detailed description about the information types listed above.
To get started with jMythAPI you should read the following JavaDoc pages:
Query pending recordings:
In the following example we connect to a MythTV-backend and fetch the list of pending recordings.
// create a backend object and connect to the backend IBackend backend = BackendFactory.createBackend("mythbox"); backend.connect(); // register as a playback client backend.annotatePlayback(); // query pending recordings IRecordingsPending pendingRecordings = backend.queryAllPending(); for (IProgramInfo program : pendingRecordings) { // we are only interrested in recordings with "WILL_RECORD" status IProgramRecordingStatus recStatus = program.getRecordingStatus(); if(!recStatus.hasStatus(IProgramRecordingStatus.Status.WILL_RECORD)) continue; // print out the found recodings System.out.println(String.format( "%1$tF %1$tT - %2$s (%3$s)", program.getStartDateTime(), program.getTitle(), program.getChannelSign() )); } // close backend connection backend.close();
The above example will output, e.g.
MythTV has 4 pending records 2011-04-17 18:10:00 - Die Simpsons (PRO7) 2011-04-17 20:15:00 - 10.000 BC (PRO7) 2011-04-18 22:15:00 - Roter Drache (ZDF) 2011-04-21 20:15:00 - Dr. House (ORF1)
More Examples:
See here for more usage examples.
jMythAPI is licensed under the GNU Library or "Lesser" Public License (LGPL).
Any questions? Contact Martin Thelian.