-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSocketBluray.rb
106 lines (98 loc) · 2.43 KB
/
SocketBluray.rb
1
2
3
4
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
95
96
97
98
99
100
101
102
103
104
105
106
# Copyright (C) 2014 Wesleyan University
#
# This file is part of cmdr-devices.
#
# cmdr-devices is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cmdr-devices is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cmdr-devices. If not, see <http://www.gnu.org/licenses/>.
#---
#{
# "name": "SocketBluray",
# "depends_on": "SocketDevice",
# "description": "Controls most pioneer bluray players",
# "author": "Brian Gapinski",
# "email": "[email protected]",
# "type": "SocketDevice"
#}
#---
class SocketBluray < Cmdr::SocketDevice
configure do
#DaemonKit.logger.info "@Initializing SocketBluray at URI #{options[:uri]} with name #{name}"
end
command :play,
:action => proc{
send_string "PL\r\n"
}
command :stop,
:action => proc{
send_string "99RJ\r\n"
}
command :pause,
:action => proc{
send_string "ST\r\n"
}
command :forward,
:action => proc{
send_string "NF\r\n"
}
command :back,
:action => proc{
send_string "NR\r\n"
}
command :next,
:action => proc{
#send_string "SF\r\n"
send_string "/A181AF3D/RU\r\n"
}
command :previous,
:action => proc{
#send_string "SR\r\n"
send_string "/A181AF3E/RU\r\n"
}
command :title,
:action => proc{
send_string "/A181AFB9/RU\r\n"
}
command :menu,
:action => proc{
send_string "/A181AFB4/RU\r\n"
}
command :up,
:action => proc{
send_string "/A184FFFF/RU\r\n"
}
command :right,
:action => proc{
send_string "/A186FFFF/RU\r\n"
}
command :down,
:action => proc{
send_string "/A185FFFF/RU\r\n"
}
command :left,
:action => proc{
send_string "/A187FFFF/RU\r\n"
}
command :enter,
:action => proc{
send_string "/A181AFEF/RU\r\n"
}
command :eject,
:action => proc{
send_string "/A181AFB6/RU\r\n"
}
state_var :operational, :type => :boolean, :editable => false
requests do
send :ping, "\r\n", 1.0
send :time, "?T\r\n", 0.1
end
end