Browse Source

remove old sources vdr-plugin-cecremote

mango 1 year ago
parent
commit
2fe62efb7c
53 changed files with 0 additions and 6294 deletions
  1. 0
    11
      v/vdr-plugin-cecremote-1.4.0/.gitignore
  2. 0
    1
      v/vdr-plugin-cecremote-1.4.0/.pc/.quilt_patches
  3. 0
    1
      v/vdr-plugin-cecremote-1.4.0/.pc/.quilt_series
  4. 0
    1
      v/vdr-plugin-cecremote-1.4.0/.pc/.version
  5. 0
    0
      v/vdr-plugin-cecremote-1.4.0/.pc/applied-patches
  6. 0
    340
      v/vdr-plugin-cecremote-1.4.0/COPYING
  7. 0
    111
      v/vdr-plugin-cecremote-1.4.0/HISTORY
  8. 0
    153
      v/vdr-plugin-cecremote-1.4.0/Makefile
  9. 0
    334
      v/vdr-plugin-cecremote-1.4.0/README
  10. 0
    63
      v/vdr-plugin-cecremote-1.4.0/ceccontrol.cc
  11. 0
    43
      v/vdr-plugin-cecremote-1.4.0/ceccontrol.h
  12. 0
    53
      v/vdr-plugin-cecremote-1.4.0/ceclog.h
  13. 0
    78
      v/vdr-plugin-cecremote-1.4.0/cecosd.cc
  14. 0
    42
      v/vdr-plugin-cecremote-1.4.0/cecosd.h
  15. 0
    846
      v/vdr-plugin-cecremote-1.4.0/cecremote.cc
  16. 0
    103
      v/vdr-plugin-cecremote-1.4.0/cecremote.h
  17. 0
    299
      v/vdr-plugin-cecremote-1.4.0/cecremoteplugin.cc
  18. 0
    98
      v/vdr-plugin-cecremote-1.4.0/cecremoteplugin.h
  19. 0
    66
      v/vdr-plugin-cecremote-1.4.0/cmd.cc
  20. 0
    108
      v/vdr-plugin-cecremote-1.4.0/cmd.h
  21. 0
    950
      v/vdr-plugin-cecremote-1.4.0/configfileparser.cc
  22. 0
    271
      v/vdr-plugin-cecremote-1.4.0/configfileparser.h
  23. 0
    41
      v/vdr-plugin-cecremote-1.4.0/configmenu.cc
  24. 0
    36
      v/vdr-plugin-cecremote-1.4.0/configmenu.h
  25. 0
    3
      v/vdr-plugin-cecremote-1.4.0/contrib/20-libcec.rules
  26. BIN
      v/vdr-plugin-cecremote-1.4.0/contrib/blueray.mpg
  27. 0
    68
      v/vdr-plugin-cecremote-1.4.0/contrib/cecremote.xml
  28. 0
    211
      v/vdr-plugin-cecremote-1.4.0/contrib/cecremote_example.xml
  29. 0
    64
      v/vdr-plugin-cecremote-1.4.0/debian/README.Debian
  30. 0
    230
      v/vdr-plugin-cecremote-1.4.0/debian/changelog
  31. 0
    1
      v/vdr-plugin-cecremote-1.4.0/debian/compat
  32. 0
    22
      v/vdr-plugin-cecremote-1.4.0/debian/control
  33. 0
    340
      v/vdr-plugin-cecremote-1.4.0/debian/copyright
  34. 0
    2
      v/vdr-plugin-cecremote-1.4.0/debian/docs
  35. 0
    2
      v/vdr-plugin-cecremote-1.4.0/debian/install
  36. 0
    1
      v/vdr-plugin-cecremote-1.4.0/debian/links
  37. 0
    6
      v/vdr-plugin-cecremote-1.4.0/debian/plugin.cecremote.conf
  38. 0
    24
      v/vdr-plugin-cecremote-1.4.0/debian/rules
  39. 0
    1
      v/vdr-plugin-cecremote-1.4.0/debian/source/format
  40. 0
    158
      v/vdr-plugin-cecremote-1.4.0/handleactions.cc
  41. 0
    380
      v/vdr-plugin-cecremote-1.4.0/keymaps.cc
  42. 0
    74
      v/vdr-plugin-cecremote-1.4.0/keymaps.h
  43. 0
    114
      v/vdr-plugin-cecremote-1.4.0/opcodemap.cc
  44. 0
    36
      v/vdr-plugin-cecremote-1.4.0/opcodemap.h
  45. 0
    26
      v/vdr-plugin-cecremote-1.4.0/po/de_DE.po
  46. 0
    90
      v/vdr-plugin-cecremote-1.4.0/rtcwakeup.cc
  47. 0
    45
      v/vdr-plugin-cecremote-1.4.0/rtcwakeup.h
  48. 0
    82
      v/vdr-plugin-cecremote-1.4.0/statusmonitor.cc
  49. 0
    64
      v/vdr-plugin-cecremote-1.4.0/statusmonitor.h
  50. 0
    103
      v/vdr-plugin-cecremote-1.4.0/stillpicplayer.cc
  51. 0
    43
      v/vdr-plugin-cecremote-1.4.0/stillpicplayer.h
  52. 0
    55
      v/vdr-plugin-cecremote-1.4.0/stringtools.h
  53. BIN
      v/vdr-plugin-cecremote_1.4.0.orig.tar.xz

+ 0
- 11
v/vdr-plugin-cecremote-1.4.0/.gitignore View File

@@ -1,11 +0,0 @@
1
-syntax: glob
2
-*~
3
-*.orig
4
-*.o
5
-*.so
6
-vdr-cecremote*.tgz
7
-.dependencies
8
-po/*.mo
9
-po/*.pot
10
-push.sh
11
-

+ 0
- 1
v/vdr-plugin-cecremote-1.4.0/.pc/.quilt_patches View File

@@ -1 +0,0 @@
1
-debian/patches

+ 0
- 1
v/vdr-plugin-cecremote-1.4.0/.pc/.quilt_series View File

@@ -1 +0,0 @@
1
-series

+ 0
- 1
v/vdr-plugin-cecremote-1.4.0/.pc/.version View File

@@ -1 +0,0 @@
1
-2

+ 0
- 0
v/vdr-plugin-cecremote-1.4.0/.pc/applied-patches View File


+ 0
- 340
v/vdr-plugin-cecremote-1.4.0/COPYING View File

@@ -1,340 +0,0 @@
1
-		    GNU GENERAL PUBLIC LICENSE
2
-		       Version 2, June 1991
3
-
4
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
- 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
6
- Everyone is permitted to copy and distribute verbatim copies
7
- of this license document, but changing it is not allowed.
8
-
9
-			    Preamble
10
-
11
-  The licenses for most software are designed to take away your
12
-freedom to share and change it.  By contrast, the GNU General Public
13
-License is intended to guarantee your freedom to share and change free
14
-software--to make sure the software is free for all its users.  This
15
-General Public License applies to most of the Free Software
16
-Foundation's software and to any other program whose authors commit to
17
-using it.  (Some other Free Software Foundation software is covered by
18
-the GNU Lesser General Public License instead.)  You can apply it to
19
-your programs, too.
20
-
21
-  When we speak of free software, we are referring to freedom, not
22
-price.  Our General Public Licenses are designed to make sure that you
23
-have the freedom to distribute copies of free software (and charge for
24
-this service if you wish), that you receive source code or can get it
25
-if you want it, that you can change the software or use pieces of it
26
-in new free programs; and that you know you can do these things.
27
-
28
-  To protect your rights, we need to make restrictions that forbid
29
-anyone to deny you these rights or to ask you to surrender the rights.
30
-These restrictions translate to certain responsibilities for you if you
31
-distribute copies of the software, or if you modify it.
32
-
33
-  For example, if you distribute copies of such a program, whether
34
-gratis or for a fee, you must give the recipients all the rights that
35
-you have.  You must make sure that they, too, receive or can get the
36
-source code.  And you must show them these terms so they know their
37
-rights.
38
-
39
-  We protect your rights with two steps: (1) copyright the software, and
40
-(2) offer you this license which gives you legal permission to copy,
41
-distribute and/or modify the software.
42
-
43
-  Also, for each author's protection and ours, we want to make certain
44
-that everyone understands that there is no warranty for this free
45
-software.  If the software is modified by someone else and passed on, we
46
-want its recipients to know that what they have is not the original, so
47
-that any problems introduced by others will not reflect on the original
48
-authors' reputations.
49
-
50
-  Finally, any free program is threatened constantly by software
51
-patents.  We wish to avoid the danger that redistributors of a free
52
-program will individually obtain patent licenses, in effect making the
53
-program proprietary.  To prevent this, we have made it clear that any
54
-patent must be licensed for everyone's free use or not licensed at all.
55
-
56
-  The precise terms and conditions for copying, distribution and
57
-modification follow.
58
-
59
-		    GNU GENERAL PUBLIC LICENSE
60
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
-
62
-  0. This License applies to any program or other work which contains
63
-a notice placed by the copyright holder saying it may be distributed
64
-under the terms of this General Public License.  The "Program", below,
65
-refers to any such program or work, and a "work based on the Program"
66
-means either the Program or any derivative work under copyright law:
67
-that is to say, a work containing the Program or a portion of it,
68
-either verbatim or with modifications and/or translated into another
69
-language.  (Hereinafter, translation is included without limitation in
70
-the term "modification".)  Each licensee is addressed as "you".
71
-
72
-Activities other than copying, distribution and modification are not
73
-covered by this License; they are outside its scope.  The act of
74
-running the Program is not restricted, and the output from the Program
75
-is covered only if its contents constitute a work based on the
76
-Program (independent of having been made by running the Program).
77
-Whether that is true depends on what the Program does.
78
-
79
-  1. You may copy and distribute verbatim copies of the Program's
80
-source code as you receive it, in any medium, provided that you
81
-conspicuously and appropriately publish on each copy an appropriate
82
-copyright notice and disclaimer of warranty; keep intact all the
83
-notices that refer to this License and to the absence of any warranty;
84
-and give any other recipients of the Program a copy of this License
85
-along with the Program.
86
-
87
-You may charge a fee for the physical act of transferring a copy, and
88
-you may at your option offer warranty protection in exchange for a fee.
89
-
90
-  2. You may modify your copy or copies of the Program or any portion
91
-of it, thus forming a work based on the Program, and copy and
92
-distribute such modifications or work under the terms of Section 1
93
-above, provided that you also meet all of these conditions:
94
-
95
-    a) You must cause the modified files to carry prominent notices
96
-    stating that you changed the files and the date of any change.
97
-
98
-    b) You must cause any work that you distribute or publish, that in
99
-    whole or in part contains or is derived from the Program or any
100
-    part thereof, to be licensed as a whole at no charge to all third
101
-    parties under the terms of this License.
102
-
103
-    c) If the modified program normally reads commands interactively
104
-    when run, you must cause it, when started running for such
105
-    interactive use in the most ordinary way, to print or display an
106
-    announcement including an appropriate copyright notice and a
107
-    notice that there is no warranty (or else, saying that you provide
108
-    a warranty) and that users may redistribute the program under
109
-    these conditions, and telling the user how to view a copy of this
110
-    License.  (Exception: if the Program itself is interactive but
111
-    does not normally print such an announcement, your work based on
112
-    the Program is not required to print an announcement.)
113
-
114
-These requirements apply to the modified work as a whole.  If
115
-identifiable sections of that work are not derived from the Program,
116
-and can be reasonably considered independent and separate works in
117
-themselves, then this License, and its terms, do not apply to those
118
-sections when you distribute them as separate works.  But when you
119
-distribute the same sections as part of a whole which is a work based
120
-on the Program, the distribution of the whole must be on the terms of
121
-this License, whose permissions for other licensees extend to the
122
-entire whole, and thus to each and every part regardless of who wrote it.
123
-
124
-Thus, it is not the intent of this section to claim rights or contest
125
-your rights to work written entirely by you; rather, the intent is to
126
-exercise the right to control the distribution of derivative or
127
-collective works based on the Program.
128
-
129
-In addition, mere aggregation of another work not based on the Program
130
-with the Program (or with a work based on the Program) on a volume of
131
-a storage or distribution medium does not bring the other work under
132
-the scope of this License.
133
-
134
-  3. You may copy and distribute the Program (or a work based on it,
135
-under Section 2) in object code or executable form under the terms of
136
-Sections 1 and 2 above provided that you also do one of the following:
137
-
138
-    a) Accompany it with the complete corresponding machine-readable
139
-    source code, which must be distributed under the terms of Sections
140
-    1 and 2 above on a medium customarily used for software interchange; or,
141
-
142
-    b) Accompany it with a written offer, valid for at least three
143
-    years, to give any third party, for a charge no more than your
144
-    cost of physically performing source distribution, a complete
145
-    machine-readable copy of the corresponding source code, to be
146
-    distributed under the terms of Sections 1 and 2 above on a medium
147
-    customarily used for software interchange; or,
148
-
149
-    c) Accompany it with the information you received as to the offer
150
-    to distribute corresponding source code.  (This alternative is
151
-    allowed only for noncommercial distribution and only if you
152
-    received the program in object code or executable form with such
153
-    an offer, in accord with Subsection b above.)
154
-
155
-The source code for a work means the preferred form of the work for
156
-making modifications to it.  For an executable work, complete source
157
-code means all the source code for all modules it contains, plus any
158
-associated interface definition files, plus the scripts used to
159
-control compilation and installation of the executable.  However, as a
160
-special exception, the source code distributed need not include
161
-anything that is normally distributed (in either source or binary
162
-form) with the major components (compiler, kernel, and so on) of the
163
-operating system on which the executable runs, unless that component
164
-itself accompanies the executable.
165
-
166
-If distribution of executable or object code is made by offering
167
-access to copy from a designated place, then offering equivalent
168
-access to copy the source code from the same place counts as
169
-distribution of the source code, even though third parties are not
170
-compelled to copy the source along with the object code.
171
-
172
-  4. You may not copy, modify, sublicense, or distribute the Program
173
-except as expressly provided under this License.  Any attempt
174
-otherwise to copy, modify, sublicense or distribute the Program is
175
-void, and will automatically terminate your rights under this License.
176
-However, parties who have received copies, or rights, from you under
177
-this License will not have their licenses terminated so long as such
178
-parties remain in full compliance.
179
-
180
-  5. You are not required to accept this License, since you have not
181
-signed it.  However, nothing else grants you permission to modify or
182
-distribute the Program or its derivative works.  These actions are
183
-prohibited by law if you do not accept this License.  Therefore, by
184
-modifying or distributing the Program (or any work based on the
185
-Program), you indicate your acceptance of this License to do so, and
186
-all its terms and conditions for copying, distributing or modifying
187
-the Program or works based on it.
188
-
189
-  6. Each time you redistribute the Program (or any work based on the
190
-Program), the recipient automatically receives a license from the
191
-original licensor to copy, distribute or modify the Program subject to
192
-these terms and conditions.  You may not impose any further
193
-restrictions on the recipients' exercise of the rights granted herein.
194
-You are not responsible for enforcing compliance by third parties to
195
-this License.
196
-
197
-  7. If, as a consequence of a court judgment or allegation of patent
198
-infringement or for any other reason (not limited to patent issues),
199
-conditions are imposed on you (whether by court order, agreement or
200
-otherwise) that contradict the conditions of this License, they do not
201
-excuse you from the conditions of this License.  If you cannot
202
-distribute so as to satisfy simultaneously your obligations under this
203
-License and any other pertinent obligations, then as a consequence you
204
-may not distribute the Program at all.  For example, if a patent
205
-license would not permit royalty-free redistribution of the Program by
206
-all those who receive copies directly or indirectly through you, then
207
-the only way you could satisfy both it and this License would be to
208
-refrain entirely from distribution of the Program.
209
-
210
-If any portion of this section is held invalid or unenforceable under
211
-any particular circumstance, the balance of the section is intended to
212
-apply and the section as a whole is intended to apply in other
213
-circumstances.
214
-
215
-It is not the purpose of this section to induce you to infringe any
216
-patents or other property right claims or to contest validity of any
217
-such claims; this section has the sole purpose of protecting the
218
-integrity of the free software distribution system, which is
219
-implemented by public license practices.  Many people have made
220
-generous contributions to the wide range of software distributed
221
-through that system in reliance on consistent application of that
222
-system; it is up to the author/donor to decide if he or she is willing
223
-to distribute software through any other system and a licensee cannot
224
-impose that choice.
225
-
226
-This section is intended to make thoroughly clear what is believed to
227
-be a consequence of the rest of this License.
228
-
229
-  8. If the distribution and/or use of the Program is restricted in
230
-certain countries either by patents or by copyrighted interfaces, the
231
-original copyright holder who places the Program under this License
232
-may add an explicit geographical distribution limitation excluding
233
-those countries, so that distribution is permitted only in or among
234
-countries not thus excluded.  In such case, this License incorporates
235
-the limitation as if written in the body of this License.
236
-
237
-  9. The Free Software Foundation may publish revised and/or new versions
238
-of the General Public License from time to time.  Such new versions will
239
-be similar in spirit to the present version, but may differ in detail to
240
-address new problems or concerns.
241
-
242
-Each version is given a distinguishing version number.  If the Program
243
-specifies a version number of this License which applies to it and "any
244
-later version", you have the option of following the terms and conditions
245
-either of that version or of any later version published by the Free
246
-Software Foundation.  If the Program does not specify a version number of
247
-this License, you may choose any version ever published by the Free Software
248
-Foundation.
249
-
250
-  10. If you wish to incorporate parts of the Program into other free
251
-programs whose distribution conditions are different, write to the author
252
-to ask for permission.  For software which is copyrighted by the Free
253
-Software Foundation, write to the Free Software Foundation; we sometimes
254
-make exceptions for this.  Our decision will be guided by the two goals
255
-of preserving the free status of all derivatives of our free software and
256
-of promoting the sharing and reuse of software generally.
257
-
258
-			    NO WARRANTY
259
-
260
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
262
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
266
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
267
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
-REPAIR OR CORRECTION.
269
-
270
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
-POSSIBILITY OF SUCH DAMAGES.
279
-
280
-		     END OF TERMS AND CONDITIONS
281
-
282
-	    How to Apply These Terms to Your New Programs
283
-
284
-  If you develop a new program, and you want it to be of the greatest
285
-possible use to the public, the best way to achieve this is to make it
286
-free software which everyone can redistribute and change under these terms.
287
-
288
-  To do so, attach the following notices to the program.  It is safest
289
-to attach them to the start of each source file to most effectively
290
-convey the exclusion of warranty; and each file should have at least
291
-the "copyright" line and a pointer to where the full notice is found.
292
-
293
-    <one line to give the program's name and a brief idea of what it does.>
294
-    Copyright (C) <year>  <name of author>
295
-
296
-    This program is free software; you can redistribute it and/or modify
297
-    it under the terms of the GNU General Public License as published by
298
-    the Free Software Foundation; either version 2 of the License, or
299
-    (at your option) any later version.
300
-
301
-    This program is distributed in the hope that it will be useful,
302
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
303
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
304
-    GNU General Public License for more details.
305
-
306
-    You should have received a copy of the GNU General Public License
307
-    along with this program; if not, write to the Free Software
308
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
309
-
310
-
311
-Also add information on how to contact you by electronic and paper mail.
312
-
313
-If the program is interactive, make it output a short notice like this
314
-when it starts in an interactive mode:
315
-
316
-    Gnomovision version 69, Copyright (C) year name of author
317
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
318
-    This is free software, and you are welcome to redistribute it
319
-    under certain conditions; type `show c' for details.
320
-
321
-The hypothetical commands `show w' and `show c' should show the appropriate
322
-parts of the General Public License.  Of course, the commands you use may
323
-be called something other than `show w' and `show c'; they could even be
324
-mouse-clicks or menu items--whatever suits your program.
325
-
326
-You should also get your employer (if you work as a programmer) or your
327
-school, if any, to sign a "copyright disclaimer" for the program, if
328
-necessary.  Here is a sample; alter the names:
329
-
330
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
331
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
332
-
333
-  <signature of Ty Coon>, 1 April 1989
334
-  Ty Coon, President of Vice
335
-
336
-This General Public License does not permit incorporating your program into
337
-proprietary programs.  If your program is a subroutine library, you may
338
-consider it more useful to permit linking proprietary applications with the
339
-library.  If this is what you want to do, use the GNU Lesser General
340
-Public License instead of this License.

+ 0
- 111
v/vdr-plugin-cecremote-1.4.0/HISTORY View File

@@ -1,111 +0,0 @@
1
-VDR Plugin 'cecremote' Revision History
2
----------------------------------------
3
-
4
-2014-12-25: Version 0.0.1
5
-
6
-- Initial revision.
7
-
8
-2015-02-08: Version 0.0.2
9
-
10
-- Basic functionality implemented.
11
-
12
-2015-02-14: Version 0.0.3
13
-
14
-- Remove need of std++11
15
-- When no stillpic tag is available, do not start a player
16
-
17
-2015-02-16: Version 0.1.0
18
-
19
-- Add basic documentation.
20
-- Add option -x to select a filename for the configuration file.
21
-- Renamed the <stillpic> tag to <player> and add a configuration tag to select
22
-  Keys for stopping the player.
23
-  
24
-2015-02-18: Version 0.1.1
25
-
26
-- Bugfix in initialization.
27
-- Modify key map.
28
-- Add svdrp command LIST to list active CEC devices.
29
-
30
-2015-02-21: Version 0.2.0
31
-
32
-- Switched XML Parser to pugixml (http://pugixml.org/).
33
-- Make key maps configurable.
34
-- SVDRP Command to debug and list keymaps and CEC devices.
35
-- New <combokeytimeoutms> in <global> config to set the libCEC combo key
36
-  timeout.
37
-- Add <textviewon> CEC command.
38
-
39
-2015-02-28: Version 0.3.0
40
-
41
-- Fix an out of bounds write of mCECKeyNames and correct the size of
42
-  mDefaultKeyMap, as reported by sirwio.
43
-- Add <cecdevicetype>
44
-
45
-2015-03-01: Version 0.4.0
46
-
47
-- Add <device> section to specify CEC devices also by a physical address.
48
-
49
-2015-03-15: Version 0.5.0
50
-
51
-- New tag <onmanualstart> in global section which contains a command list which
52
-  is executed if the VDR is started manually (not by timer).
53
-- New command lists <onswitchtotv> <onswitchtoradio> <onswitchtoreplay>
54
-  in <global> section.
55
-- Fix some valgrind errors.
56
-
57
-2015-03-28: Version 0.6.0
58
-
59
-- Install a minimal default configuration.
60
-- Add connect/disconnect of the CEC Adapter via svdrpsend CONN/DISC
61
-  commands.
62
-- Add <keymaps> to <global> section to overwrite the default keymap used
63
-  for the mapping from CEC to VDR-Keys.
64
-
65
-2015-04-03: Version 0.7.0
66
-
67
-- Improve plugin shutdown.
68
-
69
-2015-04-06: Version 1.0.0
70
-
71
-- Improve -c command line option. If started with a slash the config
72
-  directory is an absolute path, otherwise it is relative to the
73
-  VDRs plugin configuration directory.
74
-
75
-2015-04-11: Version 1.1.0
76
-
77
-- Compiles with libCEC 3.0.0
78
-- Incorporate a patch from sirwio, to get AN_CHANNELS_LIST key functional.
79
-- Fix crashes on svdrp commands VDRK/CECK if no key map id is used as option.
80
-- Add setup option to hide cecremote menu from vdr main menu.
81
-
82
-2015-05-17: Version 1.2.0
83
-
84
-- Fix incorrect automatic power on of TV.
85
-- Improve configuration of HDMI-Port.
86
-
87
-2015-08-07: Version 1.3.0
88
-
89
-- Fix incorrect handling of CEC disconnect, which may cause a crash when the
90
-  TV is not physically connected to power.
91
-- Add two new setup options "ShutdownOnStandby" and "PowerOffOnStandby"
92
-  to configure the behavior of libCEC in case of power off and standby.
93
-
94
-2015-09-19: Version 1.3.1
95
-
96
-- Compiles with VDR 2.3.1
97
-
98
-2016-04-30: Version 1.4.0
99
-
100
-- Remove superfluous call to SetHDMIPort (reported by jack-itb)
101
-- Fix manual/automatic start detection (reported by jack-itb)
102
-- Use c++ namespace for the plugin code and removed cec prefixes for
103
-  several files and classes.
104
-- Moved the CEC initialization into worker thread for faster startup.
105
-- Add new config option <onceccommand> which allows to start a menu, stop
106
-  a CEC menu with still picture player and executes a command list.
107
-- Added a new detection if the VDR is started via the RTC. The old
108
-  detection behaviour can be enabled with the new config option
109
-  <rtcdetect>false</rtcdetect> in the <global> section.
110
-- Add a udev rule to the contrib directory which disables ModemManger or
111
-  mtp-probe access to the pulse-eight CEC adapter.

+ 0
- 153
v/vdr-plugin-cecremote-1.4.0/Makefile View File

@@ -1,153 +0,0 @@
1
-#
2
-# Makefile for a Video Disk Recorder plugin
3
-#
4
-# $Id$
5
-
6
-# The official name of this plugin.
7
-# This name will be used in the '-P...' option of VDR to load the plugin.
8
-# By default the main source file also carries this name.
9
-
10
-PLUGIN = cecremote
11
-
12
-### The version number of this plugin (taken from the main source file):
13
-
14
-VERSION = $(shell grep 'static const char \*VERSION *=' cecremoteplugin.cc | awk '{ print $$6 }' | sed -e 's/[";]//g')
15
-
16
-### The directory environment:
17
-
18
-# Use package data if installed...otherwise assume we're under the VDR source directory:
19
-PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell PKG_CONFIG_PATH="$$PKG_CONFIG_PATH:../../.." pkg-config --variable=$(1) vdr))
20
-LIBDIR = $(call PKGCFG,libdir)
21
-LOCDIR = $(call PKGCFG,locdir)
22
-PLGCFG = $(call PKGCFG,plgcfg)
23
-CONFDEST = $(call PKGCFG,configdir)/plugins/$(PLUGIN)
24
-CONFFILE = $(CONFDEST)/cecremote.xml
25
-#
26
-TMPDIR ?= /tmp
27
-
28
-### The compiler options:
29
-
30
-# Check for libcec
31
-
32
-ifneq (exists, $(shell pkg-config libcec && echo exists))
33
-  $(warning ******************************************************************)
34
-  $(warning 'libcec' not detected!)
35
-  $(error ******************************************************************)
36
-endif
37
-
38
-
39
-CFLAGS   = $(call PKGCFG,cflags)
40
-CXXFLAGS = $(call PKGCFG,cxxflags)
41
-
42
-
43
-### The version number of VDR's plugin API:
44
-
45
-APIVERSION = $(call PKGCFG,apiversion)
46
-
47
-### Allow user defined options to overwrite defaults:
48
-
49
--include $(PLGCFG)
50
-
51
-### The name of the distribution archive:
52
-
53
-ARCHIVE = $(PLUGIN)-$(VERSION)
54
-PACKAGE = vdr-$(ARCHIVE)
55
-
56
-### The name of the shared object file:
57
-
58
-SOFILE = libvdr-$(PLUGIN).so
59
-
60
-### Includes and Defines (add further entries here):
61
-
62
-INCLUDES +=
63
-
64
-DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
65
-
66
-# Uncomment for more debug messages
67
-# DEFINES += -DVERBOSEDEBUG
68
-
69
-# Flags for libcec
70
-LIBS += $(shell pkg-config --libs libcec)
71
-CFLAGS += $(shell pkg-config --cflags libcec)
72
-CXXFLAGS += $(shell pkg-config --cflags libcec)
73
-
74
-# Flags for pugixml xml parser
75
-LIBS += -lpugixml
76
-
77
-### The object files (add further files here):
78
-
79
-OBJS = cecremote.o cecremoteplugin.o configmenu.o configfileparser.o \
80
-       cecosd.o stillpicplayer.o ceccontrol.o keymaps.o statusmonitor.o \
81
-       cmd.o opcodemap.o handleactions.o rtcwakeup.o
82
-
83
-### The main target:
84
-
85
-all: $(SOFILE) i18n
86
-
87
-### Implicit rules:
88
-
89
-%.o: %.cc
90
-	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
91
-
92
-### Dependencies:
93
-
94
-MAKEDEP = $(CXX) -MM -MG
95
-DEPFILE = .dependencies
96
-$(DEPFILE): Makefile
97
-	@$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.cc) > $@
98
-
99
--include $(DEPFILE)
100
-
101
-### Internationalization (I18N):
102
-
103
-PODIR     = po
104
-I18Npo    = $(wildcard $(PODIR)/*.po)
105
-I18Nmo    = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file))))
106
-I18Nmsgs  = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
107
-I18Npot   = $(PODIR)/$(PLUGIN).pot
108
-
109
-%.mo: %.po
110
-	msgfmt -c -o $@ $<
111
-
112
-$(I18Npot): $(wildcard *.cc)
113
-	xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ `ls $^`
114
-
115
-%.po: $(I18Npot)
116
-	msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $<
117
-	@touch $@
118
-
119
-$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
120
-	install -D -m644 $< $@
121
-
122
-.PHONY: i18n
123
-i18n: $(I18Nmo) $(I18Npot)
124
-
125
-install-i18n: $(I18Nmsgs)
126
-
127
-### Targets:
128
-
129
-$(SOFILE): $(OBJS)
130
-	$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@
131
-
132
-install-lib: $(SOFILE)
133
-	install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
134
-
135
-install-config:
136
-	if ! test -f $(DESTDIR)$(CONFFILE); then \
137
-		install --mode=644 -D ./contrib/cecremote.xml $(DESTDIR)$(CONFFILE); \
138
-	fi
139
-
140
-install: install-lib install-i18n install-config
141
-
142
-dist: $(I18Npo) clean
143
-	@-rm -rf $(TMPDIR)/$(ARCHIVE)
144
-	@mkdir $(TMPDIR)/$(ARCHIVE)
145
-	@cp -a * $(TMPDIR)/$(ARCHIVE)
146
-	@tar czf $(PACKAGE).tgz --exclude=*/push.sh -C $(TMPDIR) $(ARCHIVE)
147
-	@-rm -rf $(TMPDIR)/$(ARCHIVE)
148
-	@echo Distribution package created as $(PACKAGE).tgz
149
-
150
-clean:
151
-	@-rm -f $(PODIR)/*.mo $(PODIR)/*.pot
152
-	@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~
153
-	@-rm -f .dependencies

+ 0
- 334
v/vdr-plugin-cecremote-1.4.0/README View File

@@ -1,334 +0,0 @@
1
-This is a "plugin" for the Video Disk Recorder (VDR).
2
-
3
-Written by:                  Ulrich Eckhardt <uli-vdr@uli-eckhardt.de>
4
-
5
-Project's homepage:          http://www.uli-eckhardt.de/vdr/cec.en.shtml 
6
-
7
-Latest version available at: http://git.uli-eckhardt.de/
8
-
9
-This program is free software; you can redistribute it and/or modify
10
-it under the terms of the GNU General Public License as published by
11
-the Free Software Foundation; either version 2 of the License, or
12
-(at your option) any later version.
13
-See the file COPYING for more information.
14
-
15
-Requirements
16
-==============
17
-  libCEC V2.2.0 
18
-  http://libcec.pulse-eight.com/
19
-  
20
-  PugiXML V1.5, XML parser for C++
21
-  http://pugixml.org/
22
-
23
-  For PugiXML on Raspberry Pi see:
24
-  http://distribution-us.hexxeh.net/raspbian/archive/raspbian/pool/main/p/pugixml/
25
-
26
-Description:
27
-==============
28
-
29
-Plugin to receive and send commands via CEC.
30
-
31
-Installation:
32
-==============
33
-
34
-First get connected device either via the cec-client if the plugin is not 
35
-running :
36
-     echo "scan" | cec-client -s -d 1
37
-
38
-The output should look like:
39
-    opening a connection to the CEC adapter...
40
-    requesting CEC bus information ...
41
-    CEC bus information
42
-    ===================
43
-    device #0: TV
44
-    address:       0.0.0.0
45
-    active source: no
46
-    vendor:        Panasonic
47
-    osd string:    TV
48
-    CEC version:   1.4
49
-    power status:  on
50
-    language:      ger
51
-
52
-
53
-    device #4: Playback 1
54
-    address:       1.0.0.0
55
-    active source: no
56
-    vendor:        Panasonic
57
-    osd string:    CECTester
58
-    CEC version:   1.4
59
-    power status:  on
60
-    language:      eng
61
-
62
-
63
-    device #8: Playback 2
64
-    address:       2.0.0.0
65
-    active source: no
66
-    vendor:        Samsung
67
-    osd string:    BD Player
68
-    CEC version:   1.4
69
-    power status:  on
70
-    language:      ???
71
-
72
-
73
-On a running VDR with the cecremote plugin running, this information can
74
-be retrieved via:
75
-   svdrpsend plug cecremote LSTD
76
-
77
-The output should look like:
78
-
79
-220 vdr SVDRP VideoDiskRecorder 2.0.7; Sun Mar  1 15:19:31 2015; UTF-8
80
-214-Available CEC Devices:
81
-214-  Device 0 path: /sys/devices/pci0000:00/0000:00:14.0/usb1/1-3 port: /dev/ttyACM0 Firmware 0004
82
-214-
83
-214-Active Devices:
84
-214-   0# TV             @0000 TV              TV             Panasonic
85
-214-   3# Tuner 1        @1000 Tuner 1         VDR            VDR
86
-214-   4# Playback 1     @1000 VDR             VDR            VDR
87
-214    8# Playback 2     @2000 BD Player       BD Player      Samsung
88
-221 vdr closing connection
89
-
90
-In the plugin configuration directory create the file cecremote.xml (an example
91
-can be found in the contrib directory) with an device entry for each device
92
-which should be handled by this plugin.
93
-
94
-In this example device#8 (osd string=CECTester) is the address of the libCEC
95
-device (VDR).
96
-
97
-After the first start of the vdr ensure, that the CEC device is not accessed
98
-by the Modem-Manager or mtp-probe by grep for the device path 
99
-(/sys/devices/pci00 ...) in the log.
100
-
101
-An example udev rule which can be installed at /etc/udev/rules.d/20-libcec.rules
102
-can be found in the contrib directory. This udev rule disables access of the
103
-ModemManger or mtp-probe to the pulse-eight CEC adapter.
104
-
105
-Format of the configuration file :
106
-===================================
107
-
108
-The configuration file is in XML format The root element is <config>. Within
109
-this element one <global> child element is used to specify global options
110
-for this plugin and several <menu>, <ceckeymap> and <vdrkeymap> child elements.
111
-
112
-* Ceckeymap
113
-====================================
114
-This element contains definitions for mapping a CEC Key to one or more VDR keys.
115
-The <ceckeymap> tag must have the attribute "id" specified. This id is used 
116
-later in the <player> section to address this key map.
117
-
118
-This tag creates a new key map with a preconfigured map. Elements of this map
119
-can be overwritten with <key> elements.
120
-
121
-* Vdrkeymap
122
-====================================
123
-This element contains definitions for mapping a VDR Key to one or more CEC keys.
124
-The <vdrkeymap> tag must have the attribute "id" specified. This id is used 
125
-later in the <player> section to address this key map.
126
-
127
-This tag creates a new key map with a preconfigured map. Elements of this map
128
-can be overwritten with <key> elements.
129
-
130
-* Key
131
-====================================
132
-This element is used within <ceckeymap> or <vdrkeymap> to overwrite existing
133
-map entries. The <key> tag must have the attribute "code" specified. This
134
-specifies the key code to redefine. If used in <ceckeymap> code
135
-is a CEC key name (see svdrpsend plug cecremote LSTK for the name of the
136
-supported CEC key codes). When used in <vdrkeymap> the code is the vdr 
137
-key name as used for example in keymacros.conf.
138
-
139
-The <key> element can have <value> elements which specifies the key codes
140
-to map. If no <value> element is specified, this key code is not mapped and
141
-so this key is not usable.
142
-
143
-* Value
144
-====================================
145
-This element is used within <key> to assign key codes to the key map.
146
-
147
-If the <value> element is used in <vdrkeymap> the <value> element contains
148
-a CEC key name (see svdrpsend plug cecremote LSTK for the name of the
149
-supported CEC key codes). When used in <ceckeymap> the <value> element is the 
150
-vdr key name as used for example in keymacros.conf.
151
-
152
-The following example create a new key map with id "TV" where the VDR key OK
153
-is mapped the the CEC "ROOT_MENU" key:
154
-
155
-  <vdrkeymap id="TV">
156
-    <key code="OK">
157
-      <value>ROOT_MENU</value>
158
-    </key>
159
-  </vdrkeymap>
160
-
161
-The next example creates an other key map with id "TV". If the CEC key code
162
-"SELECT" is received, this key is mapped to the VDR menu key. The key code
163
-"RIGHT_UP" is mapped to only "right" and not as default to right+up.
164
-
165
-  <ceckeymap id="TV">
166
-    <key code="SELECT">
167
-      <value>Menu</value>
168
-    </key>
169
-    <key code="RIGHT_UP">
170
-      <value>Right</value>
171
-    </key>
172
-  </ceckeymap>
173
-
174
-
175
-* device
176
-====================================
177
-The device element contains definitions for CEC devices. The main purpose is
178
-to specify a CEC device by the physical address, e.g. when more than one
179
-recording device may be available.
180
-
181
-The following configuration would create an entry for a blueray player. 
182
-<device id="blueray">
183
-   <physical>2000</physical>
184
-   <logical>8</logical>
185
-</device>
186
-
187
-The software first tries to get the logical address by the device located at
188
-the physical address 2000 (second HDMI port connected to the TV, for the
189
-address concept see for example 
190
-http://elinux.org/CEC_%28Consumer_Electronics_Control%29_over_HDMI ).
191
-
192
-In case that there is more than one device available at the physical address or
193
-no device could be found on the physical address the logical address (in this
194
-case Playback 2) is used.
195
-
196
-* Global
197
-====================================
198
-
199
-The child elements of <global> are <rtcdetect>, <cecdebug>, <onstart>,
200
-<onmanualstart>, <onstop> <onswitchtotv>, <onswitchtoradio>, <onswitchtoreplay>
201
-<shutdownonstandby>, <poweroffonstandby> and <keymaps>.
202
-
203
-<cecdebug>          Debug level for CEC debugging (see cec_log_level in cectypes.h)
204
-<onstart>           A command list which is executed upon plugin start.
205
-<onmanualstart>     A command list which is executed upon manual plugin start, but 
206
-                    not if the VDR was started due to a timer.
207
-<onstop>            A command list which is executed upon plugin shutdown.
208
-<onswitchtotv>      A command list which is executed if switched to a TV program.
209
-<onswitchtoradio>   A command list which is executed if switched to a radio program.
210
-<onswitchtoreplay>  A command list which is executed if the VDR replays a recording.
211
-<keymaps>           The <keymaps> tag has the attribute cec, which addresses the 
212
-                    id specified within a <ceckeymap>. This keymap is used to 
213
-                    convert a CEC-Keycode to a VDR-Key.
214
-<cecdevicetype>     The device types to register with libCEC. The following 
215
-                    device types are available:
216
-                    * RECORDING_DEVICE
217
-                    * TUNER
218
-                    * TV
219
-                    * PLAYBACK_DEVICE
220
-                    * AUDIO_SYSTEM
221
-<hdmiport>          Specify the HDMI-Port where the adapter is connected to.
222
-<rtcdetect>         If set to true (default) use the rtc driver to detect if
223
-                    the vdr was started manually or by rtc alarm. Otherwise
224
-                    use a heuristic. If the VDR was started in a time range
225
-                    5 minutes before or after an timer was running, the VDR
226
-                    start is detected as timed start.
227
-<shutdownonstandby> If set to true, all CEC devices are set to standby when the
228
-                    VDR is shut down. Default is false.
229
-<poweroffonstandby> If set to true, all CEC devices are set to power off when
230
-                    the VDR is shut down. Default is false.
231
-
232
-NOTE: There seems to be a bug in the libCEC implementation for the Raspberry PI
233
-      which causes a crash when registering more than one device type.
234
-
235
-For the description of a command list see below.
236
-
237
-* Menu
238
-====================================
239
-
240
-Defines a menu for executing CEC and shell commands.
241
-
242
-The <menu> tag must have the following attributes:
243
-  * name    : The name of the menu (displayed in the OSD)
244
-  * address : CEC device address.
245
-  
246
-The child elements of <menu> are <onstart>, <onstop>, <player>,
247
-<onpoweron>, <onpoweroff>. <onstart>, <onstop> and <onpoweron>, <onpoweroff> 
248
-are mutually exclusive.
249
-
250
-<player>    : (see below).
251
-              
252
-<onstart>   : A command list which is executed when the menu entry is selected.
253
-<onstop>    : A command list which is executed if <stillpic> is present and 
254
-              the player is stopped.
255
-<onpoweron> : A command list which is executed if the device is currently 
256
-              powered off.
257
-<onpoweroff>: A command list which is executed if the device is currently 
258
-              powered on.
259
-
260
-* OnCECCommand
261
-====================================
262
-
263
-Perform actions when a cec command is received. 
264
-
265
-The <onceccommand> must have the following attributes:
266
-  * command :   A CEC opcode as string as defined in cectypes.h, but without the
267
-                CEC_OPCODE_ prefix. The opcode can also be defined as a numeric or
268
-                hex value. The following examples are valid defines for
269
-                CEC_OPCODE_STANDBY:
270
-              
271
-                command="STANDBY", command="0x36", command="54"
272
-  * initiator : The device which initiated this command.
273
-  
274
-The child elements of <onceccommand> are <stopmenu>, <execmenu> and
275
-<commandlist>.
276
-
277
-<stopmenu>menu name</stopmenu>:
278
-    If a menu with the name has a still pic player, this player is stopped.
279
-<execmenu>menu name</execmenu>:
280
-    Execute the CEC plugin menu entry with the name.
281
-<commandlist>:
282
-   A command list which is executed when this command is received.
283
-
284
-* Player 
285
-====================================
286
-Starts a stillpic player and waits until the player is stopped. This tag can 
287
-not be used with <onpoweron> and <onpoweroff>.
288
-
289
-The <player> tag must have the following attribute:
290
-  * file : Filename of the still-picture in mpeg format.
291
-  
292
-The child elements of <player> are <stop>.and <keymaps> 
293
-
294
-<stop>    : Can be used several times and contains a VDR-Key to stop this player.
295
-<keymaps> : The <keymaps> tag has the attributes "cec" and "vdr" which
296
-            addresses the id specified within <ceckeymap> or <vdrkeymap>.
297
-            When the player is started, these keymaps are activated. If a tag is
298
-            missing, the default keymap is used. 
299
-
300
-* Command lists
301
-====================================
302
-
303
-A command list defines a list of actions to be executed.
304
-
305
-The child elements of a command list are <poweron>, <poweroff>, <makeactive>
306
-and <exec>.
307
-
308
-<poweron>CEC Device Address</poweron>       : Powers the device on.
309
-<poweroff>CEC Device Address</poweroff>     : Powers the device off.
310
-<makeactive/>                               : Makes the VDR the active device.
311
-<makeinactive/>                             : Remove the VDR as the active device.
312
-<textviewon>CEC Device Address</textviewon> : Send the TextViewOn CEC command to
313
-                                              the CEC device.
314
-<exec>Command</exec>                        : Executes a shell command.
315
-
316
-
317
-* SVDRP Commands
318
-=====================================
319
-LSTK     : List all supported CEC keycodes
320
-LSTD     : List active CEC devices
321
-KEYM     : List available key maps
322
-VDRK [id]: Display the VDR->CEC key map with the given id
323
-CECK [id]: Display the CEC->VDR key map with the given id
324
-CONN     : Connect the CEC adapter.
325
-DISC     : Disconnect the CEC adapter. This can be used for example,
326
-           if an other program requires access to the CEC adapter.
327
-
328
-* Commandline arguments
329
-=====================================
330
--c  --configdir <dir>   : Directory for the configuration file. If the directory
331
-                          does not start with a slash, the directory is relative
332
-                          to the vdr config directory, otherwise it specifies an
333
-                          absolute path. Default is cecremote.
334
--x  --configfile <file> : Name of the configuartion file. Default is cecremote.xml

+ 0
- 63
v/vdr-plugin-cecremote-1.4.0/ceccontrol.cc View File

@@ -1,63 +0,0 @@
1
-/*
2
- * CECRemote PlugIn for VDR
3
- *
4
- * Copyright (C) 2014, 2015 Ulrich Eckhardt <uli-vdr@uli-eckhardt.de>
5
- *
6
- * This code is distributed under the terms and conditions of the
7
- * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
8
- *
9
- * This class implements the VDR cControl for the cec player
10
- *
11
- */
12
-
13
-#include "ceccontrol.h"
14
-#include "stillpicplayer.h"
15
-#include "ceclog.h"
16
-
17
-namespace cecplugin {
18
-
19
-cCECControl::cCECControl(const cCECMenu &menuitem, cPluginCecremote *plugin) :
20
-    cControl(mStillPicPlayer = new cStillPicPlayer(menuitem))
21
-{
22
-    mPlugin = plugin;
23
-    mMenuItem = menuitem;
24
-    mPlugin->mKeyMaps.SetActiveKeymaps(menuitem.mVDRKeymap, menuitem.mCECKeymap);
25
-    mPlugin->PushCmdQueue(mMenuItem.mOnStart);
26
-}
27
-
28
-cCECControl::~cCECControl() {
29
-    mPlugin->PushCmdQueue(mMenuItem.mOnStop);
30
-    mPlugin->SetDefaultKeymaps();
31
-    delete mStillPicPlayer;
32
-}
33
-
34
-void cCECControl::Hide(void)
35
-{
36
-    Dsyslog("Hide cCECControl");
37
-}
38
-
39
-/*
40
- * Get VDR keys and queue them to send to the active CEC device.
41
- */
42
-eOSState cCECControl::ProcessKey(eKeys key)
43
-{
44
-    cKey k;
45
-    if (key != kNone) Dsyslog("cCECControl ProcessKey %d %s", key, k.ToString(key,false));
46
-
47
-    if (mMenuItem.isStopKey(key)) {
48
-        Hide();
49
-        return osEnd;
50
-    }
51
-    if (key == kNone) {
52
-        return osContinue;
53
-    }
54
-
55
-    key = (eKeys)((int)key & ~k_Repeat);
56
-    cCmd cmd(CEC_VDRKEYPRESS, (int)key, &mMenuItem.mDevice);
57
-    mPlugin->PushCmd(cmd);
58
-
59
-    return (osContinue);
60
-}
61
-
62
-} // namespace cecplugin
63
-

+ 0
- 43
v/vdr-plugin-cecremote-1.4.0/ceccontrol.h View File

@@ -1,43 +0,0 @@
1
-/*
2
- * CECRemote PlugIn for VDR
3
- *
4
- * Copyright (C) 2014-2016 Ulrich Eckhardt <uli-vdr@uli-eckhardt.de>
5
- *
6
- * This code is distributed under the terms and conditions of the
7
- * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
8
- *
9
- * This class implements the VDR cControl for the cec player
10
- *
11
- */
12
-
13
-#ifndef CECONTROL_H_
14
-#define CECONTROL_H_
15
-
16
-#include <vdr/player.h>
17
-
18
-#include "cecremoteplugin.h"
19
-#include "stillpicplayer.h"
20
-
21
-namespace cecplugin {
22
-
23
-class cCECControl: public cControl {
24
-private:
25
-    cStillPicPlayer *mStillPicPlayer;
26
-    cPluginCecremote *mPlugin;
27
-    cCECMenu mMenuItem;
28
-
29
-public:
30
-    cCECControl(const cCECMenu &menuitem, cPluginCecremote *plugin);
31
-    virtual ~cCECControl();
32
-
33
-    virtual void Hide(void);
34
-    virtual cOsdObject *GetInfo(void) { return NULL; }
35
-    virtual eOSState ProcessKey(eKeys Key);
36
-    std::string getMenuTitle() {
37
-        return mMenuItem.mMenuTitle;
38
-    }
39
-};
40
-
41
-} // namespace cecplugin
42
-
43
-#endif /* CECONTROL_H_ */

+ 0
- 53
v/vdr-plugin-cecremote-1.4.0/ceclog.h View File

@@ -1,53 +0,0 @@
1
-/*
2
- * CECRemote PlugIn for VDR
3
- *
4
- * Copyright (C) 2014, 2015 Ulrich Eckhardt <uli-vdr@uli-eckhardt.de>
5
- *
6
- * This code is distributed under the terms and conditions of the
7
- * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
8
- *
9
- * This class implements logging functions
10
- *
11
- */
12
-
13
-#ifndef CECLOG_H_
14
-#define CECLOG_H_
15
-
16
-namespace cecplugin {
17
-
18
-#define MAXSYSLOGBUF 256
19
-
20
-static void ceclogmsg (int severity, const char *format, ...)
21
-{
22
-    if (SysLogLevel > severity) {
23
-        char fmt[MAXSYSLOGBUF];
24
-
25
-        int facility_priority = LOG_ERR;
26
-        if (severity == 1) {
27
-            facility_priority = LOG_WARNING;
28
-        }
29
-        else if (severity == 2) {
30
-            facility_priority = LOG_DEBUG;
31
-        }
32
-
33
-        snprintf(fmt, sizeof(fmt), "[cecremote] %s", format);
34
-        va_list ap;
35
-        va_start(ap, format);
36
-        vsyslog(facility_priority ,fmt, ap);
37
-        va_end(ap);
38
-    }
39
-}
40
-
41
-#define Esyslog(a...) ceclogmsg(0, a)
42
-#define Isyslog(a...) ceclogmsg(1, a)
43
-#define Dsyslog(a...) ceclogmsg(2, a)
44
-
45
-#ifdef VERBOSEDEBUG
46
-#define Csyslog(a...) ceclogmsg(2, a)
47
-#else
48
-#define Csyslog(a...)
49
-#endif
50
-
51
-} // namespace cecplugin
52
-
53
-#endif /* CECLOG_H_ */

+ 0
- 78
v/vdr-plugin-cecremote-1.4.0/cecosd.cc View File

@@ -1,78 +0,0 @@
1
-/*
2
- * CECRemote PlugIn for VDR
3
- *
4
- * Copyright (C) 2015 Ulrich Eckhardt <uli-vdr@uli-eckhardt.de>
5
- *
6
- * This code is distributed under the terms and conditions of the
7
- * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
8
- *
9
- * This class implements the OSD menu.
10
- */
11
-
12
-#include <algorithm>
13
-#include <stdexcept>
14
-#include "cecremoteplugin.h"
15
-#include "cecosd.h"
16
-#include "ceclog.h"
17
-
18
-using namespace std;
19
-using namespace cecplugin;
20
-
21
-namespace cecplugin {
22
-
23
-std::vector<cCECMenu> cCECOsd::mMenuItems;
24
-
25
-cCECOsd::cCECOsd(cPluginCecremote *plugin) :
26
-                 cOsdMenu(tr("CEC Device")) {
27
-
28
-  int cnt = 1;
29
-  char num[4];
30
-  cCECMenu menuitem;
31
-  string menutxt;
32
-  cCECMenuList *menulist = plugin->GetMenuList();
33
-
34
-  for (cCECMenuListIterator i = menulist->begin();
35
-       i != menulist->end(); i++) {
36
-      menuitem = *i;
37
-      if (cnt <= 9) {
38
-          sprintf(num,"%d ", cnt);
39
-      }
40
-      else {
41
-          strcpy (num, "  ");
42
-      }
43
-
44
-      menutxt = num + menuitem.mMenuTitle;
45
-      Add(new cCECOsdItem(menuitem, menutxt.c_str(), plugin));
46
-      mMenuItems.push_back(menuitem);
47
-      cnt++;
48
-  }
49
-}
50
-
51
-cCECOsdItem::cCECOsdItem(const cCECMenu &menuitem, const char *menutxt,
52
-                         cPluginCecremote *plugin) :
53
-        cOsdItem(menutxt), mControl(NULL) {
54
-    mMenuItem = menuitem;
55
-    mPlugin = plugin;
56
-    Dsyslog("Menu %s", menutxt);
57
-}
58
-
59
-eOSState cCECOsdItem::ProcessKey(eKeys key) {
60
-    eOSState state = osUnknown;
61
-
62
-    if (key == kOk) {
63
-        mPlugin->StartPlayer(mMenuItem);
64
-        return osEnd;
65
-    }
66
-    if ((key > k0) && (key <= k9)) {
67
-        try {
68
-            mPlugin->StartPlayer(cCECOsd::mMenuItems.at(key-k1));
69
-            state = osEnd;
70
-        } catch (const std::out_of_range &oor) {
71
-            Isyslog("StartPlayer Out of range");
72
-        }
73
-    }
74
-    return state;
75
-}
76
-
77
-} // namespace cecplugin
78
-

+ 0
- 42
v/vdr-plugin-cecremote-1.4.0/cecosd.h View File

@@ -1,42 +0,0 @@
1
-/*
2
- * CECRemote PlugIn for VDR
3
- *
4
- * Copyright (C) 2015 Ulrich Eckhardt <uli-vdr@uli-eckhardt.de>
5
- *
6
- * This code is distributed under the terms and conditions of the
7
- * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
8
- *
9
- * This class implements the OSD menu.
10
- */
11
-
12
-#ifndef CECOSD_H_
13
-#define CECOSD_H_
14
-
15
-#include <vdr/menu.h>
16
-#include <vdr/plugin.h>
17
-#include "ceccontrol.h"
18
-
19
-namespace cecplugin {
20
-
21
-class cCECOsd : public cOsdMenu {
22
-public:
23
-    static std::vector<cCECMenu> mMenuItems;
24
-    cCECOsd(cPluginCecremote *plugin);
25
-    virtual ~cCECOsd() {}
26
-};
27
-
28
-class cCECOsdItem : public cOsdItem {
29
-private:
30
-    cCECControl *mControl;
31
-    cPluginCecremote *mPlugin;
32
-    cCECMenu mMenuItem;
33
-
34
-public:
35
-  cCECOsdItem(const cCECMenu &menuitem, const char *menutxt, cPluginCecremote *plugin);
36
-  ~cCECOsdItem() {}
37
-  virtual eOSState ProcessKey(eKeys key);
38
-};
39
-
40
-} // namespace cecplugin
41
-
42
-#endif /* CECOSD_H_ */

+ 0
- 846
v/vdr-plugin-cecremote-1.4.0/cecremote.cc View File

@@ -1,846 +0,0 @@
1
-/*
2
- * CECRemote PlugIn for VDR
3
- *
4
- * Copyright (C) 2015-2016 Ulrich Eckhardt <uli-vdr@uli-eckhardt.de>
5
- *
6
- * This code is distributed under the terms and conditions of the
7
- * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
8
- *
9
- * This class implements the remote receiving and processing the CEC commands.
10
- */
11
-
12
-#include "cecremote.h"
13
-#include "ceclog.h"
14
-#include "cecremoteplugin.h"
15
-#include <sys/wait.h>
16
-// We need this for cecloader.h
17
-#include <iostream>
18
-using namespace std;
19
-#include <cecloader.h>
20
-
21
-using namespace cecplugin;
22
-
23
-namespace cecplugin {
24
-const char *cCECRemote::VDRNAME = "VDR";
25
-/*
26
- * Callback when libCEC receives a key press
27
- */
28
-static int CecKeyPressCallback(void *cbParam, const cec_keypress key)
29
-{
30
-    static cec_user_control_code lastkey = CEC_USER_CONTROL_CODE_UNKNOWN;
31
-    cCECRemote *rem = (cCECRemote *)cbParam;
32
-
33
-    Dsyslog("key pressed %02x (%d)", key.keycode, key.duration);
34
-    if (
35
-        ((key.keycode >= 0) && (key.keycode <= CEC_USER_CONTROL_CODE_MAX)) &&
36
-        ((key.duration == 0) || (key.keycode != lastkey))
37
-       )
38
-    {
39
-        lastkey = key.keycode;
40
-        cCmd cmd(CEC_KEYRPRESS, (int)key.keycode);
41
-        rem->PushCmd(cmd);
42
-    }
43
-    return 0;
44
-}
45
-
46
-/*
47
- * Callback function for libCEC command messages.
48
- * Currently only used for debugging.
49
- */
50
-static int CecCommandCallback(void *cbParam, const cec_command command)
51
-{
52
-    cCECRemote *rem = (cCECRemote *)cbParam;
53
-    Dsyslog("CEC Command %d : %s Init %d Dest %d", command.opcode,
54
-                                   rem->mCECAdapter->ToString(command.opcode),
55
-                                   command.initiator, command.destination);
56
-    cCmd cmd(CEC_COMMAND, command.opcode, command.initiator);
57
-    rem->PushCmd(cmd);
58
-
59
-    return 0;
60
-}
61
-
62
-
63
-/*
64
- * Callback function for libCEC alert messages.
65
- * Currently only used for debugging.
66
- */
67
-static int CecAlertCallback(void *cbParam, const libcec_alert type,
68
-                            const libcec_parameter param)
69
-{
70
-    cCECRemote *rem = (cCECRemote *)cbParam;
71
-    Dsyslog("CecAlert %d", type);
72
-    switch (type)
73
-    {
74
-    case CEC_ALERT_CONNECTION_LOST:
75
-        Esyslog("Connection lost");
76
-        rem->Reconnect();
77
-        break;
78
-    case CEC_ALERT_TV_POLL_FAILED:
79
-        Isyslog("TV Poll failed");
80
-        break;
81
-    case CEC_ALERT_SERVICE_DEVICE:
82
-        Isyslog("CEC_ALERT_SERVICE_DEVICE");
83
-        break;
84
-    case CEC_ALERT_PERMISSION_ERROR:
85
-        Isyslog("CEC_ALERT_PERMISSION_ERROR");
86
-        break;
87
-    case CEC_ALERT_PORT_BUSY:
88
-        Isyslog("CEC_ALERT_PORT_BUSY");
89
-        break;
90
-    case CEC_ALERT_PHYSICAL_ADDRESS_ERROR:
91
-        Isyslog("CEC_ALERT_PHYSICAL_ADDRESS_ERROR");
92
-        break;
93
-    default:
94
-        break;
95
-    }
96
-    return 0;
97
-}
98
-
99
-/*
100
- * Callback function for libCEC to print out log messages.
101
- */
102
-static int CecLogMessageCallback(void *cbParam, const cec_log_message message)
103
-{
104
-    cCECRemote *rem = (cCECRemote *)cbParam;
105
-    if ((message.level & rem->getCECLogLevel()) == message.level)
106
-    {
107
-        string strLevel;
108
-        switch (message.level)
109
-        {
110
-        case CEC_LOG_ERROR:
111
-            strLevel = "ERROR:   ";
112
-            break;
113
-        case CEC_LOG_WARNING:
114
-            strLevel = "WARNING: ";
115
-            break;
116
-        case CEC_LOG_NOTICE:
117
-            strLevel = "NOTICE:  ";
118
-            break;
119
-        case CEC_LOG_TRAFFIC:
120
-            strLevel = "TRAFFIC: ";
121
-            break;
122
-        case CEC_LOG_DEBUG:
123
-            strLevel = "DEBUG:   ";
124
-            break;
125
-        default:
126
-            break;
127
-        }
128
-
129
-        char strFullLog[1040];
130
-        snprintf(strFullLog, 1039, "CEC %s %s", strLevel.c_str(), message.message);
131
-        if (message.level == CEC_LOG_ERROR)
132
-        {
133
-            Esyslog(strFullLog);
134
-        }
135
-        else
136
-        {
137
-            Dsyslog(strFullLog);
138
-        }
139
-    }
140
-    return 0;
141
-}
142
-
143
-/*
144
- * Callback function for libCEC when a device gets activated.
145
- * Currently only used for debugging.
146
- */
147
-static void CECSourceActivatedCallback (void *cbParam,
148
-                                        const cec_logical_address address,
149
-                                        const uint8_t activated)
150
-{
151
-    Csyslog("CECSourceActivatedCallback adress %d activated %d", address, activated);
152
-}
153
-
154
-/*
155
- * Callback function for libCEC when configuration changes.
156
- * Currently only used for debugging.
157
- */
158
-static int CECConfigurationCallback (void *cbParam,
159
-                                     const libcec_configuration config)
160
-{
161
-    Csyslog("CECConfiguration");
162
-    return CEC_TRUE;
163
-}
164
-
165
-/*
166
- * Worker thread which processes the command queue and executes the
167
- * received commands.
168
- */
169
-void cCECRemote::Action(void)
170
-{
171
-    cCmd cmd;
172
-    cCECList ceckmap;
173
-    cec_logical_address addr;
174
-    eKeys k;
175
-
176
-    Connect();
177
-
178
-    Dsyslog("cCECRemote start worker thread");
179
-    while (Running()) {
180
-        cmd = WaitCmd();
181
-        Dsyslog ("(%d) Action %d Val %d Phys Addr %d Logical %04x %04x Op %d",
182
-                 cmd.mSerial,
183
-                 cmd.mCmd, cmd.mVal, cmd.mDevice.mPhysicalAddress,
184
-                 cmd.mDevice.mLogicalAddressDefined,
185
-                 cmd.mDevice.mLogicalAddressUsed,
186
-                 cmd.mCecOpcode);
187
-        switch (cmd.mCmd)
188
-        {
189
-        case CEC_KEYRPRESS:
190
-            if ((cmd.mVal >= 0) && (cmd.mVal <= CEC_USER_CONTROL_CODE_MAX)) {
191
-                const cKeyList &inputKeys =
192
-                        mPlugin->mKeyMaps.CECtoVDRKey((cec_user_control_code)cmd.mVal);
193
-                cKeyListIterator ikeys;
194
-                for (ikeys = inputKeys.begin(); ikeys != inputKeys.end(); ++ikeys) {
195
-                    k = *ikeys;
196
-                    Put(k);
197
-                    Dsyslog ("   Put(%d)", k);
198
-                }
199
-            }
200
-            break;
201
-        case CEC_POWERON:
202
-            if (mCECAdapter != NULL) {
203
-                Dsyslog("Power on");
204
-                addr = getLogical(cmd.mDevice);
205
-                if ((addr != CECDEVICE_UNKNOWN) &&
206
-                    (!mCECAdapter->PowerOnDevices(addr))) {
207
-                    Esyslog("PowerOnDevice failed for %s",
208
-                            mCECAdapter->ToString(addr));
209
-                }
210
-                else {
211
-                    WaitForPowerStatus(addr, CEC_POWER_STATUS_ON);
212
-                }
213
-            }
214
-            else {
215
-                Esyslog("PowerOnDevice ignored");
216
-            }
217
-            break;
218
-        case CEC_POWEROFF:
219
-            if (mCECAdapter != NULL) {
220
-                addr = getLogical(cmd.mDevice);
221
-                if ((addr != CECDEVICE_UNKNOWN) &&
222
-                    (!mCECAdapter->StandbyDevices(addr))) {
223
-                    Esyslog("StandbyDevices failed for %s",
224
-                            mCECAdapter->ToString(addr));
225
-                }
226
-                else {
227
-                    WaitForPowerStatus(addr, CEC_POWER_STATUS_STANDBY);
228
-                }
229
-            }
230
-            else {
231
-                Esyslog("StandbyDevices ignored");
232
-            }
233
-            break;
234
-        case CEC_TEXTVIEWON:
235
-            if (mCECAdapter != NULL) {
236
-                Dsyslog("Textviewon");
237
-                addr = getLogical(cmd.mDevice);
238
-                if ((addr != CECDEVICE_UNKNOWN) &&
239
-                    (TextViewOn(addr) != 0)) {
240
-                    Esyslog("TextViewOn failed for %s",
241
-                            mCECAdapter->ToString(addr));
242
-                }
243
-            }
244
-            else {
245
-                Esyslog("Textviewon ignored");
246
-            }
247
-            break;
248
-        case CEC_MAKEACTIVE:
249
-            if (mCECAdapter != NULL) {
250
-                Dsyslog ("Make active");
251
-                if (!mCECAdapter->SetActiveSource()) {
252
-                    Esyslog("SetActiveSource failed");
253
-                }
254
-            }
255
-            else {
256
-                Esyslog("SetActiveSource ignored");
257
-            }
258
-            break;
259
-        case CEC_MAKEINACTIVE:
260
-            if (mCECAdapter != NULL) {
261
-                Dsyslog ("Make inactive");
262
-                if (!mCECAdapter->SetInactiveView()) {
263
-                    Esyslog("SetInactiveView failed");
264
-                }
265
-            }
266
-            else {
267
-                Esyslog("SetInactiveView ignored");
268
-            }
269
-            break;
270
-        case CEC_VDRKEYPRESS:
271
-            if (mCECAdapter != NULL) {
272
-                ActionKeyPress(cmd);
273
-            }
274
-            else {
275
-                Esyslog("Keypress ignored");
276
-            }
277
-            break;
278
-        case CEC_EXECSHELL:
279
-            Dsyslog ("Exec: %s", cmd.mExec.c_str());
280
-            Exec(cmd);
281
-            break;
282
-        case CEC_EXIT:
283
-            Dsyslog("cCECRemote exit worker thread");
284
-            Cancel(0);
285
-            break;
286
-        case CEC_RECONNECT:
287
-            Dsyslog("cCECRemote reconnect");
288
-            Disconnect();
289
-            sleep(1);
290
-            Connect();
291
-            break;
292
-        case CEC_CONNECT:
293
-            Dsyslog("cCECRemote connect");
294
-            Connect();
295
-            break;
296
-        case CEC_DISCONNECT:
297
-            Dsyslog("cCECRemote disconnect");
298
-            Disconnect();
299
-            break;
300
-        case CEC_COMMAND:
301
-            Dsyslog("cCECRemote command %d", cmd.mCecOpcode);
302
-            CECCommand(cmd);
303
-            break;
304
-        case CEC_EXECTOGGLE:
305
-            Dsyslog("cCECRemote exec_toggle");
306
-            ExecToggle(cmd.mDevice, cmd.mPoweron, cmd.mPoweroff);
307
-            break;
308
-        default:
309
-            Esyslog("Unknown action %d Val %d", cmd.mCmd, cmd.mVal);
310
-            break;
311
-        }
312
-        Csyslog ("(%d) Action finished", cmd.mSerial);
313
-        if (cmd.mSerial != -1) {
314
-            mProcessedSerial = cmd.mSerial;
315
-            mCmdReady.Signal();
316
-        }
317
-    }
318
-    Dsyslog("cCECRemote stop worker thread");
319
-}
320
-
321
-/*
322
- * CEC remote constructor.
323
- * Initializes libCEC and the connected CEC adaptor.
324
- */
325
-
326
-cCECRemote::cCECRemote(const cCECGlobalOptions &options, cPluginCecremote *plugin):
327
-        cRemote("CEC"),
328
-        cThread("CEC receiver"),
329
-        mProcessedSerial(-1),
330
-        mDevicesFound(0),
331
-        mInExec(false)
332
-{
333
-    mPlugin = plugin;
334
-    mCECAdapter = NULL;
335
-    mHDMIPort = options.mHDMIPort;
336
-    mBaseDevice = options.mBaseDevice;
337
-    mCECLogLevel = options.cec_debug;
338
-    mOnStart = options.mOnStart;
339
-    mOnStop = options.mOnStop;
340
-    mOnManualStart = options.mOnManualStart;
341
-    mComboKeyTimeoutMs = options.mComboKeyTimeoutMs;
342
-    mDeviceTypes = options.mDeviceTypes;
343
-    mShutdownOnStandby = options.mShutdownOnStandby;
344
-    mPowerOffOnStandby = options.mPowerOffOnStandby;
345
-
346
-    SetDescription("CEC Action Thread");
347
-
348
-    Start();
349
-
350
-    Csyslog("cCECRemote Init");
351
-}
352
-
353
-void cCECRemote::Startup()
354
-{
355
-    Csyslog("cCECRemote Startup");
356
-
357
-    if (mPlugin->GetStartManually()) {
358
-        PushCmdQueue(mOnManualStart);
359
-    }
360
-    PushCmdQueue(mOnStart);
361
-}
362
-
363
-void cCECRemote::Connect()
364
-{
365
-    Dsyslog("cCECRemote::Connect");
366
-    if (mCECAdapter != NULL) {
367
-        return;
368
-    }
369
-    // Initialize Callbacks
370
-    mCECCallbacks.Clear();
371
-    mCECCallbacks.CBCecLogMessage  = &::CecLogMessageCallback;
372
-    mCECCallbacks.CBCecKeyPress    = &::CecKeyPressCallback;
373
-    mCECCallbacks.CBCecCommand     = &::CecCommandCallback;
374
-    mCECCallbacks.CBCecAlert       = &::CecAlertCallback;
375
-    mCECCallbacks.CBCecSourceActivated = &::CECSourceActivatedCallback;
376
-    mCECCallbacks.CBCecConfigurationChanged = &::CECConfigurationCallback;
377
-
378
-    // Setup CEC configuration
379
-    mCECConfig.Clear();
380
-    strncpy(mCECConfig.strDeviceName, VDRNAME, sizeof(mCECConfig.strDeviceName));
381
-
382
-    // LibCEC before 3.0.0
383
-#ifdef CEC_CLIENT_VERSION_CURRENT
384
-    mCECConfig.clientVersion      = CEC_CLIENT_VERSION_CURRENT;
385
-#else
386
-    // LibCEC 3.0.0
387
-    mCECConfig.clientVersion      = LIBCEC_VERSION_CURRENT;
388
-#endif
389
-    mCECConfig.bActivateSource    = CEC_FALSE;
390
-    mCECConfig.iComboKeyTimeoutMs = mComboKeyTimeoutMs;
391
-    mCECConfig.iHDMIPort = mHDMIPort;
392
-    mCECConfig.wakeDevices.Clear();
393
-    mCECConfig.powerOffDevices.Clear();
394
-    mCECConfig.bShutdownOnStandby = mShutdownOnStandby;
395
-    mCECConfig.bPowerOffOnStandby = mPowerOffOnStandby;
396
-    mCECConfig.baseDevice = mBaseDevice;
397
-    // If no <cecdevicetype> is specified in the <global>, set default
398
-    if (mDeviceTypes.empty())
399
-    {
400
-        mCECConfig.deviceTypes.Add(CEC_DEVICE_TYPE_RECORDING_DEVICE);
401
-    }
402
-    else {
403
-        // Add all device types as specified in <cecdevicetype>
404
-        deviceTypeListIterator idev;
405
-        for (idev = mDeviceTypes.begin();
406
-                idev != mDeviceTypes.end(); ++idev) {
407
-            cec_device_type t = *idev;
408
-            mCECConfig.deviceTypes.Add(t);
409
-            Dsyslog ("   Add device %d", t);
410
-        }
411
-    }
412
-
413
-    // Setup callbacks
414
-    mCECConfig.callbackParam = this;
415
-    mCECConfig.callbacks = &mCECCallbacks;
416
-    // Initialize libcec
417
-    mCECAdapter = LibCecInitialise(&mCECConfig);
418
-    if (mCECAdapter == NULL) {
419
-        Esyslog("Can not initialize libcec");
420
-        return;
421
-    }
422
-    // init video on targets that need this
423
-    mCECAdapter->InitVideoStandalone();
424
-    Dsyslog("LibCEC %s", mCECAdapter->GetLibInfo());
425
-
426
-    mDevicesFound = mCECAdapter->DetectAdapters(mCECAdapterDescription,
427
-                                                MAX_CEC_ADAPTERS, NULL);
428
-    if (mDevicesFound <= 0)
429
-    {
430
-        Esyslog("No adapter found");
431
-        UnloadLibCec(mCECAdapter);
432
-        mCECAdapter = NULL;
433
-        return;
434
-    }
435
-
436
-    for (int i = 0; i < mDevicesFound; i++)
437
-    {
438
-        Dsyslog("Device %d path: %s port: %s Firmware %04d", i,
439
-                mCECAdapterDescription[0].strComPath,
440
-                mCECAdapterDescription[0].strComName,
441
-                mCECAdapterDescription[0].iFirmwareVersion);
442
-    }
443
-
444
-    if (!mCECAdapter->Open(mCECAdapterDescription[0].strComName))
445
-    {
446
-        Esyslog("unable to open the device on port %s",
447
-                mCECAdapterDescription[0].strComName);
448
-        UnloadLibCec(mCECAdapter);
449
-        mCECAdapter = NULL;
450
-        return;
451
-    }
452
-
453
-    cec_logical_addresses devices = mCECAdapter->GetActiveDevices();
454
-    for (int j = 0; j < 16; j++)
455
-    {
456
-        if (devices[j])
457
-        {
458
-            cec_logical_address logical_addres = (cec_logical_address) j;
459
-
460
-            uint16_t phaddr = mCECAdapter->GetDevicePhysicalAddress(logical_addres);
461
-            cec_osd_name name = mCECAdapter->GetDeviceOSDName(logical_addres);
462
-            cec_vendor_id vendor = (cec_vendor_id)mCECAdapter->GetDeviceVendorId(logical_addres);
463
-            Dsyslog("   %15.15s %d@%04x %15.15s %15.15s",
464
-                    mCECAdapter->ToString(logical_addres),
465
-                    logical_addres, phaddr, name.name,
466
-                    mCECAdapter->ToString(vendor));
467
-        }
468
-    }
469
-    Csyslog("END cCECRemote::Initialize");
470
-}
471
-
472
-void cCECRemote::Disconnect()
473
-{
474
-    if (mCECAdapter != NULL) {
475
-        mCECAdapter->SetInactiveView();
476
-        mCECAdapter->Close();
477
-        UnloadLibCec(mCECAdapter);
478
-    }
479
-    mCECAdapter = NULL;
480
-    Dsyslog("cCECRemote::Disconnect");
481
-}
482
-
483
-void cCECRemote::Stop()
484
-{
485
-    Dsyslog("Executing onStop");
486
-    PushCmdQueue(mOnStop);
487
-    // Send exit command to worker thread
488
-    cCmd cmd(CEC_EXIT);
489
-    PushWaitCmd(cmd);
490
-    Csyslog("onStop OK");
491
-}
492
-/*
493
- * Destructor stops the worker thread and unloads libCEC.
494
- */
495
-cCECRemote::~cCECRemote()
496
-{
497
-    Cancel(3);
498
-    Disconnect();
499
-}
500
-
501
-/*
502
- * Function to list all active CEC devices.
503
- */
504
-cString cCECRemote::ListDevices()
505
-{
506
-    cString s = "Available CEC Devices:";
507
-    uint16_t phaddr;
508
-    cec_osd_name name;
509
-    cec_vendor_id vendor;
510
-    cec_power_status powerstatus;
511
-
512
-    if (mCECAdapter == NULL) {
513
-        Esyslog ("ListDevices CEC Adapter disconnected");
514
-        s = "CEC Adapter disconnected";
515
-        return s;
516
-    }
517
-
518
-    for (int i = 0; i < mDevicesFound; i++)
519
-    {
520
-        s = cString::sprintf("%s\n  Device %d path: %s port: %s Firmware %04d",
521
-                             *s, i,
522
-                             mCECAdapterDescription[0].strComPath,
523
-                             mCECAdapterDescription[0].strComName,
524
-                             mCECAdapterDescription[0].iFirmwareVersion);
525
-    }
526
-
527
-    s = cString::sprintf("%s\n\nActive Devices:", *s);
528
-    cec_logical_addresses devices = mCECAdapter->GetActiveDevices();
529
-    cec_logical_addresses own = mCECAdapter->GetLogicalAddresses();
530
-
531
-    for (int j = 0; j < 16; j++)
532
-    {
533
-        if (devices[j])
534
-        {
535
-            cec_logical_address logical_addres = (cec_logical_address)j;
536
-
537
-            phaddr = mCECAdapter->GetDevicePhysicalAddress(logical_addres);
538
-            name = mCECAdapter->GetDeviceOSDName(logical_addres);
539
-            vendor = (cec_vendor_id)mCECAdapter->GetDeviceVendorId(logical_addres);
540
-
541
-            if (own[j]) {
542
-                s = cString::sprintf("%s\n   %d# %-15.15s@%04x %-15.15s %-14.14s %-15.15s", *s,
543
-                        logical_addres,
544
-                        mCECAdapter->ToString(logical_addres),
545
-                        phaddr, name.name,
546
-                        VDRNAME, VDRNAME);
547
-            }
548
-            else {
549
-                powerstatus = mCECAdapter->GetDevicePowerStatus(logical_addres);
550
-                s = cString::sprintf("%s\n   %d# %-15.15s@%04x %-15.15s %-14.14s %-15.15s %-15.15s", *s,
551
-                        logical_addres,
552
-                        mCECAdapter->ToString(logical_addres),
553
-                        phaddr, name.name,
554
-                        mCECAdapter->GetDeviceOSDName(logical_addres).name,
555
-                        mCECAdapter->ToString(vendor),
556
-                        mCECAdapter->ToString(powerstatus));
557
-            }
558
-        }
559
-    }
560
-    return s;
561
-}
562
-
563
-
564
-/*
565
- * Try to get the logical address for a device. If specified, try to use
566
- * the physical address,
567
- */
568
-cec_logical_address cCECRemote::getLogical(cCECDevice &dev)
569
-{
570
-    if (mCECAdapter == NULL) {
571
-        Esyslog ("getLogical CEC Adapter disconnected");
572
-        return CECDEVICE_UNKNOWN;
573
-    }
574
-    cec_logical_address found = CECDEVICE_UNKNOWN;
575
-    // Logical address already available
576
-    if (dev.mLogicalAddressUsed != CECDEVICE_UNKNOWN) {
577
-        return dev.mLogicalAddressUsed;
578
-    }
579
-    // Try to get logical address from physical address.
580
-    // It may be possible that more than one logical address is available
581
-    // at a physical address!
582
-    if (dev.mPhysicalAddress != 0) {
583
-        cec_logical_addresses devices = mCECAdapter->GetActiveDevices();
584
-        for (int j = 0; j < 16; j++)
585
-        {
586
-            if (devices[j])
587
-            {
588
-                cec_logical_address logical_addres = (cec_logical_address)j;
589
-                if (dev.mPhysicalAddress ==
590
-                        mCECAdapter->GetDevicePhysicalAddress(logical_addres)) {
591
-                    dev.mLogicalAddressUsed = logical_addres;
592
-                    Dsyslog ("Mapping Physical %04x->Logical %d",
593
-                            dev.mPhysicalAddress, logical_addres);
594
-                    found = logical_addres;
595
-                    // Exact match
596
-                    if (dev.mLogicalAddressDefined == logical_addres) {
597
-                        return logical_addres;
598
-                    }
599
-                }
600
-            }
601
-        }
602
-    }
603
-    if (found != CECDEVICE_UNKNOWN) {
604
-        return found;
605
-    }
606
-
607
-    // No mapping available, so try as last attempt the defined logical address,
608
-    // if available.
609
-    if (dev.mLogicalAddressDefined == CECDEVICE_UNKNOWN) {
610
-        Esyslog("No fallback logical address for %04x configured", dev.mPhysicalAddress);
611
-        return CECDEVICE_UNKNOWN;
612
-    }
613
-    // Ensure that we don't send accidentally to the own VDR address.
614
-
615
-    cec_logical_addresses own = mCECAdapter->GetLogicalAddresses();
616
-    if (own[dev.mLogicalAddressDefined]) {
617
-        Esyslog("Logical address of physical %04x is the VDR", dev.mPhysicalAddress);
618
-        return CECDEVICE_UNKNOWN;
619
-    }
620
-    // Check if device is available.
621
-    if (!mCECAdapter->PollDevice(dev.mLogicalAddressDefined)) {
622
-        Esyslog("Logical address not available", dev.mLogicalAddressDefined);
623
-        return CECDEVICE_UNKNOWN;
624
-    }
625
-
626
-    dev.mLogicalAddressUsed = dev.mLogicalAddressDefined;
627
-    return dev.mLogicalAddressDefined;
628
-}
629
-
630
-
631
-void cCECRemote::WaitForPowerStatus(cec_logical_address addr, cec_power_status newstatus)
632
-{
633
-    cec_power_status status;
634
-    int cnt = 0;
635
-    cCondWait w;
636
-
637
-    do {
638
-        w.Wait(100);
639
-        status = mCECAdapter->GetDevicePowerStatus(addr);
640
-        cnt++;
641
-    } while ((status != newstatus) && (cnt < 50) && (status != CEC_POWER_STATUS_UNKNOWN));
642
-}
643
-
644
-/*
645
- * Special exec which handles the svdrp CONN/DISC which may come
646
- * from this executed shell script
647
- */
648
-void cCECRemote::Exec(cCmd &execcmd)
649
-{
650
-    cCmd cmd;
651
-    Dsyslog("Execute script %s", execcmd.mExec.c_str());
652
-    mInExec = true;
653
-    pid_t pid = fork();
654
-    if (pid < 0) {
655
-        Esyslog("fork failed");
656
-        mInExec = false;
657
-        return;
658
-    }
659
-    else if (pid == 0) {
660
-        execl("/bin/sh", "sh", "-c", execcmd.mExec.c_str(), NULL);
661
-        Esyslog("Exec failed");
662
-        abort();
663
-    }
664
-
665
-    do {
666
-        cmd = WaitExec(pid);
667
-        Dsyslog ("(%d) ExecAction %d Val %d",
668
-                 cmd.mSerial, cmd.mCmd, cmd.mVal);
669
-        switch (cmd.mCmd) {
670
-        case CEC_EXIT:
671
-            Dsyslog("cCECRemote script stopped");
672
-            break;
673
-        case CEC_RECONNECT:
674
-            Dsyslog("cCECRemote reconnect");
675
-            Disconnect();
676
-            sleep(1);
677
-            Connect();
678
-            break;
679
-        case CEC_CONNECT:
680
-            Dsyslog("cCECRemote connect");
681
-            Connect();
682
-            break;
683
-        case CEC_DISCONNECT:
684
-            Dsyslog("cCECRemote disconnect");
685
-            Disconnect();
686
-            break;
687
-        default:
688
-            Esyslog("Unexpected action %d Val %d", cmd.mCmd, cmd.mVal);
689
-            break;
690
-        }
691
-        Csyslog ("(%d) Action finished", cmd.mSerial);
692
-        if (cmd.mSerial != -1) {
693
-            mProcessedSerial = cmd.mSerial;
694
-            mCmdReady.Signal();
695
-        }
696
-    } while (cmd.mCmd != CEC_EXIT);
697
-    mInExec = false;
698
-}
699
-/*
700
- * Wait until a command is put into the exec command queue.
701
- * If a command was received remove it and return the received command.
702
- */
703
-cCmd cCECRemote::WaitExec(pid_t pid)
704
-{
705
-    Csyslog("WaitExec");
706
-    int stat_loc = 0;
707
-    mExecQueueMutex.Lock();
708
-    while (mExecQueue.empty()) {
709
-        mExecQueueMutex.Unlock();
710
-        if (mExecQueueWait.Wait(250)) {
711
-            Csyslog("  Signal");
712
-        }
713
-        else {
714
-            if (waitpid (pid, &stat_loc, WNOHANG) == pid) {
715
-                Dsyslog("  Script exit with %d", WEXITSTATUS(stat_loc));
716
-                cCmd cmd(CEC_EXIT);
717
-                return cmd;
718
-            }
719
-        }
720
-        mExecQueueMutex.Lock();
721
-    }
722
-
723
-    cCmd cmd = mExecQueue.front();
724
-    mExecQueue.pop_front();
725
-    mExecQueueMutex.Unlock();
726
-    return cmd;
727
-}
728
-
729
-
730
-/*
731
- * Put a complete command queue into the worker command queue for execution.
732
- */
733
-void cCECRemote::PushCmdQueue(const cCmdQueue &cmdList)
734
-{
735
-    if (mCECAdapter == NULL) {
736
-        Esyslog ("PushCmdQueue CEC Adapter disconnected");
737
-        return;
738
-    }
739
-    mWorkerQueueMutex.Lock();
740
-    for (cCmdQueueIterator i = cmdList.begin();
741
-           i != cmdList.end(); i++) {
742
-        mWorkerQueue.push_back(*i);
743
-    }
744
-    mWorkerQueueMutex.Unlock();
745
-    mWorkerQueueWait.Signal();
746
-}
747
-
748
-/*
749
- * Put a command into the worker command queue for execution.
750
- */
751
-void cCECRemote::PushCmd(const cCmd &cmd)
752
-{
753
-    Csyslog("cCECRemote::PushCmd %d (size %d)", cmd.mCmd, mWorkerQueue.size());
754
-
755
-    mWorkerQueueMutex.Lock();
756
-    mWorkerQueue.push_back(cmd);
757
-    mWorkerQueueMutex.Unlock();
758
-    mWorkerQueueWait.Signal();
759
-}
760
-
761
-/*
762
- * Put a command into the worker command queue and wait for execution.
763
- */
764
-void cCECRemote::PushWaitCmd(cCmd &cmd, int timeout)
765
-{
766
-    int serial = cmd.getSerial();
767
-    cmd.mSerial = serial;
768
-    bool signaled = false;
769
-
770
-    Csyslog("cCECRemote::PushWaitCmd %d ID %d (WQ %d EQ %d)",
771
-            cmd.mCmd, serial, mWorkerQueue.size(), mExecQueue.size());
772
-
773
-    // Special handling for CEC_CONNECT and CEC_DISCONNECT when called
774
-    // from exec state (used for out of band processing of svdrp commands
775
-    // coming from a script, executed by a command queue.
776
-    if (((cmd.mCmd == CEC_CONNECT) || (cmd.mCmd == CEC_DISCONNECT)) && mInExec){
777
-        Csyslog("ExecQueue");
778
-        mExecQueueMutex.Lock();
779
-        mExecQueue.push_back(cmd);
780
-        mExecQueueMutex.Unlock();
781
-        mExecQueueWait.Signal();
782
-    }
783
-    // Normal handling
784
-    else {
785
-        mWorkerQueueMutex.Lock();
786
-        mWorkerQueue.push_back(cmd);
787
-        mWorkerQueueMutex.Unlock();
788
-        mWorkerQueueWait.Signal();
789
-    }
790
-
791
-    // Wait until this command is processed.
792
-    do {
793
-        signaled = mCmdReady.Wait(timeout);
794
-    } while ((mProcessedSerial != serial) && (signaled));
795
-    if (!signaled) {
796
-        Esyslog("cCECRemote::PushWaitCmd timeout %d %d", mProcessedSerial, serial);
797
-    }
798
-    else {
799
-        Csyslog("cCECRemote %d %d", mProcessedSerial, serial);
800
-    }
801
-}
802
-
803
-/*
804
- * Wait until a command is put into the worker command queue.
805
- * If a command was received remove it and return the received command.
806
- */
807
-cCmd cCECRemote::WaitCmd(int timeout)
808
-{
809
-    Csyslog("Wait");
810
-    mWorkerQueueMutex.Lock();
811
-    while (mWorkerQueue.empty()) {
812
-        mWorkerQueueMutex.Unlock();
813
-        if (mWorkerQueueWait.Wait(timeout)) {
814
-            Csyslog("  Signal");
815
-        }
816
-        mWorkerQueueMutex.Lock();
817
-    }
818
-
819
-    cCmd cmd = mWorkerQueue.front();
820
-    mWorkerQueue.pop_front();
821
-    mWorkerQueueMutex.Unlock();
822
-
823
-    return cmd;
824
-}
825
-
826
-void cCECRemote::Reconnect()
827
-{
828
-    Dsyslog("cCECRemote::Reconnect");
829
-    cCmd cmd(CEC_RECONNECT);
830
-    // coming from a script, executed by a command queue.
831
-    if (mInExec) {
832
-        mExecQueueMutex.Lock();
833
-        mExecQueue.push_front(cmd); // Ensure that command is executed ASAP.
834
-        mExecQueueMutex.Unlock();
835
-        mExecQueueWait.Signal();
836
-    }
837
-    else {
838
-        mWorkerQueueMutex.Lock();
839
-        mWorkerQueue.push_front(cmd); // Ensure that command is executed ASAP.
840
-        mWorkerQueueMutex.Unlock();
841
-        mWorkerQueueWait.Signal();
842
-    }
843
-}
844
-
845
-} // namespace cecplugin
846
-

+ 0
- 103
v/vdr-plugin-cecremote-1.4.0/cecremote.h View File

@@ -1,103 +0,0 @@
1
-/*
2
- * CECRemote PlugIn for VDR
3
- *
4
- * Copyright (C) 2015-2016 Ulrich Eckhardt <uli-vdr@uli-eckhardt.de>
5
- *
6
- * This code is distributed under the terms and conditions of the
7
- * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
8
- *
9
- * This class implements the remote receiving and processing the CEC commands.
10
- */
11
-
12
-#ifndef CECREMOTE_H_
13
-#define CECREMOTE_H_
14
-
15
-#include <vdr/plugin.h>
16
-#include <vdr/remote.h>
17
-#include <vdr/thread.h>
18
-#include <vdr/keys.h>
19
-#include <cectypes.h>
20
-#include <cec.h>
21
-#include <stdint.h>
22
-#include <queue>
23
-#include <list>
24
-#include <vector>
25
-#include <map>
26
-#include <string>
27
-
28
-#include "keymaps.h"
29
-#include "cmd.h"
30
-
31
-namespace cecplugin {
32
-
33
-#define MAX_CEC_ADAPTERS 10
34
-
35
-class cPluginCecremote;
36
-class cCECGlobalOptions;
37
-
38
-class cCECRemote : public cRemote, private cThread {
39
-public:
40
-    cCECRemote(const cCECGlobalOptions &options, cPluginCecremote *plugin);
41
-    ~cCECRemote();
42
-    bool Initialize(void) {return false;};
43
-    void PushCmd(const cCmd &cmd);
44
-    void PushCmdQueue(const cCmdQueue &cmdList);
45
-    void PushWaitCmd(cCmd &cmd, int timeout = 5000);
46
-    int getCECLogLevel(void) {return mCECLogLevel;}
47
-    cString ListDevices(void);
48
-    void Reconnect(void);
49
-    void Stop(void);
50
-    void Startup(void);
51
-
52
-    ICECAdapter            *mCECAdapter;
53
-private:
54
-    static const char      *VDRNAME;
55
-    int                    mCECLogLevel;
56
-    int                    mProcessedSerial;
57
-    uint8_t                mDevicesFound;
58
-    uint8_t                mHDMIPort;
59
-    cec_logical_address    mBaseDevice;
60
-    uint32_t               mComboKeyTimeoutMs;
61
-    libcec_configuration   mCECConfig;
62
-    ICECCallbacks          mCECCallbacks;
63
-    cec_adapter_descriptor mCECAdapterDescription[MAX_CEC_ADAPTERS];
64
-
65
-    // Queue for normal worker thread
66
-    cMutex                 mWorkerQueueMutex;
67
-    cCondWait              mWorkerQueueWait;
68
-    cCmdQueue              mWorkerQueue;
69
-
70
-    // Queue for special commands when shell script is executed
71
-    cMutex                 mExecQueueMutex;
72
-    cCondWait              mExecQueueWait;
73
-    cCmdQueue              mExecQueue;
74
-
75
-    cCondWait              mCmdReady;
76
-    deviceTypeList         mDeviceTypes;
77
-    bool                   mShutdownOnStandby;
78
-    bool                   mPowerOffOnStandby;
79
-    bool                   mInExec;
80
-    cPluginCecremote       *mPlugin;
81
-
82
-    void Connect(void);
83
-    void Disconnect(void);
84
-    void ActionKeyPress(cCmd &cmd);
85
-    void Action(void);
86
-    void CECCommand(const cCmd &cmd);
87
-    cCmd WaitCmd(int timeout = 5000);
88
-    cCmd WaitExec(pid_t pid);
89
-    void Exec(cCmd &cmd);
90
-    void ExecToggle(cCECDevice dev, const cCmdQueue &poweron,
91
-                    const cCmdQueue &poweroff);
92
-    void WaitForPowerStatus(cec_logical_address addr, cec_power_status newstatus);
93
-    bool TextViewOn(cec_logical_address address);
94
-    cec_logical_address getLogical(cCECDevice &dev);
95
-
96
-    cCmdQueue mOnStart;
97
-    cCmdQueue mOnStop;
98
-    cCmdQueue mOnManualStart;
99
-};
100
-
101
-} // namespace cecplugin
102
-
103
-#endif /* CECREMOTE_H_ */

+ 0
- 299
v/vdr-plugin-cecremote-1.4.0/cecremoteplugin.cc View File

@@ -1,299 +0,0 @@
1
-/*
2
- * CECRemote PlugIn for VDR
3
- *
4
- * Copyright (C) 2015-2016 Ulrich Eckhardt <uli-vdr@uli-eckhardt.de>
5
- *
6
- * This code is distributed under the terms and conditions of the
7
- * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
8
- *
9
- * This class implements the main VDR plugin code.
10
- */
11
-
12
-
13
-#include <getopt.h>
14
-#include <stdlib.h>
15
-
16
-#include "cecremoteplugin.h"
17
-#include "ceclog.h"
18
-#include "cecosd.h"
19
-#include "stringtools.h"
20
-#include "keymaps.h"
21
-#include "configmenu.h"
22
-#include "rtcwakeup.h"
23
-
24
-namespace cecplugin {
25
-
26
-static const char *VERSION        = "1.4.0";
27
-static const char *DESCRIPTION    = "Send/Receive CEC commands";
28
-static const char *MAINMENUENTRY  = "CECremote";
29
-
30
-using namespace std;
31
-
32
-cPluginCecremote::cPluginCecremote(void) :
33
-        mCfgDir("cecremote"), mCfgFile("cecremote.xml"), mStatusMonitor(NULL),
34
-        mStartManually(true)
35
-{
36
-    mCECLogLevel = CEC_LOG_ERROR | CEC_LOG_WARNING | CEC_LOG_DEBUG;
37
-    mCECRemote = NULL;
38
-}
39
-
40
-cPluginCecremote::~cPluginCecremote()
41
-{
42
-    if (mCECRemote != NULL) {
43
-        delete mCECRemote;
44
-        mCECRemote = NULL;
45
-    }
46
-    if (mStatusMonitor != NULL) {
47
-        delete mStatusMonitor;
48
-        mStatusMonitor = NULL;
49
-    }
50
-}
51
-
52
-const char *cPluginCecremote::Version(void)
53
-{
54
-    return VERSION;
55
-}
56
-
57
-const char *cPluginCecremote::Description(void)
58
-{
59
-    return DESCRIPTION;
60
-}
61
-
62
-const char *cPluginCecremote::MainMenuEntry(void)
63
-{
64
-    if (cConfigMenu::GetShowMainMenu()) {
65
-        return tr(MAINMENUENTRY);
66
-    }
67
-    return NULL;
68
-}
69
-
70
-const char *cPluginCecremote::CommandLineHelp(void)
71
-{
72
-    return "-c  --configdir <dir>     Directory for config files : cecremote\n"
73
-           "-x  --configfile <file>   Config file : cecremote.xml";
74
-}
75
-
76
-bool cPluginCecremote::ProcessArgs(int argc, char *argv[])
77
-{
78
-    static struct option long_options[] =
79
-    {
80
-            { "configdir",      required_argument, NULL, 'c' },
81
-            { "configfile",     required_argument, NULL, 'x' },
82
-            { NULL }
83
-    };
84
-    int c, option_index = 0;
85
-
86
-    while ((c = getopt_long(argc, argv, "c:x:",
87
-            long_options, &option_index)) != -1) {
88
-        switch (c) {
89
-        case 'c':
90
-            mCfgDir.assign(optarg);
91
-            break;
92
-        case 'x':
93
-            mCfgFile.assign(optarg);
94
-            break;
95
-        default:
96
-            Esyslog("CECRemotePlugin unknown option %c", c);
97
-            return false;
98
-        }
99
-    }
100
-
101
-    return true;
102
-}
103
-
104
-bool cPluginCecremote::Initialize(void)
105
-{
106
-    string file = GetConfigFile();
107
-    rtcwakeup::RTC_WAKEUP_TYPE rtcwakeup = rtcwakeup::RTC_ERROR;
108
-
109
-    if (!mConfigFileParser.Parse(file, mKeyMaps)) {
110
-        Esyslog("Error on parsing config file file %s", file.c_str());
111
-        return false;
112
-    }
113
-    mCECLogLevel = mConfigFileParser.mGlobalOptions.cec_debug;
114
-    if (mConfigFileParser.mGlobalOptions.mRTCDetect) {
115
-        Dsyslog("Use RTC wakeup detection");
116
-        rtcwakeup = rtcwakeup::check();
117
-        mStartManually = (rtcwakeup != rtcwakeup::RTC_WAKEUP);
118
-    }
119
-    // Either rtc wakeup is disabled or not available, so fall back
120
-    // to "old" manual start detection
121
-    if (rtcwakeup == rtcwakeup::RTC_ERROR) {
122
-        Dsyslog("Use VDR wakeup detection: Next Wakeup %d",
123
-                Setup.NextWakeupTime);
124
-        if (Setup.NextWakeupTime > 0) {
125
-            // 600 comes from vdr's MANUALSTART constant in vdr.c
126
-            if (abs(Setup.NextWakeupTime - time(NULL)) < 600) {
127
-                mStartManually = false;
128
-            }
129
-        }
130
-    }
131
-    if (mStartManually) {
132
-        Dsyslog("manual start");
133
-    }
134
-    else {
135
-        Dsyslog("timed start");
136
-    }
137
-    mCECRemote = new cCECRemote(mConfigFileParser.mGlobalOptions, this);
138
-
139
-    SetDefaultKeymaps();
140
-    return true;
141
-}
142
-
143
-bool cPluginCecremote::Start(void)
144
-{
145
-    mCECRemote->Startup();
146
-    mStatusMonitor = new cStatusMonitor(this);
147
-    return true;
148
-}
149
-
150
-void cPluginCecremote::Stop(void)
151
-{
152
-    Dsyslog("Stop Plugin");
153
-    delete mStatusMonitor;
154
-    mStatusMonitor = NULL;
155
-    mCECRemote->Stop();
156
-    delete mCECRemote;
157
-    mCECRemote = NULL;
158
-}
159
-
160
-void cPluginCecremote::Housekeeping(void)
161
-{
162
-    // Perform any cleanup or other regular tasks.
163
-}
164
-
165
-void cPluginCecremote::MainThreadHook(void)
166
-{
167
-    // Perform actions in the context of the main program thread.
168
-    // WARNING: Use with great care - see PLUGINS.html!
169
-}
170
-
171
-cString cPluginCecremote::Active(void)
172
-{
173
-    // Return a message string if shutdown should be postponed
174
-    return NULL;
175
-}
176
-
177
-time_t cPluginCecremote::WakeupTime(void)
178
-{
179
-    // Return custom wakeup time for shutdown script
180
-    return 0;
181
-}
182
-
183
-void cPluginCecremote::StartPlayer(const cCECMenu &menuitem)
184
-{
185
-    // If no <stillpic> is used, execute only onStart section
186
-    if (menuitem.mStillPic.empty()) {
187
-        Isyslog("Executing: %s", menuitem.mMenuTitle.c_str());
188
-        if (menuitem.isMenuPowerToggle()) {
189
-            ExecToggle(menuitem);
190
-        }
191
-        else {
192
-            PushCmdQueue(menuitem.mOnStart);
193
-        }
194
-    }
195
-    // otherwise start a new player
196
-    else {
197
-        Isyslog("starting player: %s", menuitem.mMenuTitle.c_str());
198
-        cControl::Launch(new cCECControl(menuitem, this));
199
-        cControl::Attach();
200
-    }
201
-}
202
-
203
-cOsdObject *cPluginCecremote::MainMenuAction(void)
204
-{
205
-    if (cCECOsd::mMenuItems.size() == 1) {
206
-        StartPlayer(cCECOsd::mMenuItems[0]);
207
-        return NULL;
208
-    }
209
-    return new cCECOsd(this);
210
-}
211
-
212
-cMenuSetupPage *cPluginCecremote::SetupMenu(void)
213
-{
214
-    return new cConfigMenu();
215
-}
216
-
217
-bool cPluginCecremote::SetupParse(const char *Name, const char *Value)
218
-{
219
-    // Parse your own setup parameters and store their values.
220
-    return cConfigMenu::SetupParse(Name, Value);
221
-}
222
-
223
-bool cPluginCecremote::Service(const char *Id, void *Data)
224
-{
225
-    // Handle custom service requests from other plugins
226
-    return false;
227
-}
228
-
229
-const char **cPluginCecremote::SVDRPHelpPages(void)
230
-{
231
-    static const char *HelpPages[] = {
232
-            "LSTK\nList known CEC keycodes\n",
233
-            "LSTD\nList CEC devices\n",
234
-            "KEYM\nList available key map\n",
235
-            "VDRK [id]\nDisplay VDR->CEC key map with id\n",
236
-            "CECK [id]\nDisplay CEC->VDR key map with id\n",
237
-            "DISC\nDisconnect CEC",
238
-            "CONN\nConnect CEC",
239
-            NULL
240
-    };
241
-    return HelpPages;
242
-}
243
-
244
-cString cPluginCecremote::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode)
245
-{
246
-    ReplyCode = 214;
247
-    if (strcasecmp(Command, "LSTD") == 0) {
248
-        return mCECRemote->ListDevices();
249
-    }
250
-    else if (strcasecmp(Command, "KEYM") == 0) {
251
-        return mKeyMaps.ListKeymaps();
252
-    }
253
-    else if (strcasecmp(Command, "LSTK") == 0) {
254
-        return mKeyMaps.ListKeycodes();
255
-    }
256
-    else if (strcasecmp(Command, "VDRK") == 0) {
257
-        if (Option == NULL) {
258
-            ReplyCode = 901;
259
-            return "Error: Keymap ID required";
260
-        }
261
-        string s = Option;
262
-        return mKeyMaps.ListVDRKeyMap(s);
263
-    }
264
-    else if (strcasecmp(Command, "CECK") == 0) {
265
-        if (Option == NULL) {
266
-            ReplyCode = 901;
267
-            return "Error: Keymap ID required";
268
-        }
269
-        string s = Option;
270
-        return mKeyMaps.ListCECKeyMap(s);
271
-    }
272
-    else if (strcasecmp(Command, "DISC") == 0) {
273
-        cCmd cmd(CEC_DISCONNECT);
274
-        mCECRemote->PushWaitCmd(cmd);
275
-        return "Disconnected";
276
-    }
277
-    else if (strcasecmp(Command, "CONN") == 0) {
278
-        cCmd cmd(CEC_CONNECT);
279
-        mCECRemote->PushWaitCmd(cmd);
280
-        return "Connected";
281
-    }
282
-
283
-    ReplyCode = 901;
284
-    return "Error: Unexpected option";
285