diff options
author | Frank Schmirler <vdr@schmirler.de> | 2010-12-02 09:48:23 +0100 |
---|---|---|
committer | Frank Schmirler <vdr@schmirler.de> | 2010-12-02 09:48:23 +0100 |
commit | 11b22d9f33d50f20cba1eaee2aadb55d3580d879 (patch) | |
tree | 5c4e7fe1046bd9cc1ef7a7b21abe118f43689902 /client | |
parent | 435f01649c2ee8c23c21e0680d0a39e773008549 (diff) | |
download | vdr-plugin-streamdev-11b22d9f33d50f20cba1eaee2aadb55d3580d879.tar.gz vdr-plugin-streamdev-11b22d9f33d50f20cba1eaee2aadb55d3580d879.tar.bz2 |
Streamdev 0.5.0-rc1
Diffstat (limited to 'client')
-rw-r--r-- | client/Makefile | 84 | ||||
-rw-r--r-- | client/device.c | 14 | ||||
-rw-r--r-- | client/po/de_DE.po | 50 | ||||
-rw-r--r-- | client/po/fi_FI.po | 50 | ||||
-rw-r--r-- | client/po/fr_FR.po | 50 | ||||
-rw-r--r-- | client/po/it_IT.po | 52 | ||||
-rw-r--r-- | client/po/lt_LT.po | 50 | ||||
-rw-r--r-- | client/po/ru_RU.po | 50 | ||||
-rw-r--r-- | client/po/sk_SK.po | 52 | ||||
-rw-r--r-- | client/setup.c | 20 | ||||
-rw-r--r-- | client/setup.h | 5 | ||||
-rw-r--r-- | client/socket.c | 48 | ||||
-rw-r--r-- | client/socket.h | 3 | ||||
-rw-r--r-- | client/streamdev-client.c | 55 | ||||
-rw-r--r-- | client/streamdev-client.h | 28 |
15 files changed, 539 insertions, 72 deletions
diff --git a/client/Makefile b/client/Makefile new file mode 100644 index 0000000..8c3e565 --- /dev/null +++ b/client/Makefile @@ -0,0 +1,84 @@ +# +# Makefile for a Video Disk Recorder plugin +# +# $Id: Makefile,v 1.1.2.1 2010/06/14 10:40:11 schmirl Exp $ + +# 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 = streamdev-client + +### Includes and Defines (add further entries here): + +DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' + +### The object files (add further files here): + +COMMONOBJS = ../common.o + +CLIENTOBJS = $(PLUGIN).o \ + device.o filter.o setup.o socket.o + +### The main target: + +.PHONY: all i18n dist clean +all: libvdr-$(PLUGIN).so i18n + +### Implicit rules: + +%.o: %.c + $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $< + +### Dependencies: + +MAKEDEP = $(CXX) -MM -MG +DEPFILE = .dependencies + +$(DEPFILE): Makefile + @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(CLIENTOBJS:%.o=%.c) $(COMMONOBJS:%.o=%.c) > $@ + +-include $(DEPFILE) + +### Internationalization (I18N): + +PODIR = po +LOCALEDIR = $(VDRDIR)/locale +I18Npo = $(wildcard $(PODIR)/*.po) +I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) +I18Npot = $(PODIR)/$(PLUGIN).pot + +%.mo: %.po + msgfmt -c -o $@ $< + +$(I18Npot): $(CLIENTOBJS:%.o=%.c) + xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<http://www.vdr-developer.org/mantisbt/>' -o $@ $^ + +%.po: $(I18Npot) + msgmerge -U --no-wrap --no-location --backup=none -q $@ $< + @touch $@ + +$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo + @mkdir -p $(dir $@) + cp $< $@ + +i18n: $(I18Nmsgs) + +### Targets: + +libvdr-$(PLUGIN).so: $(CLIENTOBJS) $(COMMONOBJS) ../tools/sockettools.a + +%.so: + $(CXX) $(CXXFLAGS) -shared $^ -o $@ + @cp $@ $(LIBDIR)/$@.$(APIVERSION) + +dist: clean + @-rm -rf $(TMPDIR)/$(ARCHIVE) + @mkdir $(TMPDIR)/$(ARCHIVE) + @cp -a * $(TMPDIR)/$(ARCHIVE) + @tar czf $(PACKAGE).tgz --exclude CVS -C $(TMPDIR) $(ARCHIVE) + @-rm -rf $(TMPDIR)/$(ARCHIVE) + @echo Distribution package created as $(PACKAGE).tgz + +clean: + @-rm -f $(COMMONOBJS) $(CLIENTOBJS) $(DEPFILE) $(PODIR)/*.mo $(PODIR)/*.pot *.so *.tgz core* *~ diff --git a/client/device.c b/client/device.c index 4b6c3c5..d53bde1 100644 --- a/client/device.c +++ b/client/device.c @@ -1,5 +1,5 @@ /* - * $Id: device.c,v 1.23 2009/04/06 06:48:59 schmirl Exp $ + * $Id: device.c,v 1.26 2010/06/08 05:55:17 schmirl Exp $ */ #include "client/device.h" @@ -33,9 +33,6 @@ cStreamdevDevice::cStreamdevDevice(void) { m_Device = this; m_Pids = 0; m_DvrClosed = true; - - if (StreamdevClientSetup.SyncEPG) - ClientSocket.SynchronizeEPG(); } cStreamdevDevice::~cStreamdevDevice() { @@ -72,7 +69,9 @@ bool cStreamdevDevice::IsTunedToTransponder(const cChannel *Channel) { bool res = false; if (ClientSocket.DataSocket(siLive) != NULL - && TRANSPONDER(Channel, m_Channel)) + && TRANSPONDER(Channel, m_Channel) + && Channel->Ca() == CA_FTA + && m_Channel->Ca() == CA_FTA) res = true; return res; } @@ -123,12 +122,11 @@ bool cStreamdevDevice::SetChannelDevice(const cChannel *Channel, if (LiveView) return false; -#if 0 if (ClientSocket.DataSocket(siLive) != NULL && TRANSPONDER(Channel, m_Channel) - && Channel->Ca() < CA_ENCRYPTED_MIN) + && Channel->Ca() == CA_FTA + && m_Channel->Ca() == CA_FTA) return true; -#endif DetachAllReceivers(); m_Channel = Channel; diff --git a/client/po/de_DE.po b/client/po/de_DE.po new file mode 100644 index 0000000..1e481a2 --- /dev/null +++ b/client/po/de_DE.po @@ -0,0 +1,50 @@ +# VDR streamdev plugin language source file. +# Copyright (C) 2008 streamdev development team. See http://streamdev.vdr-developer.org +# This file is distributed under the same license as the VDR streamdev package. +# Frank Schmirler <vdrdev@schmirler.de>, 2008 +# +msgid "" +msgstr "" +"Project-Id-Version: streamdev 0.5.0\n" +"Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n" +"POT-Creation-Date: 2010-06-14 13:05+0200\n" +"PO-Revision-Date: 2008-03-30 02:11+0200\n" +"Last-Translator: Frank Schmirler <vdrdev@schmirler.de>\n" +"Language-Team: <vdr@linuxtv.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "VTP Streaming Client" +msgstr "VTP Streaming Client" + +msgid "Suspend Server" +msgstr "Server pausieren" + +msgid "Server is suspended" +msgstr "Server ist pausiert" + +msgid "Couldn't suspend Server!" +msgstr "Konnte Server nicht pausieren!" + +msgid "Hide Mainmenu Entry" +msgstr "Hauptmenüeintrag verstecken" + +msgid "Start Client" +msgstr "Client starten" + +msgid "Remote IP" +msgstr "IP der Gegenseite" + +msgid "Remote Port" +msgstr "Port der Gegenseite" + +msgid "Filter Streaming" +msgstr "Filter-Daten streamen" + +msgid "Minimum Priority" +msgstr "Minimale Priorität" + +msgid "Maximum Priority" +msgstr "Maximale Priorität" + diff --git a/client/po/fi_FI.po b/client/po/fi_FI.po new file mode 100644 index 0000000..2091680 --- /dev/null +++ b/client/po/fi_FI.po @@ -0,0 +1,50 @@ +# VDR streamdev plugin language source file. +# Copyright (C) 2008 streamdev development team. See http://streamdev.vdr-developer.org +# This file is distributed under the same license as the VDR streamdev package. +# Rolf Ahrenberg <rahrenbe@cc.hut.fi>, 2008 +# +msgid "" +msgstr "" +"Project-Id-Version: streamdev 0.5.0\n" +"Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n" +"POT-Creation-Date: 2010-06-14 13:05+0200\n" +"PO-Revision-Date: 2008-03-30 02:11+0200\n" +"Last-Translator: Rolf Ahrenberg <rahrenbe@cc.hut.fi>\n" +"Language-Team: <vdr@linuxtv.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "VTP Streaming Client" +msgstr "VTP-suoratoistoasiakas" + +msgid "Suspend Server" +msgstr "Pysäytä palvelin" + +msgid "Server is suspended" +msgstr "Palvelin on pysäytetty" + +msgid "Couldn't suspend Server!" +msgstr "Palvelinta ei onnistuttu pysäyttämään!" + +msgid "Hide Mainmenu Entry" +msgstr "Piilota valinta päävalikosta" + +msgid "Start Client" +msgstr "Käynnistä VDR-asiakas" + +msgid "Remote IP" +msgstr "Etäkoneen IP-osoite" + +msgid "Remote Port" +msgstr "Etäkoneen portti" + +msgid "Filter Streaming" +msgstr "Suodatetun tiedon suoratoisto" + +msgid "Minimum Priority" +msgstr "Pienin prioriteetti" + +msgid "Maximum Priority" +msgstr "Suurin prioriteetti" + diff --git a/client/po/fr_FR.po b/client/po/fr_FR.po new file mode 100644 index 0000000..5c3e756 --- /dev/null +++ b/client/po/fr_FR.po @@ -0,0 +1,50 @@ +# VDR streamdev plugin language source file. +# Copyright (C) 2008 streamdev development team. See http://streamdev.vdr-developer.org +# This file is distributed under the same license as the VDR streamdev package. +# Frank Schmirler <vdrdev@schmirler.de>, 2008 +# +msgid "" +msgstr "" +"Project-Id-Version: streamdev 0.5.0\n" +"Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n" +"POT-Creation-Date: 2010-06-14 13:05+0200\n" +"PO-Revision-Date: 2008-03-30 02:11+0200\n" +"Last-Translator: micky979 <micky979@free.fr>\n" +"Language-Team: <vdr@linuxtv.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "VTP Streaming Client" +msgstr "Client de streaming VTP" + +msgid "Suspend Server" +msgstr "Suspendre le serveur" + +msgid "Server is suspended" +msgstr "Le serveur est suspendu" + +msgid "Couldn't suspend Server!" +msgstr "Impossible de suspendre le serveur!" + +msgid "Hide Mainmenu Entry" +msgstr "Masquer dans le menu principal" + +msgid "Start Client" +msgstr "Démarrage du client" + +msgid "Remote IP" +msgstr "Adresse IP du serveur" + +msgid "Remote Port" +msgstr "Port du serveur" + +msgid "Filter Streaming" +msgstr "Filtre streaming" + +msgid "Minimum Priority" +msgstr "" + +msgid "Maximum Priority" +msgstr "" + diff --git a/client/po/it_IT.po b/client/po/it_IT.po new file mode 100644 index 0000000..068be7c --- /dev/null +++ b/client/po/it_IT.po @@ -0,0 +1,52 @@ +# VDR streamdev plugin language source file. +# Copyright (C) 2008 streamdev development team. See http://streamdev.vdr-developer.org +# This file is distributed under the same license as the VDR streamdev package. +# Alberto Carraro <bertocar@tin.it>, 2001 +# Antonio Ospite <ospite@studenti.unina.it>, 2003 +# Sean Carlos <seanc@libero.it>, 2005 +# +msgid "" +msgstr "" +"Project-Id-Version: streamdev 0.5.0\n" +"Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n" +"POT-Creation-Date: 2010-06-14 13:05+0200\n" +"PO-Revision-Date: 2008-04-13 23:42+0100\n" +"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n" +"Language-Team: <vdr@linuxtv.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "VTP Streaming Client" +msgstr "Client trasmissione VTP" + +msgid "Suspend Server" +msgstr "Sospendi Server" + +msgid "Server is suspended" +msgstr "Server sospeso" + +msgid "Couldn't suspend Server!" +msgstr "Impossibile sospendere il server!" + +msgid "Hide Mainmenu Entry" +msgstr "Nascondi voce menu principale" + +msgid "Start Client" +msgstr "Avvia Client" + +msgid "Remote IP" +msgstr "Indirizzo IP del Server" + +msgid "Remote Port" +msgstr "Porta Server Remoto" + +msgid "Filter Streaming" +msgstr "Filtra trasmissione" + +msgid "Minimum Priority" +msgstr "" + +msgid "Maximum Priority" +msgstr "" + diff --git a/client/po/lt_LT.po b/client/po/lt_LT.po new file mode 100644 index 0000000..f6a7d5c --- /dev/null +++ b/client/po/lt_LT.po @@ -0,0 +1,50 @@ +# VDR streamdev plugin language source file. +# Copyright (C) 2008 streamdev development team. See http://streamdev.vdr-developer.org +# This file is distributed under the same license as the VDR streamdev package. +# Frank Schmirler <vdrdev@schmirler.de>, 2008 +# +msgid "" +msgstr "" +"Project-Id-Version: streamdev 0.5.0\n" +"Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n" +"POT-Creation-Date: 2010-06-14 13:05+0200\n" +"PO-Revision-Date: 2009-11-26 21:57+0200\n" +"Last-Translator: Valdemaras Pipiras <varas@ambernet.lt>\n" +"Language-Team: Lietuvių\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "VTP Streaming Client" +msgstr "VTP transliavimo standartas" + +msgid "Suspend Server" +msgstr "Sustabdyti serverį" + +msgid "Server is suspended" +msgstr "Serveris sustabdytas" + +msgid "Couldn't suspend Server!" +msgstr "Negali sustabdyti serverio!" + +msgid "Hide Mainmenu Entry" +msgstr "PaslÄ—pti pagrindinio meniu įrašą" + +msgid "Start Client" +msgstr "Paleisti klientÄ…" + +msgid "Remote IP" +msgstr "Nuotolinis IP adresas" + +msgid "Remote Port" +msgstr "Nuotolinis portas" + +msgid "Filter Streaming" +msgstr "Filtruoti transliavimÄ…" + +msgid "Minimum Priority" +msgstr "Minimalus prioritetas" + +msgid "Maximum Priority" +msgstr "Maksimalus prioritetas" + diff --git a/client/po/ru_RU.po b/client/po/ru_RU.po new file mode 100644 index 0000000..c09d3f1 --- /dev/null +++ b/client/po/ru_RU.po @@ -0,0 +1,50 @@ +# VDR streamdev plugin language source file. +# Copyright (C) 2008 streamdev development team. See http://streamdev.vdr-developer.org +# This file is distributed under the same license as the VDR streamdev package. +# Frank Schmirler <vdrdev@schmirler.de>, 2008 +# +msgid "" +msgstr "" +"Project-Id-Version: streamdev 0.5.0\n" +"Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n" +"POT-Creation-Date: 2010-06-14 13:05+0200\n" +"PO-Revision-Date: 2008-06-26 15:36+0100\n" +"Last-Translator: Oleg Roitburd <oleg@roitburd.de>\n" +"Language-Team: <vdr@linuxtv.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-5\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "VTP Streaming Client" +msgstr "VTP Streaming ÚÛØÕÝâ" + +msgid "Suspend Server" +msgstr "¾áâÐÝÞÒØâì áÕàÒÕà" + +msgid "Server is suspended" +msgstr "ÁÕàÒÕà ÞáâÐÝÞÒÛÕÝ" + +msgid "Couldn't suspend Server!" +msgstr "ÝÕ ÜÞÓã ÞáâÐÝÞÒØâì áÕàÒÕà" + +msgid "Hide Mainmenu Entry" +msgstr "ÁßàïâÐâì Ò ÓÛÐÒÝÞÜ ÜÕÝî" + +msgid "Start Client" +msgstr "ÁâÐàâ ÚÛØÕÝâÐ" + +msgid "Remote IP" +msgstr "ÃÔÐÛÕÝÝëÙ IP" + +msgid "Remote Port" +msgstr "ÃÔÐÛÕÝÝëÙ ßÞàâ" + +msgid "Filter Streaming" +msgstr "ÄØÛìâà ßÞâÞÚÐ" + +msgid "Minimum Priority" +msgstr "" + +msgid "Maximum Priority" +msgstr "" + diff --git a/client/po/sk_SK.po b/client/po/sk_SK.po new file mode 100644 index 0000000..e3dbf6b --- /dev/null +++ b/client/po/sk_SK.po @@ -0,0 +1,52 @@ +# VDR streamdev plugin language source file. +# Copyright (C) 2009 streamdev development team. See http://streamdev.vdr-developer.org +# This file is distributed under the same license as the VDR streamdev package. +# Milan Hrala <hrala.milan@gmail.com>, 2009 +# +msgid "" +msgstr "" +"Project-Id-Version: streamdev_SK\n" +"Report-Msgid-Bugs-To: <http://www.vdr-developer.org/mantisbt/>\n" +"POT-Creation-Date: 2010-06-14 13:05+0200\n" +"PO-Revision-Date: \n" +"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n" +"Language-Team: Slovak <hrala.milan@gmail.com>\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 "VTP Streaming Client" +msgstr "VTP prúdový klient" + +msgid "Suspend Server" +msgstr "Server pozastavený" + +msgid "Server is suspended" +msgstr "Server je doèasne preru¹ený" + +msgid "Couldn't suspend Server!" +msgstr "Nepodarilo sa pozastavi» Server!" + +msgid "Hide Mainmenu Entry" +msgstr "Schova» polo¾ku v hlavnom menu" + +msgid "Start Client" +msgstr "Spusti» Klienta" + +msgid "Remote IP" +msgstr "Vzdialená IP" + +msgid "Remote Port" +msgstr "Vzdialený port" + +msgid "Filter Streaming" +msgstr "filtrova» prúdy" + +msgid "Minimum Priority" +msgstr "minimálna priorita" + +msgid "Maximum Priority" +msgstr "maximálna priorita" + diff --git a/client/setup.c b/client/setup.c index bf050b3..dd337c8 100644 --- a/client/setup.c +++ b/client/setup.c @@ -1,5 +1,5 @@ /* - * $Id: setup.c,v 1.8 2009/02/03 10:26:21 schmirl Exp $ + * $Id: setup.c,v 1.10 2010/06/08 05:55:17 schmirl Exp $ */ #include <vdr/menuitems.h> @@ -13,7 +13,6 @@ cStreamdevClientSetup::cStreamdevClientSetup(void) { StartClient = false; RemotePort = 2004; StreamFilters = false; - SyncEPG = false; HideMenuEntry = false; MinPriority = -1; MaxPriority = MAXPRIORITY; @@ -30,7 +29,6 @@ bool cStreamdevClientSetup::SetupParse(const char *Name, const char *Value) { } else if (strcmp(Name, "RemotePort") == 0) RemotePort = atoi(Value); else if (strcmp(Name, "StreamFilters") == 0) StreamFilters = atoi(Value); - else if (strcmp(Name, "SyncEPG") == 0) SyncEPG = atoi(Value); else if (strcmp(Name, "HideMenuEntry") == 0) HideMenuEntry = atoi(Value); else if (strcmp(Name, "MinPriority") == 0) MinPriority = atoi(Value); else if (strcmp(Name, "MaxPriority") == 0) MaxPriority = atoi(Value); @@ -41,14 +39,13 @@ bool cStreamdevClientSetup::SetupParse(const char *Name, const char *Value) { cStreamdevClientMenuSetupPage::cStreamdevClientMenuSetupPage(void) { m_NewSetup = StreamdevClientSetup; - AddBoolEdit (tr("Hide Mainmenu Entry"),m_NewSetup.HideMenuEntry); - AddBoolEdit (tr("Start Client"), m_NewSetup.StartClient); - AddIpEdit (tr("Remote IP"), m_NewSetup.RemoteIp); - AddShortEdit(tr("Remote Port"), m_NewSetup.RemotePort); - AddBoolEdit (tr("Filter Streaming"), m_NewSetup.StreamFilters); - AddBoolEdit (tr("Synchronize EPG"), m_NewSetup.SyncEPG); - AddRangeEdit (tr("Minimum Priority"), m_NewSetup.MinPriority, -1, MAXPRIORITY); - AddRangeEdit (tr("Maximum Priority"), m_NewSetup.MaxPriority, -1, MAXPRIORITY); + Add(new cMenuEditBoolItem(tr("Hide Mainmenu Entry"), &m_NewSetup.HideMenuEntry)); + Add(new cMenuEditBoolItem(tr("Start Client"), &m_NewSetup.StartClient)); + Add(new cMenuEditIpItem (tr("Remote IP"), m_NewSetup.RemoteIp)); + Add(new cMenuEditIntItem (tr("Remote Port"), &m_NewSetup.RemotePort, 0, 65535)); + Add(new cMenuEditBoolItem(tr("Filter Streaming"), &m_NewSetup.StreamFilters)); + Add(new cMenuEditIntItem (tr("Minimum Priority"), &m_NewSetup.MinPriority, -1, MAXPRIORITY)); + Add(new cMenuEditIntItem (tr("Maximum Priority"), &m_NewSetup.MaxPriority, -1, MAXPRIORITY)); SetCurrent(Get(0)); } @@ -68,7 +65,6 @@ void cStreamdevClientMenuSetupPage::Store(void) { SetupStore("RemoteIp", m_NewSetup.RemoteIp); SetupStore("RemotePort", m_NewSetup.RemotePort); SetupStore("StreamFilters", m_NewSetup.StreamFilters); - SetupStore("SyncEPG", m_NewSetup.SyncEPG); SetupStore("HideMenuEntry", m_NewSetup.HideMenuEntry); SetupStore("MinPriority", m_NewSetup.MinPriority); SetupStore("MaxPriority", m_NewSetup.MaxPriority); diff --git a/client/setup.h b/client/setup.h index 9f4d11b..6049967 100644 --- a/client/setup.h +++ b/client/setup.h @@ -1,5 +1,5 @@ /* - * $Id: setup.h,v 1.5 2009/01/29 07:48:59 schmirl Exp $ + * $Id: setup.h,v 1.7 2010/06/08 05:55:17 schmirl Exp $ */ #ifndef VDR_STREAMDEV_SETUPCLIENT_H @@ -16,7 +16,6 @@ struct cStreamdevClientSetup { char RemoteIp[20]; int RemotePort; int StreamFilters; - int SyncEPG; int HideMenuEntry; int MinPriority; int MaxPriority; @@ -24,7 +23,7 @@ struct cStreamdevClientSetup { extern cStreamdevClientSetup StreamdevClientSetup; -class cStreamdevClientMenuSetupPage: public cStreamdevMenuSetupPage { +class cStreamdevClientMenuSetupPage: public cMenuSetupPage { private: cStreamdevClientSetup m_NewSetup; diff --git a/client/socket.c b/client/socket.c index 02f501d..bd2f9ba 100644 --- a/client/socket.c +++ b/client/socket.c @@ -1,5 +1,5 @@ /* - * $Id: socket.c,v 1.12 2008/04/08 14:18:16 schmirl Exp $ + * $Id: socket.c,v 1.13 2010/06/08 05:55:17 schmirl Exp $ */ #include <tools/select.h> @@ -300,52 +300,6 @@ bool cClientSocket::CloseDvr(void) { return true; } -bool cClientSocket::SynchronizeEPG(void) { - std::string buffer; - bool result; - FILE *epgfd; - - if (!CheckConnection()) return false; - - isyslog("Streamdev: Synchronizing EPG from server\n"); - - CMD_LOCK; - - if (!Command("LSTE")) - return false; - - if ((epgfd = tmpfile()) == NULL) { - esyslog("ERROR: Streamdev: Error while processing EPG data: %s", - strerror(errno)); - return false; - } - - while ((result = Expect(215, &buffer))) { - if (buffer[3] == ' ') break; - fputs(buffer.c_str() + 4, epgfd); - fputc('\n', epgfd); - } - - if (!result) { - if (errno == 0) - esyslog("ERROR: Streamdev: Couldn't fetch EPG data from %s:%d", - RemoteIp().c_str(), RemotePort()); - fclose(epgfd); - return false; - } - - rewind(epgfd); - if (cSchedules::Read(epgfd)) - cSchedules::Cleanup(true); - else { - esyslog("ERROR: Streamdev: Parsing EPG data failed"); - fclose(epgfd); - return false; - } - fclose(epgfd); - return true; -} - bool cClientSocket::Quit(void) { bool res; diff --git a/client/socket.h b/client/socket.h index a0400e6..7ad9a80 100644 --- a/client/socket.h +++ b/client/socket.h @@ -1,5 +1,5 @@ /* - * $Id: socket.h,v 1.6 2008/04/07 14:40:40 schmirl Exp $ + * $Id: socket.h,v 1.7 2010/06/08 05:55:17 schmirl Exp $ */ #ifndef VDR_STREAMDEV_CLIENT_CONNECTION_H @@ -48,7 +48,6 @@ public: bool SetPid(int Pid, bool On); bool SetFilter(ushort Pid, uchar Tid, uchar Mask, bool On); bool CloseDvr(void); - bool SynchronizeEPG(void); bool SuspendServer(void); bool Quit(void); diff --git a/client/streamdev-client.c b/client/streamdev-client.c new file mode 100644 index 0000000..79c3d74 --- /dev/null +++ b/client/streamdev-client.c @@ -0,0 +1,55 @@ +/* + * streamdev.c: A plugin for the Video Disk Recorder + * + * See the README file for copyright information and how to reach the author. + * + * $Id: streamdev-client.c,v 1.1.2.1 2010/06/14 10:40:11 schmirl Exp $ + */ + +#include "streamdev-client.h" +#include "client/device.h" +#include "client/setup.h" + +#if !defined(APIVERSNUM) || APIVERSNUM < 10509 +#error "VDR-1.5.9 API version or greater is required!" +#endif + +const char *cPluginStreamdevClient::DESCRIPTION = trNOOP("VTP Streaming Client"); + +cPluginStreamdevClient::cPluginStreamdevClient(void) { +} + +cPluginStreamdevClient::~cPluginStreamdevClient() { +} + +const char *cPluginStreamdevClient::Description(void) { + return tr(DESCRIPTION); +} + +bool cPluginStreamdevClient::Start(void) { + I18nRegister(PLUGIN_NAME_I18N); + cStreamdevDevice::Init(); + return true; +} + +const char *cPluginStreamdevClient::MainMenuEntry(void) { + return StreamdevClientSetup.StartClient && !StreamdevClientSetup.HideMenuEntry ? tr("Suspend Server") : NULL; +} + +cOsdObject *cPluginStreamdevClient::MainMenuAction(void) { + if (ClientSocket.SuspendServer()) + Skins.Message(mtInfo, tr("Server is suspended")); + else + Skins.Message(mtError, tr("Couldn't suspend Server!")); + return NULL; +} + +cMenuSetupPage *cPluginStreamdevClient::SetupMenu(void) { + return new cStreamdevClientMenuSetupPage; +} + +bool cPluginStreamdevClient::SetupParse(const char *Name, const char *Value) { + return StreamdevClientSetup.SetupParse(Name, Value); +} + +VDRPLUGINCREATOR(cPluginStreamdevClient); // Don't touch this! diff --git a/client/streamdev-client.h b/client/streamdev-client.h new file mode 100644 index 0000000..07befe3 --- /dev/null +++ b/client/streamdev-client.h @@ -0,0 +1,28 @@ +/* + * $Id: streamdev-client.h,v 1.1.2.1 2010/06/14 10:40:11 schmirl Exp $ + */ + +#ifndef VDR_STREAMDEVCLIENT_H +#define VDR_STREAMDEVCLIENT_H + +#include "common.h" + +#include <vdr/plugin.h> + +class cPluginStreamdevClient : public cPlugin { +private: + static const char *DESCRIPTION; + +public: + cPluginStreamdevClient(void); + virtual ~cPluginStreamdevClient(); + virtual const char *Version(void) { return VERSION; } + virtual const char *Description(void); + virtual bool Start(void); + virtual const char *MainMenuEntry(void); + virtual cOsdObject *MainMenuAction(void); + virtual cMenuSetupPage *SetupMenu(void); + virtual bool SetupParse(const char *Name, const char *Value); +}; + +#endif // VDR_STREAMDEVCLIENT_H |