From 572caca1ba06dd8247724c9f5d6bcad515e2edf4 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Mon, 5 Dec 2005 19:24:42 +0000 Subject: [PATCH] add support for Linkage services ( Premiere Subservices ) TODO: show/hide green point depending on avail subservices --- data/keymap.xml | 4 + data/skin.xml | 10 +- lib/base/estring.h | 1 - lib/dvb/eit.cpp | 5 + lib/dvb/eit.h | 1 + lib/dvb/idvb.h | 6 ++ lib/dvb/specs.h | 21 +++++ lib/python/Components/Label.py | 5 + lib/python/Components/ServiceName.py | 5 +- lib/python/Screens/InfoBar.py | 8 +- lib/python/Screens/InfoBarGenerics.py | 27 +++++- lib/python/Screens/Makefile.am | 2 +- lib/python/Screens/SubserviceSelection.py | 30 ++++++ lib/python/Screens/__init__.py | 2 +- lib/service/event.cpp | 37 ++++++-- lib/service/event.h | 21 ++--- lib/service/iservice.h | 17 +++- lib/service/servicedvb.cpp | 106 +++++++++++++++++++--- lib/service/servicedvb.h | 10 +- lib/service/servicemp3.cpp | 29 ++++-- lib/service/servicemp3.h | 8 +- 21 files changed, 290 insertions(+), 65 deletions(-) create mode 100644 lib/python/Screens/SubserviceSelection.py diff --git a/data/keymap.xml b/data/keymap.xml index e10fe20f..91f82622 100644 --- a/data/keymap.xml +++ b/data/keymap.xml @@ -83,6 +83,10 @@ + + + + diff --git a/data/skin.xml b/data/skin.xml index a2ffe187..44c4988d 100644 --- a/data/skin.xml +++ b/data/skin.xml @@ -49,6 +49,9 @@ + + + @@ -162,10 +165,11 @@ - + - - + + diff --git a/lib/base/estring.h b/lib/base/estring.h index b997911c..34022280 100644 --- a/lib/base/estring.h +++ b/lib/base/estring.h @@ -11,7 +11,6 @@ int strnicmp(const char*, const char*, int); std::string getNum(int num, int base=10); std::string convertDVBUTF8(const unsigned char *data, int len, int table=0, int tsidonid=0); // with default ISO8859-1/Latin1 -std::string convertUTF8DVB(const std::string &string, int table=0); // with default ISO8859-1/Latin1 std::string convertLatin1UTF8(const std::string &string); int isUTF8(const std::string &string); diff --git a/lib/dvb/eit.cpp b/lib/dvb/eit.cpp index cc2c29b2..9f3169f9 100644 --- a/lib/dvb/eit.cpp +++ b/lib/dvb/eit.cpp @@ -42,6 +42,11 @@ void eDVBServiceEITHandler::start(iDVBDemux *demux, int sid) m_EIT.begin(eApp, eDVBEITSpec(sid), demux); } +void eDVBServiceEITHandler::startOther(iDVBDemux *demux, int sid) +{ + m_EIT.begin(eApp, eDVBEITSpecOther(sid), demux); +} + RESULT eDVBServiceEITHandler::getEvent(ePtr &event, int nownext) { event = nownext ? m_event_next : m_event_now; diff --git a/lib/dvb/eit.h b/lib/dvb/eit.h index 43bdb6b2..bc52e146 100644 --- a/lib/dvb/eit.h +++ b/lib/dvb/eit.h @@ -19,6 +19,7 @@ public: eDVBServiceEITHandler(); void start(iDVBDemux *demux, int sid); + void startOther(iDVBDemux *demux, int sid); RESULT getEvent(ePtr &event, int nownext); diff --git a/lib/dvb/idvb.h b/lib/dvb/idvb.h index 22eccbd9..742a3a32 100644 --- a/lib/dvb/idvb.h +++ b/lib/dvb/idvb.h @@ -153,6 +153,12 @@ struct eServiceReferenceDVB: public eServiceReference eDVBNamespace getDVBNamespace() const { return eDVBNamespace(data[4]); } void setDVBNamespace(eDVBNamespace dvbnamespace) { data[4]=dvbnamespace.get(); } + eServiceID getParentServiceID() const { return eServiceID(data[5]); } + void setParentServiceID( eServiceID sid ) { data[5]=sid.get(); } + + eTransportStreamID getParentTransportStreamID() const { return eTransportStreamID(data[6]); } + void setParentTransportStreamID( eTransportStreamID tsid ) { data[6]=tsid.get(); } + eServiceReferenceDVB(eDVBNamespace dvbnamespace, eTransportStreamID transport_stream_id, eOriginalNetworkID original_network_id, eServiceID service_id, int service_type) :eServiceReference(eServiceReference::idDVB, 0) { diff --git a/lib/dvb/specs.h b/lib/dvb/specs.h index 23ef2cec..afd5cef8 100644 --- a/lib/dvb/specs.h +++ b/lib/dvb/specs.h @@ -127,4 +127,25 @@ public: } }; +class eDVBEITSpecOther +{ + eDVBTableSpec m_spec; +public: + /* this is for now&next on actual transponder. */ + eDVBEITSpecOther(int sid) + { + m_spec.pid = EventInformationSection::PID; + m_spec.tid = TID_EIT_OTHER; + m_spec.tidext = sid; + m_spec.timeout = EventInformationSection::TIMEOUT; + m_spec.flags = eDVBTableSpec::tfAnyVersion | + eDVBTableSpec::tfHaveTID | eDVBTableSpec::tfHaveTIDExt | + eDVBTableSpec::tfCheckCRC | eDVBTableSpec::tfHaveTimeout; + } + operator eDVBTableSpec &() + { + return m_spec; + } +}; + #endif diff --git a/lib/python/Components/Label.py b/lib/python/Components/Label.py index 7402d722..c2d57743 100644 --- a/lib/python/Components/Label.py +++ b/lib/python/Components/Label.py @@ -22,3 +22,8 @@ class Label(HTMLComponent, GUIComponent, VariableText): s = self.instance.calculateSize() return (s.width(), s.height()) + def show(self): + self.instance.show() + + def hide(self): + self.instance.hide() diff --git a/lib/python/Components/ServiceName.py b/lib/python/Components/ServiceName.py index 2e794d67..a9c0930a 100644 --- a/lib/python/Components/ServiceName.py +++ b/lib/python/Components/ServiceName.py @@ -17,8 +17,9 @@ class ServiceName(PerServiceDisplay): if service is not None: info = service.info() if info is not None: - self.setText(info.getName()) - setLCD(info.getName()) + name = info.getName() + self.setText(name) + setLCD(name) def stopEvent(self): self.setText(""); diff --git a/lib/python/Screens/InfoBar.py b/lib/python/Screens/InfoBar.py index 45a0538b..cee385c1 100644 --- a/lib/python/Screens/InfoBar.py +++ b/lib/python/Screens/InfoBar.py @@ -12,7 +12,8 @@ from Tools.Notifications import AddNotificationWithCallback from Screens.InfoBarGenerics import InfoBarVolumeControl, InfoBarShowHide, \ InfoBarPowerKey, InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, \ InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarPVR, InfoBarInstantRecord, \ - InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish + InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, \ + InfoBarSubserviceSelection from Screens.HelpMenu import HelpableScreen, HelpMenu @@ -23,7 +24,8 @@ import time class InfoBar(Screen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, - HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish): + HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, + InfoBarSubserviceSelection): def __init__(self, session): Screen.__init__(self, session) @@ -37,7 +39,7 @@ class InfoBar(Screen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \ InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \ InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, \ - InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish: + InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection: x.__init__(self) self.helpList.append((self["actions"], "InfobarActions", [("showMovies", "Watch a Movie...")])) diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index ddfac4a0..f27cf40c 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -512,6 +512,26 @@ class InfoBarAudioSelection: if n > 0: self.session.open(AudioSelection, audio) +from Screens.SubserviceSelection import SubserviceSelection + +class InfoBarSubserviceSelection: + def __init__(self): + self["SubserviceSelectionAction"] = HelpableActionMap(self, "InfobarSubserviceSelectionActions", + { + "subserviceSelection": (self.subserviceSelection, "Subservice list..."), + }) + + def subserviceSelection(self): + service = self.session.nav.getCurrentService() + subservices = service.subServices() + n = subservices.getNumberOfSubservices() + if n > 0: + self.session.openWithCallback(self.subserviceSelected, SubserviceSelection, subservices) + + def subserviceSelected(self, service): + if not service is None: + self.session.nav.playService(service) + class InfoBarAdditionalInfo: def __init__(self): self["DolbyActive"] = PixmapConditional() @@ -529,8 +549,11 @@ class InfoBarAdditionalInfo: self["ButtonRed"] = Pixmap() self["ButtonRedText"] = Label(_("Record")) self["ButtonGreen"] = Pixmap() - self["ButtonYellow"] = Pixmap() - self["ButtonBlue"] = Pixmap() + self["ButtonGreenText"] = Label(_("Subservices")) +# self["ButtonGreenText"].hide() +# self["ButtonGreen"].hidePixmap() +# self["ButtonYellow"] = Pixmap() +# self["ButtonBlue"] = Pixmap() class InfoBarNotifications: def __init__(self): diff --git a/lib/python/Screens/Makefile.am b/lib/python/Screens/Makefile.am index 20e0961b..71ee04f0 100644 --- a/lib/python/Screens/Makefile.am +++ b/lib/python/Screens/Makefile.am @@ -7,4 +7,4 @@ install_PYTHON = \ Satconfig.py ScanSetup.py NetworkSetup.py Ci.py TimerEntry.py Volume.py \ EpgSelection.py EventView.py Mute.py Standby.py ServiceInfo.py \ AudioSelection.py InfoBarGenerics.py HelpMenu.py Wizard.py __init__.py \ - Dish.py + Dish.py SubserviceSelection.py diff --git a/lib/python/Screens/SubserviceSelection.py b/lib/python/Screens/SubserviceSelection.py new file mode 100644 index 00000000..a73cf0e4 --- /dev/null +++ b/lib/python/Screens/SubserviceSelection.py @@ -0,0 +1,30 @@ +from Screen import Screen +from Components.ActionMap import ActionMap +from Components.MenuList import MenuList +from Components.Label import Label +from enigma import eServiceReferencePtr, eServiceReference + +class SubserviceSelection(Screen): + def KeyOk(self): + selection = self["subservices"].getCurrent() + self.close(selection[1]) + def Cancel(self): + self.close(None) + def __init__(self, session, subservices): + Screen.__init__(self, session) + + self["actions"] = ActionMap(["OkCancelActions"], + { + "cancel": self.Cancel, + "ok": self.KeyOk, + }) + + self.subservices = subservices + + tlist = [] + n = subservices.getNumberOfSubservices() + for x in range(n): + i = subservices.getSubservice(x) + tlist.append((i.getName(), i)) + + self["subservices"] = MenuList(tlist) diff --git a/lib/python/Screens/__init__.py b/lib/python/Screens/__init__.py index 0c6f1714..bb1428f1 100644 --- a/lib/python/Screens/__init__.py +++ b/lib/python/Screens/__init__.py @@ -4,4 +4,4 @@ __all__ = ["ChannelSelection", "ClockDisplay", "ConfigMenu", "TimerEdit", "Setup", "HarddiskSetup", "FixedMenu", "Satconfig", "Scanconfig", "Ci.py", "Volume.py", "Mute.py", "EpgSelection", "EventView", "Standby", "ServiceInfo", - "AudioSelection", "InfoBarGenerics", "HelpMenu", "Wizard"] + "AudioSelection", "SubserviceSelection", "InfoBarGenerics", "HelpMenu", "Wizard"] diff --git a/lib/service/event.cpp b/lib/service/event.cpp index 81a8d4bb..40bc9b51 100644 --- a/lib/service/event.cpp +++ b/lib/service/event.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -119,7 +120,8 @@ bool eServiceEvent::loadLanguage(Event *evt, std::string lang, int tsidonid) data.m_componentType = cp->getComponentType(); data.m_componentTag = cp->getComponentTag(); data.m_iso639LanguageCode = cp->getIso639LanguageCode(); - data.m_text = convertDVBUTF8(cp->getText()); + int table=encodingHandler.getCountryCodeDefaultMapping(data.m_iso639LanguageCode); + data.m_text = convertDVBUTF8(cp->getText(),table,tsidonid); m_component_data.push_back(data); break; } @@ -128,14 +130,16 @@ bool eServiceEvent::loadLanguage(Event *evt, std::string lang, int tsidonid) const LinkageDescriptor *ld = (LinkageDescriptor*)*desc; if ( ld->getLinkageType() == 0xB0 ) { - linkage_service s; - s.m_onid = ld->getOriginalNetworkId(); - s.m_tsid = ld->getTransportStreamId(); - s.m_sid = ld->getServiceId(); - const PrivateDataByteVector *privateData = - ld->getPrivateDataBytes(); - s.m_description.assign((const char*)&((*privateData)[0]), privateData->size()); - m_linkage_services.push_back(s); + eServiceReference ref; + ref.type = eServiceReference::idDVB; + eServiceReferenceDVB &dvb_ref = (eServiceReferenceDVB&) ref; + dvb_ref.setServiceType(1); + dvb_ref.setTransportStreamID(ld->getTransportStreamId()); + dvb_ref.setOriginalNetworkID(ld->getOriginalNetworkId()); + dvb_ref.setServiceID(ld->getServiceId()); + const PrivateDataByteVector *privateData = ld->getPrivateDataBytes(); + dvb_ref.name = convertDVBUTF8((const char*)&((*privateData)[0]), privateData->size(), 0, tsidonid); + m_linkage_services.push_back(ref); } break; } @@ -199,4 +203,19 @@ RESULT eServiceEvent::getComponentData(ePtr &dest, int tagnum) c return -1; } +RESULT eServiceEvent::getLinkageService(eServiceReference &service, int num) const +{ + std::list::const_iterator it = + m_linkage_services.begin(); + while( it != m_linkage_services.end() && num-- ) + ++it; + if ( it != m_linkage_services.end() ) + { + service = *it; + return 0; + } + service.type = eServiceReference::idInvalid; + return -1; +} + DEFINE_REF(eDebugClass); diff --git a/lib/service/event.h b/lib/service/event.h index d224c183..550d9a85 100644 --- a/lib/service/event.h +++ b/lib/service/event.h @@ -4,6 +4,7 @@ #ifndef SWIG #include #include +#include #include #include class Event; @@ -28,28 +29,18 @@ DECLARE_REF(eComponentData); TEMPLATE_TYPEDEF(ePtr, eComponentDataPtr); -struct linkage_service -{ - uint16_t m_sid; - uint16_t m_onid; - uint16_t m_tsid; - std::string m_description; -}; - class eServiceEvent: public iObject { -DECLARE_REF(eServiceEvent); -#ifndef SWIG + DECLARE_REF(eServiceEvent); bool loadLanguage(Event *event, std::string lang, int tsidonid); std::list m_component_data; -#endif -public: -#ifndef SWIG - std::list m_linkage_services; + std::list m_linkage_services; time_t m_begin; int m_duration; std::string m_event_name, m_short_description, m_extended_description; // .. additional info +public: +#ifndef SWIG RESULT parseFrom(Event *evt, int tsidonid=0); #endif time_t getBeginTime() const { return m_begin; } @@ -59,6 +50,8 @@ public: std::string getExtendedDescription() const { return m_extended_description; } std::string getBeginTimeString() const; SWIG_VOID(RESULT) getComponentData(ePtr &SWIG_OUTPUT, int tagnum) const; + int getNumOfLinkageServices() const { return m_linkage_services.size(); } + SWIG_VOID(RESULT) getLinkageService(eServiceReference &SWIG_OUTPUT, int num) const; }; TEMPLATE_TYPEDEF(ePtr, eServiceEventPtr); diff --git a/lib/service/iservice.h b/lib/service/iservice.h index dfd06693..4ec12153 100644 --- a/lib/service/iservice.h +++ b/lib/service/iservice.h @@ -3,11 +3,12 @@ #include #include -#include #include #include #include +class eServiceEvent; + class eServiceReference { public: @@ -54,8 +55,8 @@ public: eServiceReference() : type(idInvalid), flags(0) { + memset(data, 0, sizeof(data)); } - eServiceReference(int type, int flags) : type(type), flags(flags) { @@ -181,8 +182,6 @@ public: TEMPLATE_TYPEDEF(ePtr, iStaticServiceInformationPtr); -class eServiceEvent; - TEMPLATE_TYPEDEF(ePtr, eServiceEventPtr); class iServiceInformation: public iObject @@ -279,6 +278,15 @@ public: TEMPLATE_TYPEDEF(ePtr, iAudioTrackSelectionPtr); +class iSubserviceList: public iObject +{ +public: + virtual int getNumberOfSubservices()=0; + virtual SWIG_VOID(RESULT) getSubservice(eServiceReference &SWIG_OUTPUT, unsigned int n)=0; +}; + +TEMPLATE_TYPEDEF(ePtr, iSubserviceListPtr); + class iPlayableService: public iObject { friend class iServiceHandler; @@ -300,6 +308,7 @@ public: virtual SWIG_VOID(RESULT) pause(ePtr &SWIG_OUTPUT)=0; virtual SWIG_VOID(RESULT) info(ePtr &SWIG_OUTPUT)=0; virtual SWIG_VOID(RESULT) audioTracks(ePtr &SWIG_OUTPUT)=0; + virtual SWIG_VOID(RESULT) subServices(ePtr &SWIG_OUTPUT)=0; virtual SWIG_VOID(RESULT) frontendStatusInfo(ePtr &SWIG_OUTPUT)=0; }; diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index 3cb5387a..307fb9f5 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -25,9 +25,40 @@ DEFINE_REF(eStaticServiceDVBInformation); RESULT eStaticServiceDVBInformation::getName(const eServiceReference &ref, std::string &name) { + eServiceReferenceDVB &service = (eServiceReferenceDVB&)ref; if ( !ref.name.empty() ) { - name = ref.name; + if (service.getParentTransportStreamID().get()) // linkage subservice + { + ePtr service_center; + if (!eServiceCenter::getInstance(service_center)) + { + eServiceReferenceDVB parent = service; + parent.setTransportStreamID( service.getParentTransportStreamID() ); + parent.setServiceID( service.getParentServiceID() ); + parent.setParentTransportStreamID(eTransportStreamID(0)); + parent.setParentServiceID(eServiceID(0)); + parent.name=""; + ePtr service_info; + if (!service_center->info(parent, service_info)) + { + if (!service_info->getName(parent, name)) + { + // just show short name + unsigned int pos = name.find("\xc2\x86"); + if ( pos != std::string::npos ) + name.erase(0, pos+2); + pos = name.find("\xc2\x87"); + if ( pos != std::string::npos ) + name.erase(pos); + name+=" - "; + } + } + } + } + else + name=""; + name += ref.name; return 0; } else @@ -365,24 +396,19 @@ RESULT eServiceFactoryDVB::info(const eServiceReference &ref, ePtr service; - int r = lookupService(service, ref); - if (r) // no eDVBService avail for this reference ( Linkage Services... ) + if (lookupService(service, ref)) // no eDVBService avail for this reference ( Linkage Services... ) ptr = new eStaticServiceDVBInformation; else /* eDVBService has the iStaticServiceInformation interface, so we pass it here. */ ptr = service; - return 0; } + return 0; } RESULT eServiceFactoryDVB::offlineOperations(const eServiceReference &ref, ePtr &ptr) @@ -467,10 +493,16 @@ void eDVBServicePlay::serviceEvent(int event) ePtr m_demux; if (!m_service_handler.getDemux(m_demux)) { -// eventStartedEventAcquisition - m_event_handler.start(m_demux, ((eServiceReferenceDVB&)m_reference).getServiceID().get()); + eServiceReferenceDVB &ref = (eServiceReferenceDVB&) m_reference; + int sid = ref.getParentServiceID().get(); + if (!sid) + sid = ref.getServiceID().get(); + if ( ref.getParentTransportStreamID().get() && + ref.getParentTransportStreamID() != ref.getTransportStreamID() ) + m_event_handler.startOther(m_demux, sid); + else + m_event_handler.start(m_demux, sid); } -// eventNoEvent break; } case eDVBServicePMTHandler::eventTuneFailed: @@ -699,6 +731,12 @@ RESULT eDVBServicePlay::audioTracks(ePtr &ptr) return 0; } +RESULT eDVBServicePlay::subServices(ePtr &ptr) +{ + ptr = this; + return 0; +} + RESULT eDVBServicePlay::getName(std::string &name) { if (m_dvb_service) @@ -706,7 +744,10 @@ RESULT eDVBServicePlay::getName(std::string &name) m_dvb_service->getName(m_reference, name); if (name.empty()) name = "(...)"; - } else + } + else if (!m_reference.name.empty()) + eStaticServiceDVBInformation().getName(m_reference, name); + else name = "DVB service"; return 0; } @@ -841,6 +882,47 @@ int eDVBServicePlay::getFrontendInfo(int w) return fe->readFrontendData(w); } +int eDVBServicePlay::getNumberOfSubservices() +{ + ePtr evt; + if (!m_event_handler.getEvent(evt, 0)) + return evt->getNumOfLinkageServices(); + return 0; +} + +RESULT eDVBServicePlay::getSubservice(eServiceReference &sub, unsigned int n) +{ + ePtr evt; + if (!m_event_handler.getEvent(evt, 0)) + { + if (!evt->getLinkageService(sub, n)) + { + eServiceReferenceDVB &subservice = (eServiceReferenceDVB&) sub; + eServiceReferenceDVB ¤t = (eServiceReferenceDVB&) m_reference; + subservice.setDVBNamespace(current.getDVBNamespace()); + if ( current.getParentTransportStreamID().get() ) + { + subservice.setParentTransportStreamID( current.getParentTransportStreamID() ); + subservice.setParentServiceID( current.getParentServiceID() ); + } + else + { + subservice.setParentTransportStreamID( current.getTransportStreamID() ); + subservice.setParentServiceID( current.getServiceID() ); + } + if ( subservice.getParentTransportStreamID() == subservice.getTransportStreamID() && + subservice.getParentServiceID() == subservice.getServiceID() ) + { + subservice.setParentTransportStreamID( eTransportStreamID(0) ); + subservice.setParentServiceID( eServiceID(0) ); + } + return 0; + } + } + sub.type=eServiceReference::idInvalid; + return -1; +} + DEFINE_REF(eDVBServicePlay) eAutoInitPtr init_eServiceFactoryDVB(eAutoInitNumbers::service+1, "eServiceFactoryDVB"); diff --git a/lib/service/servicedvb.h b/lib/service/servicedvb.h index 4b6ef3e1..5f851357 100644 --- a/lib/service/servicedvb.h +++ b/lib/service/servicedvb.h @@ -54,7 +54,8 @@ private: class eDVBServicePlay: public iPlayableService, public iPauseableService, public iSeekableService, public Object, public iServiceInformation, - public iAudioTrackSelection, public iFrontendStatusInformation + public iAudioTrackSelection, public iFrontendStatusInformation, + public iSubserviceList { DECLARE_REF(eDVBServicePlay); public: @@ -69,7 +70,8 @@ public: RESULT info(ePtr &ptr); RESULT audioTracks(ePtr &ptr); RESULT frontendStatusInfo(ePtr &ptr); - + RESULT subServices(ePtr &ptr); + // iPauseableService RESULT pause(); RESULT unpause(); @@ -94,6 +96,10 @@ public: // iFrontendStatusInformation int getFrontendInfo(int w); + // iSubserviceList + int getNumberOfSubservices(); + RESULT getSubservice(eServiceReference &subservice, unsigned int n); + private: friend class eServiceFactoryDVB; eServiceReference m_reference; diff --git a/lib/service/servicemp3.cpp b/lib/service/servicemp3.cpp index 8f999471..7bd4244f 100644 --- a/lib/service/servicemp3.cpp +++ b/lib/service/servicemp3.cpp @@ -146,17 +146,30 @@ RESULT eServiceMP3::stop() return 0; } -RESULT eServiceMP3::pause(ePtr &ptr) { ptr=this; return 0; } -RESULT eServiceMP3::seek(ePtr &ptr) { ptr = 0; return -1; } - -RESULT eServiceMP3::frontendStatusInfo(ePtr &ptr) { ptr = 0; return -1; } -RESULT eServiceMP3::audioTracks(ePtr &ptr) { ptr = 0; return -1; }; +RESULT eServiceMP3::pause(ePtr &ptr) +{ + ptr=this; + return 0; +} // iPausableService -RESULT eServiceMP3::pause() { printf("mp3 pauses!\n"); return 0; } -RESULT eServiceMP3::unpause() { printf("mp3 unpauses!\n"); return 0; } +RESULT eServiceMP3::pause() +{ + printf("mp3 pauses!\n"); + return 0; +} -RESULT eServiceMP3::info(ePtr&i) { i = this; return 0; } +RESULT eServiceMP3::unpause() +{ + printf("mp3 unpauses!\n"); + return 0; +} + +RESULT eServiceMP3::info(ePtr&i) +{ + i = this; + return 0; +} RESULT eServiceMP3::getName(std::string &name) { diff --git a/lib/service/servicemp3.h b/lib/service/servicemp3.h index 9f1a8e9f..dfdaa44c 100644 --- a/lib/service/servicemp3.h +++ b/lib/service/servicemp3.h @@ -56,9 +56,11 @@ public: RESULT start(); RESULT stop(); RESULT pause(ePtr &ptr); - RESULT seek(ePtr &ptr); - RESULT audioTracks(ePtr &ptr); - RESULT frontendStatusInfo(ePtr &ptr); + // not implemented (yet) + RESULT seek(ePtr &ptr) { ptr = 0; return -1; } + RESULT audioTracks(ePtr &ptr) { ptr = 0; return -1; } + RESULT frontendStatusInfo(ePtr &ptr) { ptr = 0; return -1; } + RESULT subServices(ePtr &ptr) { ptr = 0; return -1; } // iPausableService RESULT pause(); -- 2.30.2