5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
# File 'lib/mythtvremote.rb', line 5
def remote(frontend,port,action,number = nil)
$action = case action
when 'channelpriorities' then 'jump channelpriorities' when 'channelrecpriority' then 'jump channelrecpriority' when 'deletebox' then 'jump deletebox' when 'deleterecordings' then 'jump deleterecordings' when 'flixbrowse' then 'jump flixbrowse' when 'flixhistory' then 'jump flixhistory' when 'flixqueue' then 'jump flixqueue' when 'guidegrid' then 'jump guidegrid' when 'livetv' then 'jump livetv' when 'livetvinguide' then 'jump livetvinguide' when 'mainmenu' then 'jump mainmenu' when 'managerecordings' then 'jump managerecordings' when 'manualbox' then 'jump manualbox' when 'manualrecording' then 'jump manualrecording' when 'musicplaylists' then 'jump musicplaylists' when 'mythgallery' then 'jump mythgallery' when 'mythgame' then 'jump mythgame' when 'mythmovietime' then 'jump mythmovietime' when 'mythnews' then 'jump mythnews' when 'mythvideo' then 'jump mythvideo' when 'mythweather' then 'jump mythweather' when 'playbackbox' then 'jump playbackbox' when 'playbackrecordings' then 'jump playbackrecordings' when 'playdvd' then 'jump playdvd' when 'playmusic' then 'jump playmusic' when 'previousbox' then 'jump previousbox' when 'progfinder' then 'jump progfinder' when 'programfinder' then 'jump programfinder' when 'programguide' then 'jump programguide' when 'programrecpriority' then 'jump programrecpriority' when 'recordingpriorities' then 'jump recordingpriorities' when 'ripcd' then 'jump ripcd' when 'ripdvd' then 'jump ripdvd' when 'statusbox' then 'jump statusbox' when 'videobrowser' then 'jump videobrowser' when 'videogallery' then 'jump videogallery' when 'videolistings' then 'jump videolistings' when 'videomanager' then 'jump videomanager' when 'viewscheduled' then 'jump viewscheduled'
when 'chanup' then 'play channel up' when 'chandown' then 'play channel down' when 'volume' then "play volume #{number}%" when 'channum' then "play channel #{number}" when 'chanidnum' then "play chanid #{number}" when 'beginning' then 'play seek beginning' when 'forward' then 'play seek forward' when 'backward' then 'play seek backward' when 'pause' then 'play speed pause' when 'play' then 'play speed normal' when 'stop' then 'play stop' when 'menu' then 'key m'
when 'up' then 'key up' when 'down' then 'key down' when 'right' then 'key right' when 'left' then 'key left' when 'back' then 'key escape' when 'enter' then 'key enter' when 'spacebar' then 'key space' when 'backspace' then 'key backspace'
else
if action.between?("a","z")
$action = "key #{action[0]}"
elsif action.between?("A","Z")
$action = "key #{action[0]}"
elsif action.between?("0","9")
$action = "key #{action[0]}"
elsif ["#","$","%","&","(",")","*","+","-",".","/",":",";","<","=",">","?","[","]","."].include?("#{action}")
$action = "key #{action[0]}"
end
end
remote = TCPSocket.open(frontend,port)
puts $action
remote.puts $action
remote.close
end
|