From 31b6264a543345c4559f03e5aa3f7a4f134d2454 Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Mon, 15 Oct 2007 21:03:45 +0000 Subject: [PATCH] Added some missing EXT protocol code. --- HISTORY | 4 ++++ device.h | 4 +++- iptv.c | 4 ++-- po/fi_FI.po | 5 ++++- setup.c | 14 +++++++++++++- 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/HISTORY b/HISTORY index a6e7c21..61703bd 100644 --- a/HISTORY +++ b/HISTORY @@ -4,3 +4,7 @@ VDR Plugin 'iptv' Revision History 2007-10-14: Version 0.0.1 - Initial revision. + +2007-xx-xx: Version 0.0.2 + +- Added EXT protocol. diff --git a/device.h b/device.h index 1f406cb..be89aa8 100644 --- a/device.h +++ b/device.h @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: device.h,v 1.32 2007/10/14 18:45:34 rahrenbe Exp $ + * $Id: device.h,v 1.33 2007/10/15 21:03:45 rahrenbe Exp $ */ #ifndef __IPTV_DEVICE_H @@ -14,6 +14,7 @@ #include "protocoludp.h" #include "protocolhttp.h" #include "protocolfile.h" +#include "protocolext.h" #include "streamer.h" #include "sectionfilter.h" #include "sidscanner.h" @@ -40,6 +41,7 @@ private: cIptvProtocolUdp *pUdpProtocol; cIptvProtocolHttp *pHttpProtocol; cIptvProtocolFile *pFileProtocol; + cIptvProtocolExt *pExtProtocol; cIptvStreamer *pIptvStreamer; cSidScanner *pSidScanner; cMutex mutex; diff --git a/iptv.c b/iptv.c index 811f29e..c8bb1ec 100644 --- a/iptv.c +++ b/iptv.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: iptv.c,v 1.20 2007/10/14 18:45:34 rahrenbe Exp $ + * $Id: iptv.c,v 1.21 2007/10/15 21:03:45 rahrenbe Exp $ */ #include @@ -17,7 +17,7 @@ #error "VDR-1.5.10 API version or greater is required!" #endif -static const char *VERSION = "0.0.1"; +static const char *VERSION = "0.0.2"; static const char *DESCRIPTION = trNOOP("Experience the IPTV"); class cPluginIptv : public cPlugin { diff --git a/po/fi_FI.po b/po/fi_FI.po index 99dd970..01607c7 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: Rolf Ahrenberg\n" -"POT-Creation-Date: 2007-10-14 21:42+0300\n" +"POT-Creation-Date: 2007-10-16 00:00+0300\n" "PO-Revision-Date: 2007-08-12 23:22+0300\n" "Last-Translator: Rolf Ahrenberg\n" "Language-Team: \n" @@ -48,6 +48,9 @@ msgstr "HTTP" msgid "FILE" msgstr "FILE" +msgid "EXT" +msgstr "EXT" + msgid "Protocol" msgstr "Protokolla" diff --git a/setup.c b/setup.c index 774a2e9..7377b77 100644 --- a/setup.c +++ b/setup.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: setup.c,v 1.33 2007/10/14 18:51:21 rahrenbe Exp $ + * $Id: setup.c,v 1.34 2007/10/15 21:03:45 rahrenbe Exp $ */ #include @@ -30,6 +30,7 @@ private: eProtocolUDP, eProtocolHTTP, eProtocolFILE, + eProtocolEXT, eProtocolCount }; struct tIptvChannel { @@ -55,6 +56,7 @@ cIptvMenuEditChannel::cIptvMenuEditChannel(cChannel *Channel, bool New) protocols[eProtocolUDP] = tr("UDP"); protocols[eProtocolHTTP] = tr("HTTP"); protocols[eProtocolFILE] = tr("FILE"); + protocols[eProtocolEXT] = tr("EXT"); channel = Channel; GetChannelData(channel); if (New) { @@ -84,6 +86,11 @@ cString cIptvMenuEditChannel::GetIptvSettings(const char *Param, int *Port, int *Protocol = eProtocolFILE; return addr; } + else if (sscanf(Param, "IPTV|EXT|%a[^|]|%u", &loc, Port) == 2) { + cString addr(loc, true); + *Protocol = eProtocolEXT; + return addr; + } return NULL; } @@ -146,6 +153,9 @@ void cIptvMenuEditChannel::SetChannelData(cChannel *Channel) char dlangs[MAXDPIDS][MAXLANGCODE2] = { "" }; char slangs[MAXSPIDS][MAXLANGCODE2] = { "" }; switch (data.protocol) { + case eProtocolEXT: + param = cString::sprintf("IPTV|EXT|%s|%d", data.location, data.port); + break; case eProtocolFILE: param = cString::sprintf("IPTV|FILE|%s|%d", data.location, data.port); break; @@ -176,6 +186,7 @@ void cIptvMenuEditChannel::Setup(void) Add(new cMenuEditStrItem(trVDR("File"), data.location, sizeof(data.location), trVDR(FileNameChars))); Add(new cMenuEditIntItem(tr("Delay (ms)"), &data.port, 0, 0xFFFF)); break; + case eProtocolEXT: case eProtocolHTTP: case eProtocolUDP: default: @@ -287,6 +298,7 @@ eOSState cIptvMenuEditChannel::ProcessKey(eKeys Key) data.port = 3000; break; default: + case eProtocolEXT: case eProtocolUDP: strn0cpy(data.location, "127.0.0.1", sizeof(data.location)); data.port = 1234;