remoteosd-1.0.0/0000755000000000000000000000000012154436020012204 5ustar rootrootremoteosd-1.0.0/menu.h0000644000000000000000000000207212140030355013316 0ustar rootroot/* * menu.h: displays the remote OSD * * See the README file for copyright information and how to reach the author. */ #ifndef _REMOTEOSD_MENU__H #define _REMOTEOSD_MENU__H #include #include #include #include #include "svdrpservice.h" class cRemoteOsdMenu: public cOsdMenu { private: cPlugin *plugin; SvdrpConnection_v1_0 svdrp; cString title; cString message; cString red; cString green; cString yellow; cString blue; cString text; bool isEmpty; bool plugOsd; bool CmdCHAN(cChannel *Channel); bool CmdHITK(const char *Key); bool CmdLSTO(); bool CmdOSDT(); bool CmdOSDI(); bool CmdOSDH(); bool CmdOSDM(); bool CmdOSDX(); int CheckState(); bool UpdateMenu(); protected: virtual void Clear(); public: cRemoteOsdMenu(const char *Title); virtual ~cRemoteOsdMenu(); bool Open(const char *ServerIp, unsigned short ServerPort, const char *Key); virtual void Display(); virtual eOSState ProcessKey(eKeys Key); }; #endif //_REMOTEOSD_MENU__H remoteosd-1.0.0/po/0000755000000000000000000000000012154436017012630 5ustar rootrootremoteosd-1.0.0/po/it_IT.po0000644000000000000000000000267612154436017014213 0ustar rootroot# VDR plugin language source file. # Copyright (C) 2007 Klaus Schmidinger # This file is distributed under the same license as the VDR package. # msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-05-01 00:08+0200\n" "PO-Revision-Date: 2009-08-25 01:00+0100\n" "Last-Translator: Diego Pierotto \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-15\n" "Content-Transfer-Encoding: 8bit\n" msgid "Remote OSD already in use. Proceed anyway?" msgstr "OSD remoto giŕ in esecuzione. Continuare?" msgid "Show menu of a remote VDR" msgstr "Mostra menu VDR remoto" msgid "Remote menu" msgstr "Menu remoto" msgid "Remote menu not available. Connection failed." msgstr "Menu remoto non disponibile. Connessione fallita." msgid "Hide mainmenu entry" msgstr "Nascondi voce menu principale" msgid "Replace mainmenu \"Schedule\"" msgstr "Sostituisci \"Programmi\" nel menu principale" msgid "Replace mainmenu \"Timers\"" msgstr "Sostituisci \"Timer\" nel menu principale" msgid "Server IP" msgstr "IP server" msgid "Server port" msgstr "Porta server" msgid "from svdrpservice" msgstr "da svdrpservice" msgid "Tune server channel" msgstr "Sintonizza canale server" msgid "Number of lines per page" msgstr "Numero di righe per pagina" msgid "Remote menu theme" msgstr "Tema menu remoto" remoteosd-1.0.0/po/sk_SK.po0000755000000000000000000000305712154436017014212 0ustar rootroot# VDR remoteosd plugin language source file. # Copyright (C) 2013 Frank Schmirler # This file is distributed under the same license as the VDR remoteosd package. # Milan Hrala , 2013 # msgid "" msgstr "" "Project-Id-Version: vdr-remoteosd 0.1.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-05-01 00:08+0200\n" "PO-Revision-Date: 2013-03-13 00:33+0100\n" "Last-Translator: Milan Hrala \n" "Language-Team: Slovak\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-2\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: Slovak\n" "X-Poedit-Country: SLOVAKIA\n" msgid "Remote OSD already in use. Proceed anyway?" msgstr "Vzdialené OSD sa už používa. Napriek tomu pokračovať?" msgid "Show menu of a remote VDR" msgstr "Zobraziť menu na vzdialenom VDR" msgid "Remote menu" msgstr "Vzdialené menu" msgid "Remote menu not available. Connection failed." msgstr "Vzdialené menu nie je dostupné. Pripojenie zlyhalo." msgid "Hide mainmenu entry" msgstr "Schovať v hlavnom menu" msgid "Replace mainmenu \"Schedule\"" msgstr "Zameniť v hlavnom menu \"TV program\"" msgid "Replace mainmenu \"Timers\"" msgstr "Zameniť v hlavnom menu \"Plány nahrávania\"" msgid "Server IP" msgstr "IP servera" msgid "Server port" msgstr "Port servera" msgid "from svdrpservice" msgstr "zo svdrpservice" msgid "Tune server channel" msgstr "" msgid "Number of lines per page" msgstr "Počet riadkov na stranu" msgid "Remote menu theme" msgstr "Téma vzdialeného menu" remoteosd-1.0.0/po/de_DE.po0000644000000000000000000000270012154436017014127 0ustar rootroot# VDR plugin language source file. # Copyright (C) 2007 Klaus Schmidinger # This file is distributed under the same license as the VDR package. # msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-05-01 00:08+0200\n" "PO-Revision-Date: 2009-08-25 00:55+0200\n" "Last-Translator: Frank Schmirler \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-15\n" "Content-Transfer-Encoding: 8bit\n" msgid "Remote OSD already in use. Proceed anyway?" msgstr "Menü bereits in Benutzung. Dennoch fortfahren?" msgid "Show menu of a remote VDR" msgstr "Zugriff auf Menü eines anderen VDR" msgid "Remote menu" msgstr "Server Menü" msgid "Remote menu not available. Connection failed." msgstr "Server Menü nicht verfügbar. Verbindung fehlgeschlagen." msgid "Hide mainmenu entry" msgstr "Hauptmenüeintrag verstecken" msgid "Replace mainmenu \"Schedule\"" msgstr "Hauptmenü \"Programm\" ersetzen" msgid "Replace mainmenu \"Timers\"" msgstr "Hauptmenü \"Timer\" ersetzen" msgid "Server IP" msgstr "Server IP" msgid "Server port" msgstr "Server Port" msgid "from svdrpservice" msgstr "aus svdrpservice" msgid "Tune server channel" msgstr "Kanal auf Server umstellen" msgid "Number of lines per page" msgstr "Zeilen pro Bildschirmseite" msgid "Remote menu theme" msgstr "Thema für entferntes Menü" remoteosd-1.0.0/Makefile0000664000175000017500000000614412140030573014137 0ustar frankfrank# # Makefile for a Video Disk Recorder plugin # # $Id$ # The official name of this plugin. # This name will be used in the '-P...' option of VDR to load the plugin. # By default the main source file also carries this name. PLUGIN = remoteosd ### The version number of this plugin (taken from the main source file): VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') ### The directory environment: # Use package data if installed...otherwise assume we're under the VDR source directory: PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc)) LIBDIR = $(call PKGCFG,libdir) LOCDIR = $(call PKGCFG,locdir) PLGCFG = $(call PKGCFG,plgcfg) # TMPDIR ?= /tmp ### The compiler options: export CFLAGS = $(call PKGCFG,cflags) export CXXFLAGS = $(call PKGCFG,cxxflags) ### The version number of VDR's plugin API: APIVERSION = $(call PKGCFG,apiversion) ### Allow user defined options to overwrite defaults: -include $(PLGCFG) ### The name of the distribution archive: ARCHIVE = $(PLUGIN)-$(VERSION) PACKAGE = vdr-$(ARCHIVE) ### The name of the shared object file: SOFILE = libvdr-$(PLUGIN).so ### Includes and Defines (add further entries here): INCLUDES += DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' ### The object files (add further files here): OBJS = $(PLUGIN).o menu.o setup.o ### The main target: all: $(SOFILE) i18n ### Implicit rules: %.o: %.c $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $< ### Dependencies: MAKEDEP = $(CXX) -MM -MG DEPFILE = .dependencies $(DEPFILE): Makefile @$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ -include $(DEPFILE) ### Internationalization (I18N): PODIR = po I18Npo = $(wildcard $(PODIR)/*.po) I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file)))) I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) I18Npot = $(PODIR)/$(PLUGIN).pot %.mo: %.po msgfmt -c -o $@ $< $(I18Npot): $(wildcard *.c) xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='' -o $@ `ls $^` %.po: $(I18Npot) msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $< @touch $@ $(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo install -D -m644 $< $@ .PHONY: i18n i18n: $(I18Nmo) $(I18Npot) install-i18n: $(I18Nmsgs) ### Targets: $(SOFILE): $(OBJS) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@ install-lib: $(SOFILE) install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION) install: install-lib install-i18n dist: $(I18Npo) clean @-rm -rf $(TMPDIR)/$(ARCHIVE) @mkdir $(TMPDIR)/$(ARCHIVE) @cp -a * $(TMPDIR)/$(ARCHIVE) @tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE) @-rm -rf $(TMPDIR)/$(ARCHIVE) @echo Distribution package created as $(PACKAGE).tgz clean: @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ remoteosd-1.0.0/COPYING0000644000000000000000000004313111763744461013261 0ustar rootroot GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. remoteosd-1.0.0/HISTORY0000644000000000000000000000302112154435710013271 0ustar rootrootVDR Plugin 'remoteosd' Revision History --------------------------------------- 2013-06-07: Version 1.0.0 - Added service call to open remote menu - Updated Makefile for VDR 1.7.36 and dropped compatibility with older VDR versions - Added SetMenuCategory for VDR 1.7.28+ - Added Slovak translation (thanks to Milan Hrala) - Included a copy of svdrpservice.h - Updated MainMenuHooks patch (thanks to Manuel Reimer) - README now mentions the new VDR default port and the possibility to pass server IP and port as parameter to svdrpservice. - Updated SVDRP port. Default is now 0 (i.e. use svdrpservice). 2011-09-20: Version 0.1.1 - Updated MainMenuHooks patch to v1.0.1 - SetTitle must not be called with NULL argument (thanks to Manfred Heindl) 2009-10-07: Version 0.1.0 - if available, use svdrposd-plugin instead of svdrpext-plugin - added gettext support (thanks to Diego Pierotto) Credits to Udo Richter for his po218n.pl backward compatibility script - added Italian translation (thanks to Diego Pierotto) - log error if svdrpservice or svdrpext/svdrposd are not installed - replaced all occurences of asprintf - fixed not parsing replace mainmenu settings 2007-03-07: Version 0.0.2 - New option: tune channel on server - Support for MainMenuHooks patch. Plugin may replace the VDR mainmenus Schedule and Timers - Close remote menu when the local menu has been closed by menu key - OSD message if server is not reachable - Support for svdrpservice-0.0.3 default IP/port - Code cleanup 2006-06-01: Version 0.0.1 - Initial revision. remoteosd-1.0.0/remoteosd.h0000644000000000000000000000254312142542042014361 0ustar rootroot/* * remotetimers.h: Public interface of the plugin's services * * Copyright (C) 2013 Frank Schmirler * * This file is part of VDR Plugin remoteosd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html */ #ifndef _REMOTEOSD_SERVICE__H #define _REMOTEOSD_SERVICE__H #include /* * RemoteOsd::Menu-v1.0 * Open the menu of VDR at serverIp and serverPort, sending the specified key. * If key is NULL, key "MENU" is used. */ struct RemoteOsd_Menu_v1_0 { //in const char *serverIp; unsigned short serverPort; const char *key; //out cOsdMenu *menu; }; #endif //_REMOTEOSD_SERVICE__H remoteosd-1.0.0/README0000644000000000000000000001233412140033540013062 0ustar rootrootThis is a "plugin" for the Video Disk Recorder (VDR). Written by: Frank Schmirler Project's homepage: http://vdr.schmirler.de/ Latest version available at: http://vdr.schmirler.de/ See the file COPYING for license information. Description: ------------ Display the menu of a remote VDR as submenu item of your local VDR menu. Requirements: ------------- Local (client) VDR: - plugin remoteosd - plugin svdrpservice Remote (server) VDR: - plugin svdrposd (formerly svdrpext, which is also supported) All three plugins are available at http://vdr.schmirler.de Installation on client VDR: --------------------------- Straightforward: - cd VDR/PLUGINS/src - tar xzf vdr-remoteosd-.tgz - ln -sf remoteosd- remoteosd If you want to replace the VDR mainmenus "Schedule" or "Timers" by the respective remote menus, you must apply the MainMenuHooks patch to VDR before compiling remoteosd. The MainMenuHooks patch is included in the patches directory of the remoteosd sources. See the patch file for more information and instructions. Now compile and install remoteosd (and svdrpservice) as usual and add both plugins to the script starting your VDR (e.g. runvdr). No options required, so simply append: -P remoteosd -P svdrpservice Since svdrpservice-0.0.4 you can already specify the server IP and port on the commandline. It will then serve as the default for all plugins using svdrpservice: -P remoteosd -P 'svdrpservice 192.0.2.1:6419' Finally check the file svdrphosts.conf on the remote VDR: The IP of the VDR running remoteosd must be listed or otherwise the connection will be refused. Installation on server VDR: --------------------------- Just about the same: - cd VDR/PLUGINS/src - tar xzf vdr-svdrposd-.tgz - ln -sf svdrposd- svdrposd Compile, install and add the following parameter to the startup script: -Psvdrposd Check your svdrphosts.conf file: The clients must be listed or otherwise the SVDRP connection will be refused. Configuration: -------------- Before you can connect you have to configure the IP address of the remote VDR, unless your svdrpservice plugin has been told about a default IP. The remoteosd setup menu offers the following options: - Hide mainmenu entry Keeps your girl friend off the server menu ;-) - Replace mainmenu "Schedule" When enabled, each call to the local VDR Schedule menu will give you the remote Schedule menu instead. Only available if MainMenuHooks patch has been applied to VDR before compiling remoteosd. - Replace mainmenu "Timers" Dito for Timers menu. - Server IP IP address of SVDRP server. Leave empty or enter 0.0.0.0 if you want to use the default IP configured in the svdrpservice plugin. - Server port SVDRP port on server. Since VDR 1.7.15 the default port is 6419, before it was 2001. The special value 0 uses the default port configured in svdrpservice. - Tune server channel Tries to tune the server to the same channel the client is currently viewing. So when entering e.g. the remote schedules menu, the expected channel will be highlighted. Usually this option makes sense only if you are running a headless server. In this case I recommend to install the dummydevice plugin on the server. Otherwise the server might not be able to switch channels as expected. - Number of lines per page This parameter controls how a long list of items is split into pages. The special value 0 uses the client's idea of the OSD size. However the server OSD size determines how many items you skip when hitting a "Page Up/Down" key. You might want to adjust the number of lines if client and server have different OSD sizes. If the client can display more items than the server, you should enter the server's size. If however the server can show more items, you should consider to reduce its OSD size in menu Setup -> OSD. - Remote menu theme Some skins support themes. If you want to avoid ambiguities, remoteosd can use a different theme while you're in the remote menu. As the new theme is loaded while the OSD menu is open, not all colors of the new theme might show up. It depends on the way the actual skin implements themes. The ST:TNG theme for example will not change the color of the frame. It's not a bug... ----------------- Limitations of the VDR SVDRP interface - An SVDRP connection is used to retrieve the OSD status of the remote VDR. Currently, SVDRP cannot interact with multiple clients at a time. As long as the SVDRP port on the server is busy, the remoteosd client will not work. The menu will be closed after a short timeout. The other way round, remoteosd will block the SVDRP port as long as its menu is open. The SVDRP connection will be established whenever you open the remoteosd mainmenu entry and it will be closed when leaving it. - VDR polls for new SVDRP connections about once every second. You will notice a delay of up to one second until the menu will show up. Limitations of the VDR status interface - Viewing a schedule entry, you will only see the text body. VDR does not export the corresponding title and subtitle. - The status interface doesn't tell you if an item is selectable or not. Therefore serverside scrolling is required (which is slow) and on the client you don't get the different color for non-selectable items. remoteosd-1.0.0/setup.c0000644000000000000000000000542512140040363013512 0ustar rootroot/* * remoteosd.c: A plugin for the Video Disk Recorder * * See the README file for copyright information and how to reach the author. * * $Id$ */ #include #include #include #include "setup.h" cRemoteOsdSetup RemoteOsdSetup; cRemoteOsdSetup::cRemoteOsdSetup() { hideMainMenuEntry = 0; replaceSchedule = 0; replaceTimers = 0; serverIp[0] = 0; serverPort = 0; tuneServer = 0; maxItems = 0; remoteTheme[0] = 0; } cRemoteOsdSetup& cRemoteOsdSetup::operator=(const cRemoteOsdSetup &Setup) { hideMainMenuEntry = Setup.hideMainMenuEntry; replaceSchedule = Setup.replaceSchedule; replaceTimers = Setup.replaceTimers; strn0cpy(serverIp, Setup.serverIp, sizeof(serverIp)); serverPort = Setup.serverPort; tuneServer = Setup.tuneServer; maxItems = Setup.maxItems; strn0cpy(remoteTheme, Setup.remoteTheme, sizeof(remoteTheme)); return *this; } void cRemoteOsdMenuSetup::Store() { setupTmp.remoteTheme[0] = 0; if (themeIndex > 0) strn0cpy(setupTmp.remoteTheme, themes.Name(themeIndex - 1), sizeof(setupTmp.remoteTheme)); SetupStore("HideMainMenuEntry", setupTmp.hideMainMenuEntry); SetupStore("ReplaceSchedule", setupTmp.replaceSchedule); SetupStore("ReplaceTimers", setupTmp.replaceTimers); SetupStore("ServerIp", setupTmp.serverIp); SetupStore("ServerPort", setupTmp.serverPort); SetupStore("TuneServer", setupTmp.tuneServer); SetupStore("MaxItems", setupTmp.maxItems); SetupStore("RemoteTheme", setupTmp.remoteTheme); RemoteOsdSetup = setupTmp; } cRemoteOsdMenuSetup::cRemoteOsdMenuSetup() { setupTmp = RemoteOsdSetup; themes.Load(Skins.Current()->Name()); int numThemes = themes.NumThemes(); const char* const* descriptions = themes.Descriptions(); themeList = MALLOC(const char*, numThemes + 1); themeIndex = 0; themeList[0] = strdup(""); for (int i = 0; i < themes.NumThemes(); i++) { themeList[i + 1] = descriptions[i]; if (strcmp(setupTmp.remoteTheme, themes.Name(i)) == 0) themeIndex = i + 1; } Add(new cMenuEditBoolItem(tr("Hide mainmenu entry"), &setupTmp.hideMainMenuEntry)); #ifdef MAINMENUHOOKSVERSNUM Add(new cMenuEditBoolItem(tr("Replace mainmenu \"Schedule\""), &setupTmp.replaceSchedule)); Add(new cMenuEditBoolItem(tr("Replace mainmenu \"Timers\""), &setupTmp.replaceTimers)); #endif Add(new cMenuEditStrItem(tr("Server IP"), setupTmp.serverIp, 15, ".1234567890")); Add(new cMenuEditIntItem(tr("Server port"), &setupTmp.serverPort, 0, 65535, tr("from svdrpservice"))); Add(new cMenuEditBoolItem(tr("Tune server channel"), &setupTmp.tuneServer)); Add(new cMenuEditIntItem(tr("Number of lines per page"), &setupTmp.maxItems, 0)); Add(new cMenuEditStraItem(tr("Remote menu theme"), &themeIndex, numThemes + 1, themeList)); } cRemoteOsdMenuSetup::~cRemoteOsdMenuSetup() { free((void *) themeList[0]); free(themeList); } remoteosd-1.0.0/patches/0000755000000000000000000000000011763744461013653 5ustar rootrootremoteosd-1.0.0/patches/MainMenuHooks-v1_0_2.diff0000644000000000000000000001534411763744461020215 0ustar rootrootThis is a "patch" for the Video Disk Recorder (VDR). * History 2012-04-06: Version 1.0.2 - Update für aktuelle VDR-Entwickler-Versionen (Manuel Reimer) 2010-10-15: Version 1.0.1 - return a cOsdObject instead of its subclass cOsdMenu (thanks to Joe_D@vdrportal) - version number defines in config.h now follow the ususal conventions: MAINMENUHOOKSVERSNUM is now a number, the newly added define MAINMENUHOOKSVERSION is a string (suggested by gnapheus@vdrportal) - patch is now based on VDR 1.6.0 - updated documentation 2007-02-26: Version 1.0 - Initial revision. * Authors: Tobias Grimm Martin Prochnow Frank Schmirler Christian Wieninger * Description: This patch allows plugins to replace the VDR mainmenus "Schedule", "Channels", "Timers" and "Recordings" by a different implementation. The patch is based on a suggestion of Christian Wieninger back in 2006 (http://www.linuxtv.org/pipermail/vdr/2006-March/008234.html). It is meant to be an interim solution for VDR 1.4 until (maybe) VDR 1.5 introduces an official API for this purpose. * Installation Change into the VDR source directory, then issue patch -p1 < path/to/MainMenuHooks-v1_0_1.patch and recompile. * Notes for plugin authors The following code sample shows the required plugin code for replacing the original Schedule menu: bool cMyPlugin::Service(const char *Id, void *Data) { cOsdMenu **menu = (cOsdMenu**) Data; if (MySetup.replaceSchedule && strcmp(Id, "MainMenuHooksPatch-v1.0::osSchedule") == 0) { if (menu) *menu = (cOsdMenu*) MainMenuAction(); return true; } return false; } Since patch version 1.0.1 the service call may return a cOsdObject instead of a cOsdMenu. Use "#ifdef MAINMENUHOOKSVERSION" to detect version 1.0.1. A plugin can replace more than one menu at a time. Simply replace the call to MainMenuAction() in the sample above by appropriate code. Note that a plugin *should* offer a setup option which allows the user to enable or disable the replacement. "Disabled" would be a reasonable default setting. By testing for define MAINMENUHOOKSVERSNUM, a plugin can leave the setup option out at compiletime. In case there is an internal problem when trying to open the replacement menu, it is safe to return true even though Data is NULL. However an OSD message should indicate the problem to the user. Feel free to ship this patch along with your plugin. However if you think you need to modify the patch, we'd encourage you to contact the authors first or at least use a service id which differs in more than just the version number. diff -ru vdr-1.6.0.orig/menu.c vdr-1.6.0/menu.c --- vdr-1.6.0.orig/menu.c 2008-03-16 12:15:28.000000000 +0100 +++ vdr-1.6.0/menu.c 2010-10-11 20:32:25.000000000 +0200 @@ -2973,15 +2973,31 @@ // Initial submenus: + cOsdObject *menu = NULL; switch (State) { - case osSchedule: AddSubMenu(new cMenuSchedule); break; - case osChannels: AddSubMenu(new cMenuChannels); break; - case osTimers: AddSubMenu(new cMenuTimers); break; - case osRecordings: AddSubMenu(new cMenuRecordings(NULL, 0, true)); break; - case osSetup: AddSubMenu(new cMenuSetup); break; - case osCommands: AddSubMenu(new cMenuCommands(tr("Commands"), &Commands)); break; + case osSchedule: + if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osSchedule", &menu)) + menu = new cMenuSchedule; + break; + case osChannels: + if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osChannels", &menu)) + menu = new cMenuChannels; + break; + case osTimers: + if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osTimers", &menu)) + menu = new cMenuTimers; + break; + case osRecordings: + if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osRecordings", &menu)) + menu = new cMenuRecordings(NULL, 0, true); + break; + case osSetup: menu = new cMenuSetup; break; + case osCommands: menu = new cMenuCommands(tr("Commands"), &Commands); break; default: break; } + if (menu) + if (menu->IsMenu()) + AddSubMenu((cOsdMenu *) menu); } cOsdObject *cMenuMain::PluginOsdObject(void) @@ -3096,13 +3112,34 @@ eOSState state = cOsdMenu::ProcessKey(Key); HadSubMenu |= HasSubMenu(); + cOsdObject *menu = NULL; switch (state) { - case osSchedule: return AddSubMenu(new cMenuSchedule); - case osChannels: return AddSubMenu(new cMenuChannels); - case osTimers: return AddSubMenu(new cMenuTimers); - case osRecordings: return AddSubMenu(new cMenuRecordings); - case osSetup: return AddSubMenu(new cMenuSetup); - case osCommands: return AddSubMenu(new cMenuCommands(tr("Commands"), &Commands)); + case osSchedule: + if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osSchedule", &menu)) + menu = new cMenuSchedule; + else + state = osContinue; + break; + case osChannels: + if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osChannels", &menu)) + menu = new cMenuChannels; + else + state = osContinue; + break; + case osTimers: + if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osTimers", &menu)) + menu = new cMenuTimers; + else + state = osContinue; + break; + case osRecordings: + if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osRecordings", &menu)) + menu = new cMenuRecordings; + else + state = osContinue; + break; + case osSetup: menu = new cMenuSetup; break; + case osCommands: menu = new cMenuCommands(tr("Commands"), &Commands); break; case osStopRecord: if (Interface->Confirm(tr("Stop recording?"))) { cOsdItem *item = Get(Current()); if (item) { @@ -3154,6 +3191,12 @@ default: break; } } + if (menu) { + if (menu->IsMenu()) + return AddSubMenu((cOsdMenu *) menu); + pluginOsdObject = menu; + return osPlugin; + } if (!HasSubMenu() && Update(HadSubMenu)) Display(); if (Key != kNone) { diff -ru vdr-1.6.0.orig/config.h vdr-1.6.0/config.h --- vdr-1.6.0.orig/config.h 2008-03-23 11:26:10.000000000 +0100 +++ vdr-1.6.0/config.h 2010-10-11 20:32:25.000000000 +0200 @@ -36,3 +36,7 @@ // plugins to work with newer versions of the core VDR as long as no // VDR header files have changed. + +// The MainMenuHook Patch's version number: +#define MAINMENUHOOKSVERSION "1.0.1" +#define MAINMENUHOOKSVERSNUM 10001 // Version * 10000 + Major * 100 + Minor remoteosd-1.0.0/setup.h0000644000000000000000000000154111763744461013536 0ustar rootroot/* * setup.h: Settings * * See the README file for copyright information and how to reach the author. */ #ifndef _REMOTEOSD_SETUP__H #define _REMOTEOSD_SETUP__H #include #include #define MAX_IP_LENGTH 16 struct cRemoteOsdSetup { int hideMainMenuEntry; int replaceSchedule; int replaceTimers; char serverIp[MAX_IP_LENGTH]; int serverPort; int tuneServer; int maxItems; char remoteTheme[MaxThemeName]; cRemoteOsdSetup& operator=(const cRemoteOsdSetup &Setup); cRemoteOsdSetup(); }; extern cRemoteOsdSetup RemoteOsdSetup; class cRemoteOsdMenuSetup: public cMenuSetupPage { private: cRemoteOsdSetup setupTmp; cThemes themes; int themeIndex; const char ** themeList; protected: virtual void Store(void); public: cRemoteOsdMenuSetup(); virtual ~cRemoteOsdMenuSetup(); }; #endif //_REMOTEOSD_SETUP__H remoteosd-1.0.0/svdrpservice.h0000644000000000000000000000132312140030355015067 0ustar rootroot/* * svdrpservice.h: Public interface of the plugin's services * * See the README file for copyright information and how to reach the author. */ #ifndef _SVDRPSERVICE__H #define _SVDRPSERVICE__H #include class cLine: public cListObject { private: char *Line; public: const char *Text() { return Line; } cLine(const char *s) { Line = s ? strdup(s) : NULL; }; virtual ~cLine() { if (Line) free(Line); }; }; struct SvdrpConnection_v1_0 { //in+out cString serverIp; unsigned short serverPort; //in bool shared; //in+out int handle; }; struct SvdrpCommand_v1_0 { //in cString command; int handle; //out cList reply; unsigned short responseCode; }; #endif //_SVDRPSERVICE__H remoteosd-1.0.0/menu.c0000644000000000000000000002275112140031322013312 0ustar rootroot#include #include #include #include #include #include #include #include #include #include "menu.h" #include "setup.h" #define PLUG_EXT "PLUG svdrpext " #define PLUG_OSD "PLUG svdrposd " #define SVDRP_SERVER_TIMEOUT_MS 10 #define RC_OK 920 #define RC_NA 930 cRemoteOsdMenu::cRemoteOsdMenu(const char *Title): cOsdMenu(Title) { SetMenuCategory(mcPlugin); plugin = cPluginManager::GetPlugin("svdrpservice"); isEmpty = true; plugOsd = true; if (*RemoteOsdSetup.remoteTheme) cThemes::Load(Skins.Current()->Name(), RemoteOsdSetup.remoteTheme, Skins.Current()->Theme()); } cRemoteOsdMenu::~cRemoteOsdMenu() { if (plugin && svdrp.handle >= 0) { // probably MENU key has been hit - close remote menu if (!isEmpty) CmdHITK("MENU"); // close SVDRP connection plugin->Service("SvdrpConnection-v1.0", &svdrp); } if (*RemoteOsdSetup.remoteTheme) cThemes::Load(Skins.Current()->Name(), Setup.OSDTheme, Skins.Current()->Theme()); } bool cRemoteOsdMenu::Open(const char *ServerIp, unsigned short ServerPort, const char *Key) { if (!plugin) { esyslog("remoteosd: svdrpservice-plugin required but not available"); return false; } // Get the connection svdrp.serverIp = ServerIp; svdrp.serverPort = ServerPort; svdrp.shared = true; svdrp.handle = -1; plugin->Service("SvdrpConnection-v1.0", &svdrp); if (svdrp.handle < 0) return false; // Close remote OSD if necessary int state; for (int i = 1; (state = CheckState()) != RC_NA; i++) { if (state != RC_OK) // error occured return false; if (i == 1 && !Interface->Confirm(tr("Remote OSD already in use. Proceed anyway?"))) return false; else if (i > 2) { esyslog("remoteosd: Cannot close remote menu"); return false; } if (!CmdHITK("MENU")) return false; } if (RemoteOsdSetup.tuneServer) { cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel()); CmdCHAN(channel); } // Now open the remote menu if (CmdHITK(Key) && CheckState() == RC_OK) return UpdateMenu(); return false; } int cRemoteOsdMenu::CheckState() { SvdrpCommand_v1_0 cmd; // assume the OSD is empty if there is no title cmd.command = cString(plugOsd ? PLUG_OSD "OSDT\r\n" : PLUG_EXT "OSDT\r\n"); cmd.handle = svdrp.handle; plugin->Service("SvdrpCommand-v1.0", &cmd); if (cmd.responseCode == 550) { if (plugOsd) { // no svdrposd-plugin - fallback to svdrpext-plugin plugOsd = false; return CheckState(); } else { esyslog("remoteosd: svdrposd-plugin not installed on %s", *svdrp.serverIp); } } return cmd.responseCode; } bool cRemoteOsdMenu::CmdCHAN(cChannel *Channel) { SvdrpCommand_v1_0 cmd; cmd.command = cString::sprintf("CHAN %s\r\n", *Channel->GetChannelID().ToString()); cmd.handle = svdrp.handle; plugin->Service("SvdrpCommand-v1.0", &cmd); return cmd.responseCode == 250; } bool cRemoteOsdMenu::CmdHITK(const char* Key) { SvdrpCommand_v1_0 cmd; cmd.command = cString::sprintf("HITK %s\r\n", Key); cmd.handle = svdrp.handle; plugin->Service("SvdrpCommand-v1.0", &cmd); // A timeout in cFile::AnyFileReady defines how long the // server will now wait for more SVDRP commands before // it actually processes our HITK command cCondWait::SleepMs(SVDRP_SERVER_TIMEOUT_MS); return cmd.responseCode == 250; } bool cRemoteOsdMenu::CmdLSTO() { int maxItems = RemoteOsdSetup.maxItems; // special value 0: use local maxItems if (maxItems == 0) maxItems = DisplayMenu()->MaxItems(); SvdrpCommand_v1_0 cmd; cmd.command = cString::sprintf(PLUG_OSD "LSTO %d\r\n", maxItems); cmd.handle = svdrp.handle; plugin->Service("SvdrpCommand-v1.0", &cmd); int cols[cSkinDisplayMenu::MaxTabs]; int currentCol = 0; memset(&cols, 0, sizeof(cols)); switch (cmd.responseCode) { case RC_OK: for (cLine *line = cmd.reply.First(); line; line = cmd.reply.Next(line)) { const char *s = line->Text(); if (strlen(s) > 2) { switch (*s) { case 'T': title = cString::sprintf("%s: %s", *svdrp.serverIp, s + 2); isEmpty = false; break; case 'C': if (currentCol < cSkinDisplayMenu::MaxTabs) cols[currentCol++] = strtol(s + 2, NULL, 10); break; case 'I': Add(new cOsdItem(s + 2)); isEmpty = false; break; case 'S': Add(new cOsdItem(s + 2), true); isEmpty = false; break; case 'R': red = s + 2; break; case 'G': green = s + 2; break; case 'Y': yellow = s + 2; break; case 'B': blue = s + 2; break; case 'M': message = cString::sprintf("%s: %s", *svdrp.serverIp, s + 2); break; case 'X': { char* t = strdup(s + 2); strreplace(t, '|', '\n'); text = cString(t, true); isEmpty = false; } break; default: esyslog("remoteosd: unexpected reply type '%c'", *s); break; } } } SetTitle(*title ? title : svdrp.serverIp); SetCols(cols[0], cols[1], cols[2], cols[3], cols[4]); SetHelp(red, green, yellow, blue); SetStatus(message); break; case RC_NA: break; default: return false; } return true; } bool cRemoteOsdMenu::CmdOSDT() { SvdrpCommand_v1_0 cmd; cLine *line; cmd.command = cString(plugOsd ? PLUG_OSD "OSDT\r\n" : PLUG_EXT "OSDT\r\n"); cmd.handle = svdrp.handle; plugin->Service("SvdrpCommand-v1.0", &cmd); switch (cmd.responseCode) { case RC_OK: line = cmd.reply.First(); title = cString::sprintf("%s: %s", *svdrp.serverIp, line->Text()); isEmpty = false; break; case RC_NA: title = svdrp.serverIp; break; default: return false; } SetTitle(title); return true; } bool cRemoteOsdMenu::CmdOSDI() { int maxItems = RemoteOsdSetup.maxItems; // special value 0: use local maxItems if (maxItems == 0) maxItems = DisplayMenu()->MaxItems(); SvdrpCommand_v1_0 cmd; cmd.command = cString::sprintf(PLUG_EXT "OSDI %d\r\n", maxItems); cmd.handle = svdrp.handle; plugin->Service("SvdrpCommand-v1.0", &cmd); int cols[cSkinDisplayMenu::MaxTabs]; int currentCol = 0; memset(&cols, 0, sizeof(cols)); switch (cmd.responseCode) { case RC_OK: for (cLine *line = cmd.reply.First(); line; line = cmd.reply.Next(line)) { const char *s = line->Text(); if (strlen(s) > 2) { switch (*s) { case 'C': if (currentCol < cSkinDisplayMenu::MaxTabs) cols[currentCol++] = strtol(s + 2, NULL, 10); break; case 'I': Add(new cOsdItem(s + 2)); break; case 'S': Add(new cOsdItem(s + 2), true); break; } } } SetCols(cols[0], cols[1], cols[2], cols[3], cols[4]); isEmpty = false; break; case RC_NA: break; default: return false; } return true; } bool cRemoteOsdMenu::CmdOSDH() { SvdrpCommand_v1_0 cmd; cmd.command = cString(PLUG_EXT "OSDH\r\n"); cmd.handle = svdrp.handle; plugin->Service("SvdrpCommand-v1.0", &cmd); switch (cmd.responseCode) { case RC_OK: for (cLine *line = cmd.reply.First(); line; line = cmd.reply.Next(line)) { const char *s = line->Text(); if (strlen(s) > 2) { switch (*s) { case 'R': red = s + 2; break; case 'G': green = s + 2; break; case 'Y': yellow = s + 2; break; case 'B': blue = s + 2; break; } } } isEmpty = false; break; case RC_NA: break; default: return false; } SetHelp(red, green, yellow, blue); return true; } bool cRemoteOsdMenu::CmdOSDM() { SvdrpCommand_v1_0 cmd; cLine *line; cmd.command = cString(PLUG_EXT "OSDM\r\n"); cmd.handle = svdrp.handle; plugin->Service("SvdrpCommand-v1.0", &cmd); switch (cmd.responseCode) { case RC_OK: line = cmd.reply.First(); message = cString::sprintf("%s: %s", *svdrp.serverIp, line->Text()); break; case RC_NA: break; default: return false; } SetStatus(message); return true; } bool cRemoteOsdMenu::CmdOSDX() { SvdrpCommand_v1_0 cmd; cLine *line; cmd.command = cString(PLUG_EXT "OSDX\r\n"); cmd.handle = svdrp.handle; plugin->Service("SvdrpCommand-v1.0", &cmd); switch (cmd.responseCode) { case RC_OK: { line = cmd.reply.First(); char* t = strdup(line->Text()); strreplace(t, '|', '\n'); text = cString(t, true); isEmpty = false; } break; case RC_NA: break; default: return false; } return true; } bool cRemoteOsdMenu::UpdateMenu() { Clear(); if (plugOsd) { if (!CmdLSTO()) return false; } else { if (!CmdOSDT() || !CmdOSDM() || !CmdOSDH() || !CmdOSDI()) return false; // Check for text only if no item is shown if (Count() == 0 && !CmdOSDX()) return false; } Display(); return true; } void cRemoteOsdMenu::Clear() { cOsdMenu::Clear(); title = NULL; message = NULL; text = NULL; red = NULL; green = NULL; yellow = NULL; blue = NULL; isEmpty = true; } void cRemoteOsdMenu::Display(void) { cOsdMenu::Display(); if (*text) { DisplayMenu()->SetText(text, true); cStatus::MsgOsdTextItem(text); } } eOSState cRemoteOsdMenu::ProcessKey(eKeys Key) { if (Key == kNone) return osContinue; //TODO: Update menu e.g. once per second if (Key & k_Release) return osContinue; if (*text) { switch (Key) { case kUp|k_Repeat: case kUp: case kDown|k_Repeat: case kDown: case kLeft|k_Repeat: case kLeft: case kRight|k_Repeat: case kRight: DisplayMenu()->Scroll(NORMALKEY(Key) == kUp || NORMALKEY(Key) == kLeft, NORMALKEY(Key) == kLeft || NORMALKEY(Key) == kRight); cStatus::MsgOsdTextItem(NULL, NORMALKEY(Key) == kUp); return osContinue; default: break; } } if (CmdHITK(cKey::ToString(RAWKEY(Key))) && UpdateMenu()) return isEmpty ? osBack : osContinue; return osBack; } remoteosd-1.0.0/remoteosd.c0000644000000000000000000001320612154436015014357 0ustar rootroot/* * remoteosd.c: A plugin for the Video Disk Recorder * * See the README file for copyright information and how to reach the author. * * $Id$ */ #include #include #include #include #include #include #include "remoteosd.h" #include "menu.h" #include "setup.h" static const char *VERSION = "1.0.0"; static const char *DESCRIPTION = trNOOP("Show menu of a remote VDR"); static const char *MAINMENUENTRY = trNOOP("Remote menu"); class cPluginRemoteOsd : public cPlugin { private: // Add any member variables or functions you may need here. public: cPluginRemoteOsd(void); virtual ~cPluginRemoteOsd(); virtual const char *Version(void) { return VERSION; } virtual const char *Description(void) { return tr(DESCRIPTION); } virtual const char *CommandLineHelp(void); virtual bool ProcessArgs(int argc, char *argv[]); virtual bool Initialize(void); virtual bool Start(void); virtual void Stop(void); virtual void Housekeeping(void); virtual const char *MainMenuEntry(void) { return RemoteOsdSetup.hideMainMenuEntry ? NULL : tr(MAINMENUENTRY); } virtual cOsdObject *MainMenuAction(void); virtual cMenuSetupPage *SetupMenu(void); virtual bool SetupParse(const char *Name, const char *Value); virtual bool Service(const char *Id, void *Data = NULL); virtual const char **SVDRPHelpPages(void); virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode); }; cPluginRemoteOsd::cPluginRemoteOsd(void) { // Initialize any member variables here. // DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT! } cPluginRemoteOsd::~cPluginRemoteOsd() { // Clean up after yourself! } const char *cPluginRemoteOsd::CommandLineHelp(void) { // Return a string that describes all known command line options. return NULL; } bool cPluginRemoteOsd::ProcessArgs(int argc, char *argv[]) { // Implement command line argument processing here if applicable. return true; } bool cPluginRemoteOsd::Initialize(void) { // Initialize any background activities the plugin shall perform. return true; } bool cPluginRemoteOsd::Start(void) { // Start any background activities the plugin shall perform. return true; } void cPluginRemoteOsd::Stop(void) { // Stop any background activities the plugin shall perform. } void cPluginRemoteOsd::Housekeeping(void) { // Perform any cleanup or other regular tasks. } cOsdObject *cPluginRemoteOsd::MainMenuAction(void) { cRemoteOsdMenu *menu = new cRemoteOsdMenu(tr(MAINMENUENTRY)); if (!menu->Open(RemoteOsdSetup.serverIp, (unsigned short) RemoteOsdSetup.serverPort, "MENU")) { DELETENULL(menu); Skins.Message(mtError, tr("Remote menu not available. Connection failed.")); } return menu; } cMenuSetupPage *cPluginRemoteOsd::SetupMenu(void) { return new cRemoteOsdMenuSetup(); } bool cPluginRemoteOsd::SetupParse(const char *Name, const char *Value) { if (!strcasecmp(Name, "HideMainMenuEntry")) RemoteOsdSetup.hideMainMenuEntry = atoi(Value); else if (!strcasecmp(Name, "ReplaceSchedule")) RemoteOsdSetup.replaceSchedule = atoi(Value); else if (!strcasecmp(Name, "ReplaceTimers")) RemoteOsdSetup.replaceTimers = atoi(Value); else if (!strcasecmp(Name, "ServerIp")) strn0cpy(RemoteOsdSetup.serverIp, Value, sizeof(RemoteOsdSetup.serverIp)); else if (!strcasecmp(Name, "ServerPort")) RemoteOsdSetup.serverPort = atoi(Value); else if (!strcasecmp(Name, "TuneServer")) RemoteOsdSetup.tuneServer = atoi(Value); else if (!strcasecmp(Name, "MaxItems")) RemoteOsdSetup.maxItems = atoi(Value); else if (!strcasecmp(Name, "RemoteTheme")) strn0cpy(RemoteOsdSetup.remoteTheme, Value, sizeof(RemoteOsdSetup.remoteTheme)); else return false; return true; } bool cPluginRemoteOsd::Service(const char *Id, void *Data) { // Handle custom service requests from other plugins if (strcmp(Id, "RemoteOsd::Menu-v1.0") == 0) { if (Data) { RemoteOsd_Menu_v1_0 *data = (RemoteOsd_Menu_v1_0 *) Data; cRemoteOsdMenu *remoteMenu = new cRemoteOsdMenu(data->serverIp); if (!remoteMenu->Open(data->serverIp, data->serverPort, data->key ? data->key : "MENU")) { DELETENULL(remoteMenu); Skins.Message(mtError, tr("Remote menu not available. Connection failed.")); } data->menu = remoteMenu; } return true; } /* * MainMenuHooks */ cRemoteOsdMenu **menu = (cRemoteOsdMenu**) Data; if (RemoteOsdSetup.replaceSchedule && strcmp(Id, "MainMenuHooksPatch-v1.0::osSchedule") == 0) { if (menu) { *menu = new cRemoteOsdMenu(RemoteOsdSetup.serverIp); if (!(*menu)->Open(RemoteOsdSetup.serverIp, (unsigned short) RemoteOsdSetup.serverPort, "SCHEDULE")) { DELETENULL(*menu); Skins.Message(mtError, tr("Remote menu not available. Connection failed.")); } } return true; } if (RemoteOsdSetup.replaceTimers && strcmp(Id, "MainMenuHooksPatch-v1.0::osTimers") == 0) { if (menu) { *menu = new cRemoteOsdMenu(RemoteOsdSetup.serverIp); if (!(*menu)->Open(RemoteOsdSetup.serverIp, (unsigned short) RemoteOsdSetup.serverPort, "TIMERS")) { DELETENULL(*menu); Skins.Message(mtError, tr("Remote menu not available. Connection failed.")); } } return true; } return false; } const char **cPluginRemoteOsd::SVDRPHelpPages(void) { // Return help text for SVDRP commands this plugin implements return NULL; }; cString cPluginRemoteOsd::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode) { // Process SVDRP commands this plugin implements return NULL; } VDRPLUGINCREATOR(cPluginRemoteOsd); // Don't touch this!