Difference between revisions of "Frontend control socket"

From MythTV Official Wiki
Jump to: navigation, search
(Examples)
m (Examples: - organized into table)
Line 112: Line 112:
 
== exit ==
 
== exit ==
 
Terminates the session.
 
Terminates the session.
= Examples =
+
= Used By =
* [[Controlling MythTV from a DirectTV D11 remote]]
+
{| border="1" cellpadding="5" cellspacing="0"
* [http://www.csse.unimelb.edu.au/~aharwood/mythtvmobileremote.html Controlling MythTV from a Nokia N80]
+
|-
* [http://www.luckies.nl/remotekommander/ Controlling MythTV using RemoteKommander] (http://kommander.kdewebdev.org/)
+
! colspan="2" | Official
* [[Controlling MythTV from any phone using Asterisk]]
+
|-
* [http://www.mythtv.co.nz/mythtv/remote/index.html Controlling MythTV using a phone or pda]
+
|[http://svn.mythtv.org/trac/browser/trunk/mythtv/contrib/remotes/tkmythremote tkmythremote]
* [http://www.legatissimo.info/node/355/ Controlling MythTV using an iPhone]
+
|Simple graphical interface implemented in wish/tk
* [http://www.ndshb.com/modules.php?name=News&file=article&sid=128 Controlling MythTV using a Nintendo DS and mythremote]
+
|-
* [http://www.telemedia.ch/publ/myth-telnet.html Controlling MythTV using Windows or Linux GUI]
+
|[http://svn.mythtv.org/trac/browser/trunk/mythtv/contrib/remotes/mythremctl mythremctl]
* [http://code.google.com/p/rocketremote/ Rocket Remote at Google Code]
+
|Curses based remote written in python
* [http://svn.mythtv.org/trac/changeset/17645 Controlling MythTV using tk: tkmythremote]
+
|-
* [http://mythtv.bss.ab.ca/somemythtvtools.htm Controlling MythTV using tk: remote tk grid]
+
|[[MythWeb]]
* [http://code.google.com/p/mythmote/ Controlling MythTV using android: mythmote]
+
|On screen and passthrough keyboard available in MythWeb
 
+
|-
See also: mymote, mythetomer, mythRemote, mythmote(android market), and Remote Remote (for Apple).
+
! colspan="2" | Mobile
 +
|-
 +
|MyMote
 +
|Remote control and scheduler for the iPhone.<br>Official website is down.
 +
|-
 +
|[http://netti.nic.fi/~icewood/mythetomer/index.php Mythetomer]
 +
|Graphical remote for Nokia Internet Tablets and Smartphones
 +
|-
 +
|[http://code.google.com/p/mythmote/ MythMote]
 +
|Graphical remote for iPhone and iPod Touch
 +
|-
 +
|[http://www.cs.mu.oz.au/~aaron/mythtvmobileremote.html MythTV Mobile Remote]
 +
|Graphical remote for Nokia N80
 +
|-
 +
|[[Controlling_MythTV_from_any_phone_using_Asterisk|Asterisk]]
 +
|Remote control using any touchtone phone through Asterisk.
 +
|-
 +
|[http://www.mythtv.co.nz/mythtv/remote/index.html MythTV Web Remote]
 +
|Simple graphical web-based remote
 +
|-
 +
|[http://kylestoneman.com/out/remote.tar.gz iPhone Remote]
 +
|Another simple web-based remote
 +
|-
 +
|[http://dev-scene.com/NDS/MythRemote MythRemote]
 +
|Homebrew Nintendo DS remote
 +
|-
 +
! colspan="2" | PC
 +
|-
 +
|[http://ignasiak.googlepages.com/mythremote MythRemote]
 +
|Graphical remote for OSX
 +
|-
 +
|[[Controlling_MythTV_from_a_DirectTV_D11_remote|DirectTV D11]]
 +
|Channel for controlling mythtv with a D11 remote
 +
|-
 +
|[http://www.luckies.nl/remotekommander/ RemoteKommander]
 +
|Graphical remote for KDE
 +
|-
 +
|[http://www.telemedia.ch/publ/myth-telnet.html MythRemote Control]
 +
|Graphical remote written in Python/PythonCard
 +
|-
 +
|[http://code.google.com/p/rocketremote/ RocketRemote]
 +
|Graphical remote written in Adobe Flex
 +
|-
 +
|[http://mythtv.bss.ab.ca/mythremote_telnetperltk_20081004.zip MythRemote]
 +
|Graphical remote written in Perl/Tk
 +
|}
  
 
= Development =
 
= Development =

Revision as of 23:08, 2 November 2009

Release 0.19 of MythTV introduced the ability to control mythfrontend via a socket interface. Commands are sent and replies are received in text mode, there is no fancy xml interface or anything - it is meant to be able to be used via something as simple as telnet. This feature has to be enabled in the general settings of the frontend setup. The default port is 6546, so after restarting mythfrontend, you can test by telnetting to localhost on port 6546

telnet localhost 6546

There can be only one socket connection to mythfrontend at a time, if a new connection is opened, the old one will be automatically closed.

See also MythTV docs on Telnet socket

A utility to allow your Linux (or Windows) PC to emulate your local frontend keyboard using this interface can be found here [Hat tip: Greg Estabrooks] [Anyone know who wrote this? --Baylink 16:08, 8 November 2007 (UTC)]


Supported Commands

For a list of supported commands, type "help". For help on a specific command, type "help COMMAND" (where COMMAND is the name of the command like "help jump").

jump

Usage: jump JUMPPOINT

Where JUMPPOINT is one of the following:
channelpriorities    - Channel Recording Priorities
channelrecpriority   - Channel Recording Priorities
deletebox            - TV Recording Deletion
deleterecordings     - TV Recording Deletion
flixbrowse           - Netflix Browser
flixhistory          - Netflix History
flixqueue            - Netflix Queue
guidegrid            - Program Guide
livetv               - Live TV
livetvinguide        - Live TV In Guide
mainmenu             - Main Menu
managerecordings     - Manage Recordings / Fix Conflicts
manualbox            - Manual Record Scheduling
manualrecording      - Manual Record Scheduling
musicplaylists       - Select music playlists
mythgallery          - MythGallery
mythgame             - MythGame
mythmovietime        - MythMovieTime
mythnews             - MythNews
mythvideo            - MythVideo
mythweather          - MythWeather
playbackbox          - TV Recording Playback
playbackrecordings   - TV Recording Playback
playdvd              - Play DVD
playmusic            - Play music
previousbox          - Previously Recorded
progfinder           - Program Finder
programfinder        - Program Finder
programguide         - Program Guide
programrecpriority   - Program Recording Priorities
recordingpriorities  - Program Recording Priorities
ripcd                - Rip CD
ripdvd               - Rip DVD
statusbox            - Status Screen
videobrowser         - Video Browser
videogallery         - Video Gallery
videolistings        - Video Listings
videomanager         - Video Manager
viewscheduled        - Manage Recordings / Fix Conflicts

key

key LETTER           - Send the letter key specified
key NUMBER           - Send the number key specified
key CODE             - Send one of the following key codes

Supported keys:

#, $, %, &, (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, [, \, ], ampersand, asterisk, backslash, backspace, 
backtab, bar, bracketleft, bracketright, colon, comma, delete, dollar, down, end, enter, equal, escape, 
f1, f10, f11, f12, f13, f14, f15, f16, f17, f18, f19, f2, f20, f21, f22, f23, f24, f3, f4, f5, f6, f7, f8, f9, 
greater, home, insert, left, less, minus, numbersign, pagedown, pageup, parenleft, parenright, percent, 
period, pipe, plus, poundsign, question, return, right, semicolon, slash, space, tab, up, |

play

play channel up       - Change channel Up
play channel down     - Change channel Down
play channel NUMBER   - Change to a specific channel number
play chanid NUMBER    - Change to a specific channel id (chanid)
play program CHANID yyyy-mm-ddThh:mm:ss
                      - Play program with chanid & starttime
play program CHANID yyyy-mm-ddThh:mm:ss resume
                      - Resume program with chanid & starttime
play save screenshot FILENAME
                      - Save screenshot from current position
play seek beginning   - Seek to the beginning of the recording
play seek forward     - Skip forward in the video
play seek backward    - Skip backwards in the video
play seek HH:MM:SS    - Seek to a specific position
play speed pause      - Pause playback
play speed normal     - Playback at normal speed
play speed 1x         - Playback at normal speed
play speed -1x        - Playback at normal speed in reverse
play speed 1/16x      - Playback at 1/16x speed
play speed 1/8x       - Playback at 1/8x speed
play speed 1/4x       - Playback at 1/4x speed
play speed 1/2x       - Playback at 1/2x speed
play speed 2x         - Playback at 2x speed
play speed 4x         - Playback at 4x speed
play speed 8x         - Playback at 8x speed
play speed 16x        - Playback at 16x speed
play stop             - Stop playback

query

query location        - Query current screen or location (i.e. MainMenu)
query recordings      - List currently available recordings
query recording CHANID STARTTIME
                      - List info about the specified program
query liveTV          - List current TV schedule
query liveTV CHANID   - Query current program for specified channel
query time            - Query current time on server

exit

Terminates the session.

Used By

Official
tkmythremote Simple graphical interface implemented in wish/tk
mythremctl Curses based remote written in python
MythWeb On screen and passthrough keyboard available in MythWeb
Mobile
MyMote Remote control and scheduler for the iPhone.
Official website is down.
Mythetomer Graphical remote for Nokia Internet Tablets and Smartphones
MythMote Graphical remote for iPhone and iPod Touch
MythTV Mobile Remote Graphical remote for Nokia N80
Asterisk Remote control using any touchtone phone through Asterisk.
MythTV Web Remote Simple graphical web-based remote
iPhone Remote Another simple web-based remote
MythRemote Homebrew Nintendo DS remote
PC
MythRemote Graphical remote for OSX
DirectTV D11 Channel for controlling mythtv with a D11 remote
RemoteKommander Graphical remote for KDE
MythRemote Control Graphical remote written in Python/PythonCard
RocketRemote Graphical remote written in Adobe Flex
MythRemote Graphical remote written in Perl/Tk

Development

Changeset [8688]

The initial implementation.

Changeset [12907]

Modified:

trunk/mythtv/programs/mythfrontend/networkcontrol.cpp

Log:

Network Control socket interface changes.

Add some new valid keys. The list:
home, end, return, tab, backtab, insert, delete, plus, comma, minus,
period, numbersign (aka poundsign), dollar, percent, ampersand, parenleft,
parenright, asterisk, question, bar, pipe, and F13 through F24. This also
adds the ability to use the actual symbol for mose of these such as "key +"
instead of having to type "key plus".

Add the ability to send key combinations such as CTRL+B, ALT+F, etc.. The
four supported modifiers are CTRL, ALT, SHIFT, and META and they can be
used individually such as CTRL+B or together such as CTRL+ALT+B.

Fix some minor bugs related to case conversion, previously the code would
lower() the whole input command and then uppercase the few places that
needed it such as when passing a Qt::ISODateTime, now we just lower() when
comparing things that need case-insensitive comparisons.

For debugging purposes, add the ability to sleep in the middle of a key
combination. You can now use the keyword 'sleep' to sleep one second in
the middle of a key command. Here's a not-so-useful example:
"key down down sleep down enter"