Hallo @all,
ich möchte in meinem plugin Informationen überden laufden Service abfragen.
Also Name der Sendnung und verbleibende Spielzeit der Senundg wäre für den
Anfang recht hilfreich. Hat jemand einen Tipp wie ich das anstellenkann?
Danke schonmal für Eure Hilfe.
Informationen über laufenden Service bekommen
-
-
schau mal in der enigma_dyn_epg.cpp. dort hast du die epg-anzeige fürs webif drin.
Gruss
Dre -
danke für den tipp, ich schau mal ob ich es hinbekomme =)
-
danke für den tip. über getCurService() habe ich nun schonmal den Namen des Services. Jetzt brauche ich nur noch irgendwie die aktuelle Sendung ?(. Damit tue ich mich noch etwas schwer.
-
so habe nun alle relevanten Daten ausgelesen. Klappt für das TV Programm super.
Was ich aber eigentlich wollte und gehoft hatte zu bekommen wäre folgende:
Ich habe ein Internet Radio Stream am laufen und ich möchte wissen a.) welche URL
gerade gespielt wird und b.) wie der aktuelle title heißt, welcher gerade gespielt wird.
Gibt es da auch eine Möglichkeit? Ein Tipp wäre echt super. Danke.------------------------------------------------------------
für alle die sowas für's TV-PRgramm auch mal brauchen können.C
Alles anzeigen/******************************************************************************* * showInfo - Test *******************************************************************************/ #include <plugin.h> #include <stdio.h> #include <stdlib.h> #include <lib/gui/ewindow.h> #include <lib/gui/ebutton.h> #include <lib/gui/emessage.h> #include <lib/gui/listbox.h> #include <iostream> #include <sys/types.h> #include <sys/dir.h> #include <dirent.h> #include <stdlib.h> #include <lib/base/console.h> #include <lib/dvb/service.h> #include <enigma.h> #include <enigma_main.h> #include <map> #include <time.h> #include <fcntl.h> #include <unistd.h> #include <sys/stat.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <net/if.h> #include <arpa/inet.h> #include <linux/if_ether.h> #include <linux/input.h> #include <iomanip> #include <iostream> #include <fstream> #include <timer.h> #include <enigma_plugins.h> #include <enigma_standby.h> #include <sselect.h> #include <upgrade.h> #include <math.h> #include <lib/dvb/frontend.h> #include <lib/driver/eavswitch.h> #include <lib/dvb/dvb.h> #include <lib/dvb/edvb.h> #include <lib/dvb/epgcache.h> #include <lib/dvb/servicestructure.h> #include <lib/dvb/decoder.h> #include <lib/dvb/dvbservice.h> #include <lib/dvb/service.h> #include <lib/dvb/record.h> #include <lib/dvb/serviceplaylist.h> #include <lib/gdi/fb.h> #include <lib/gdi/glcddc.h> #include <lib/gdi/gfbdc.h> #include <lib/gdi/epng.h> #include <lib/gui/emessage.h> #include <lib/system/http_dyn.h> #include <lib/system/econfig.h> #include <lib/system/info.h> #include <lib/system/dmfp.h> #include <enigma_dyn.h> #include <enigma_dyn_utils.h> #include <epgwindow.h> #include <streaminfo.h> using namespace std; extern "C" int plugin_exec( PluginParam *par ); extern eString getCurService(void); extern eString getCurrentSubChannel(eString curServiceRef); extern eString XMLify(eString s, eString format); // Dialog eShowInfo class eShowInfo : public eWindow { //private: eLabel *lb1,*lb2,*lb3,*lb4,*lb5; public: eShowInfo(); // the constructor. ~eShowInfo(); // the destructor. }; int plugin_exec( PluginParam *par ) { eShowInfo myShowInfo; // our demo dialog instance. myShowInfo.show(); // show the dialog... int result=myShowInfo.exec(); // give control to dialog.. (the dialog is modal!) myShowInfo.hide(); return 0; } /***************************************************************************** * myShowInfo * Fenster aufbauen *****************************************************************************/ eShowInfo::eShowInfo(): eWindow(1) { cmove(ePoint(70, 60)); cresize(eSize(560, 460)); setText("showInfo"); // Label lb1=new eLabel(this); lb1->move(ePoint(10, 10)); lb1->resize(eSize(400, 30)); lb1->loadDeco(); lb1->setText("Label 1"); lb2=new eLabel(this); lb2->move(ePoint(10, 50)); lb2->resize(eSize(400, 30)); lb2->loadDeco(); lb2->setText("Label 2"); lb3=new eLabel(this); lb3->move(ePoint(10, 50+40)); lb3->resize(eSize(400, 30)); lb3->loadDeco(); lb3->setText("Label 3"); lb4=new eLabel(this); lb4->move(ePoint(10, 50+40+40)); lb4->resize(eSize(400, 30)); lb4->loadDeco(); lb4->setText("Label 3"); lb5=new eLabel(this); lb5->move(ePoint(10, 50+40+40+40)); lb5->resize(eSize(400, 30)); lb5->loadDeco(); lb5->setText("Label 5"); eString curService = getCurService(); eString curServiceRef; eDVBServiceController *sapi = eDVB::getInstance()->getServiceAPI(); if (sapi) curServiceRef = ref2string(sapi->service); eString curSubService = getCurrentSubChannel(curServiceRef); lb1->setText(curService); lb2->setText(curServiceRef); lb3->setText(curSubService); eString result, result1, events; eString reference; eString name; eString description, ext_description, genre; int genreCategory = 0; eService* current; eServiceReference ref; eString format = "XML"; int entries = 1; if (sapi) { eString serviceRef; // = opt["ref"]; ref = (serviceRef) ? string2ref(serviceRef) : sapi->service; current = eDVB::getInstance()->settings->getTransponders()->searchService(ref); if (current) { reference=ref2string(ref); name=filter_string(current->service_name); } eServiceReferenceDVB &rref = (eServiceReferenceDVB&)ref; eEPGCache::getInstance()->Lock(); const timeMap* evt = eEPGCache::getInstance()->getTimeMap(rref); if (evt) { timeMap::const_iterator It; int tsidonid = (rref.getTransportStreamID().get() << 16) | rref.getOriginalNetworkID().get(); unsigned int i = 0; for (It = evt->begin(); It != evt->end() && i < entries; ++It) { ext_description = ""; EITEvent event(*It->second, tsidonid); for (ePtrList<Descriptor>::iterator d(event.descriptor); d != event.descriptor.end(); ++d) { Descriptor *descriptor = *d; if (descriptor->Tag() == DESCR_EXTENDED_EVENT) ext_description += ((ExtendedEventDescriptor*)descriptor)->text; else if (descriptor->Tag() == DESCR_SHORT_EVENT) description = ((ShortEventDescriptor*)descriptor)->event_name; else if (descriptor->Tag() == DESCR_CONTENT) { genre = ""; genreCategory = 0; ContentDescriptor *cod = (ContentDescriptor *)descriptor; for (ePtrList<descr_content_entry_struct>::iterator ce(cod->contentList.begin()); ce != cod->contentList.end(); ++ce) { if (genreCategory == 0) genreCategory = ce->content_nibble_level_1; if (eChannelInfo::getGenre(genreCategory * 16 + ce->content_nibble_level_2)) { if (!genre) genre += gettext(eChannelInfo::getGenre(genreCategory * 16 + ce->content_nibble_level_2).c_str()); } } } } if (!genre) genre = "n/a"; tm* t = localtime(&event.start_time); if (format == "XML") result = readFile(TEMPLATE_DIR + "XMLEPGEntry.tmp"); else result = readFile(TEMPLATE_DIR + "HTMLEPGEntry.tmp"); eString dauer = eString().sprintf("%d", event.duration/60); // Dauer lb3->setText(dauer); eString tmp = filter_string(description); lb4->setText(tmp); eString description=XMLify(tmp, format); lb5->setText(description); events += result; i++; } } eEPGCache::getInstance()->Unlock(); } } eShowInfo::~eShowInfo() { // we have to do almost nothing here. all widgets are automatically removed // since they are child of us. the eWidget-destructor will to this for us. } //EOF
zugegeben, der Code ost natürlich noch lange nicht optimiert, und man kann mit Sicherheit noch eininges rausnehmen und/oder besser machen, aber als experimente versions reichst erstmal, würde ich sagen =) -
müsste glaub in der enigma_main.cpp zu finden sein.
schau mal diese funktion an:
void eZapMain::setEIT(EIT *eit) -
hi dre,
hatte ich gestern abend ein bischen in der enigma_main rumgesucht, habe nichts zuordnen können was ich brauche. aber ich schau heute abend nochmal drüber. .
Danke auf jeden Fall für den Tipp. =) -
habe versucht in der enigma_main was passendes zu finden. leider ohne erfolg.
schade. ich könnte etwas mehr hilfe brauchen. =) -
in der setEIT würde ich mal die den eString nowtext anschauen. ist auch nur raten. aber nowtext wird über assign dem label im skin zugeordnet.
-
ich habe nun die Variable nowtext ausgelesen. Dies hat ganz gut funktioniert, nur leider klappt das nur beim "normalen TV-Programm" nicht wenn ich einen eigenen Service über playService starte.
hier mal der code für's TV-Programm:C
Alles anzeigen/******************************************************************************* * showInfo - Test *******************************************************************************/ #include <plugin.h> #include <stdio.h> #include <stdlib.h> #include <lib/gui/ewindow.h> #include <lib/gui/ebutton.h> #include <lib/gui/emessage.h> #include <lib/gui/listbox.h> #include <iostream> #include <sys/types.h> #include <sys/dir.h> #include <dirent.h> #include <stdlib.h> #include <lib/base/console.h> #include <lib/dvb/service.h> #include <enigma.h> #include <enigma_main.h> #include <map> #include <time.h> #include <fcntl.h> #include <unistd.h> #include <sys/stat.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <net/if.h> #include <arpa/inet.h> #include <linux/if_ether.h> #include <linux/input.h> #include <iomanip> #include <iostream> #include <fstream> #include <timer.h> #include <enigma_plugins.h> #include <enigma_standby.h> #include <sselect.h> #include <upgrade.h> #include <math.h> #include <lib/dvb/frontend.h> #include <lib/driver/eavswitch.h> #include <lib/dvb/dvb.h> #include <lib/dvb/edvb.h> #include <lib/dvb/epgcache.h> #include <lib/dvb/servicestructure.h> #include <lib/dvb/decoder.h> #include <lib/dvb/dvbservice.h> #include <lib/dvb/service.h> #include <lib/dvb/record.h> #include <lib/dvb/serviceplaylist.h> #include <lib/gdi/fb.h> #include <lib/gdi/glcddc.h> #include <lib/gdi/gfbdc.h> #include <lib/gdi/epng.h> #include <lib/gui/emessage.h> #include <lib/system/http_dyn.h> #include <lib/system/econfig.h> #include <lib/system/info.h> #include <lib/system/dmfp.h> #include <enigma_dyn.h> #include <enigma_dyn_utils.h> #include <epgwindow.h> #include <streaminfo.h> using namespace std; // Funktionen definieren extern "C" int plugin_exec( PluginParam *par ); extern eString getCurService(void); extern eServiceReference string2ref(const eString &service); bool my_playService(const eServiceReference &service); //Fenster class eShowInfo : public eWindow { //private: eLabel *lb1,*lb2,*lb3,*lb4,*lb5, *lb6, *lb7, *lb8, *lb9, *lb10; void eShowInfo::my_setEIT(EIT *eit); public: eShowInfo(); // the constructor. ~eShowInfo(); // the destructor. }; int plugin_exec( PluginParam *par ) { eShowInfo myShowInfo; // our demo dialog instance. myShowInfo.show(); // show the dialog... int result=myShowInfo.exec(); // give control to dialog.. (the dialog is modal!) myShowInfo.hide(); return 0; } /***************************************************************************** * myShowInfo * Fenster wird aufgebaut *****************************************************************************/ eShowInfo::eShowInfo(): eWindow(1) { cmove(ePoint(70, 60)); cresize(eSize(560, 460)); setText("showInfo"); // Label lb1=new eLabel(this); lb1->move(ePoint(10, 10)); lb1->resize(eSize(400, 30)); lb1->loadDeco(); lb1->setText("Label 1"); lb2=new eLabel(this); lb2->move(ePoint(10, 50)); lb2->resize(eSize(400, 30)); lb2->loadDeco(); lb2->setText("Label 2"); lb3=new eLabel(this); lb3->move(ePoint(10, 50+40)); lb3->resize(eSize(400, 30)); lb3->loadDeco(); lb3->setText("Label 3"); lb4=new eLabel(this); lb4->move(ePoint(10, 50+40+40)); lb4->resize(eSize(400, 30)); lb4->loadDeco(); lb4->setText("Label 4"); lb5=new eLabel(this); lb5->move(ePoint(10, 50+40+40+40)); lb5->resize(eSize(400, 30)); lb5->loadDeco(); lb5->setText("Label 5"); lb6=new eLabel(this); lb6->move(ePoint(10, 50+40+40+40+40)); lb6->resize(eSize(400, 30)); lb6->loadDeco(); lb6->setText("Label 6"); lb7=new eLabel(this); lb7->move(ePoint(10, 50+40+40+40+40+40)); lb7->resize(eSize(400, 30)); lb7->loadDeco(); lb7->setText("Label 7"); lb8=new eLabel(this); lb8->move(ePoint(10, 50+40+40+40+40+40+40)); lb8->resize(eSize(400, 30)); lb8->loadDeco(); lb8->setText("Label 8"); lb9=new eLabel(this); lb9->move(ePoint(10, 50+40+40+40+40+40+40+40)); lb9->resize(eSize(400, 30)); lb9->loadDeco(); lb9->setText("Label 9"); lb10=new eLabel(this); lb10->move(ePoint(10, 50+40+40+40+40+40+40+40+40)); lb10->resize(eSize(400, 30)); lb10->loadDeco(); lb10->setText("Label 10"); eServiceHandler *sapi=eServiceInterface::getInstance()->getService(); EIT *eit=sapi->getEIT(); my_setEIT(eit); } eShowInfo::~eShowInfo() { // we have to do almost nothing here. all widgets are automatically removed // since they are child of us. the eWidget-destructor will to this for us. } void eShowInfo::my_setEIT(EIT *eit) { eString cur_event_text=""; if (eit) { eString nowtext, nexttext, nowtime="", nexttime="", descr; int val=0; int p=0; for (ePtrList<EITEvent>::iterator i(eit->events); i != eit->events.end(); ++i) { EITEvent *event=*i; LocalEventData led; switch(p) { case 0: led.getLocalData(event, &nowtext, &descr); cur_event_text=nowtext; lb1->setText("akt.Senung: "+nowtext); if (!nowtext.isNull()) val|=1; break; case 1: led.getLocalData(event, &nexttext); lb2->setText("nächt. Sendung: "+nexttext); if (!nexttext.isNull()) val|=2; break; } tm *t=event->start_time!=-1?localtime(&event->start_time):0; eString start=""; if (t && event->duration) { start.sprintf("%02d:%02d", t->tm_hour, t->tm_min); lb3->setText("start: "+start); } eString duration; if (event->duration>0) { duration.sprintf("%d min", event->duration/60); lb4->setText("Dauer akt. Sendung: "+duration); //DAUER } else { duration=""; } switch (p) { case 0: { nowtime=start; lb5->setText("now time: "+nowtime); break; } case 1: { nexttime=start; lb6->setText("next time: "+nexttime); break; } } p++; } } }
löst nur meine aufgaben stellung nicht wirklich.
-
in den sourcen zu e1 habe ich streaminfo.cpp gefunden. daraus habe ich
folgendes gebastelt:C
Alles anzeigen/******************************************************************************* * showInfo - Test *******************************************************************************/ #include <plugin.h> #include <stdio.h> #include <stdlib.h> #include <lib/gui/ewindow.h> #include <lib/gui/ebutton.h> #include <lib/gui/emessage.h> #include <lib/gui/listbox.h> #include <iostream> #include <sys/types.h> #include <sys/dir.h> #include <dirent.h> #include <stdlib.h> #include <lib/base/console.h> #include <lib/dvb/service.h> #include </home/Tom/DreamboxCVS/apps/tuxbox/enigma/src/enigma.h> #include </home/Tom/DreamboxCVS/apps/tuxbox/enigma/src/enigma_main.h> #include <map> #include <time.h> #include <fcntl.h> #include <unistd.h> #include <sys/stat.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <net/if.h> #include <arpa/inet.h> #include <linux/if_ether.h> #include <linux/input.h> #include <iomanip> #include <iostream> #include <fstream> #include <timer.h> #include <enigma_plugins.h> #include <enigma_standby.h> #include <sselect.h> #include <upgrade.h> #include <math.h> #include <lib/dvb/frontend.h> #include <lib/driver/eavswitch.h> #include <lib/dvb/dvb.h> #include <lib/dvb/edvb.h> #include <lib/dvb/epgcache.h> #include <lib/dvb/servicestructure.h> #include <lib/dvb/decoder.h> #include <lib/dvb/dvbservice.h> #include <lib/dvb/service.h> #include <lib/dvb/record.h> #include <lib/dvb/serviceplaylist.h> #include <lib/gdi/fb.h> #include <lib/gdi/glcddc.h> #include <lib/gdi/gfbdc.h> #include <lib/gdi/epng.h> #include <lib/gui/emessage.h> #include <lib/system/http_dyn.h> #include <lib/system/econfig.h> #include <lib/system/info.h> #include <lib/system/dmfp.h> #include <enigma_dyn.h> #include <enigma_dyn_utils.h> #include <epgwindow.h> #include <streaminfo.h> using namespace std; // Funktionen definieren extern "C" int plugin_exec( PluginParam *par ); extern eString getCurService(void); extern eServiceReference string2ref(const eString &service); bool my_playService(const eServiceReference &service); //Fenster class eShowInfo : public eWindow { //private: eLabel *lb1,*lb2,*lb3,*lb4,*lb5, *lb6, *lb7, *lb8, *lb9, *lb10; void eShowInfo::my_setEIT(EIT *eit); int eShowInfo::my_siTags(const eServiceReference &service); public: eShowInfo(); // the constructor. ~eShowInfo(); // the destructor. }; int plugin_exec( PluginParam *par ) { eShowInfo myShowInfo; // our demo dialog instance. myShowInfo.show(); // show the dialog... int result=myShowInfo.exec(); // give control to dialog.. (the dialog is modal!) myShowInfo.hide(); return 0; } /***************************************************************************** * myShowInfo * Fenster wird aufgebaut *****************************************************************************/ eShowInfo::eShowInfo(): eWindow(1) { cmove(ePoint(70, 60)); cresize(eSize(560, 460)); setText("showInfo"); // Label lb1=new eLabel(this); lb1->move(ePoint(10, 10)); lb1->resize(eSize(400, 30)); lb1->loadDeco(); lb1->setText("Label 1"); lb2=new eLabel(this); lb2->move(ePoint(10, 50)); lb2->resize(eSize(400, 30)); lb2->loadDeco(); lb2->setText("Label 2"); lb3=new eLabel(this); lb3->move(ePoint(10, 50+40)); lb3->resize(eSize(400, 30)); lb3->loadDeco(); lb3->setText("Label 3"); lb4=new eLabel(this); lb4->move(ePoint(10, 50+40+40)); lb4->resize(eSize(400, 30)); lb4->loadDeco(); lb4->setText("Label 4"); lb5=new eLabel(this); lb5->move(ePoint(10, 50+40+40+40)); lb5->resize(eSize(400, 30)); lb5->loadDeco(); lb5->setText("Label 5"); lb6=new eLabel(this); lb6->move(ePoint(10, 50+40+40+40+40)); lb6->resize(eSize(400, 30)); lb6->loadDeco(); lb6->setText("Label 6"); lb7=new eLabel(this); lb7->move(ePoint(10, 50+40+40+40+40+40)); lb7->resize(eSize(400, 30)); lb7->loadDeco(); lb7->setText("Label 7"); lb8=new eLabel(this); lb8->move(ePoint(10, 50+40+40+40+40+40+40)); lb8->resize(eSize(400, 30)); lb8->loadDeco(); lb8->setText("Label 8"); lb9=new eLabel(this); lb9->move(ePoint(10, 50+40+40+40+40+40+40+40)); lb9->resize(eSize(400, 30)); lb9->loadDeco(); lb9->setText("Label 9"); lb10=new eLabel(this); lb10->move(ePoint(10, 50+40+40+40+40+40+40+40+40)); lb10->resize(eSize(400, 30)); lb10->loadDeco(); lb10->setText("Label 10"); //my_playService(string2ref("4096:0:0:0:0:0:0:0:0:0:/hdd/mp3/1.mp3")); my_siTags(string2ref("4096:0:0:0:0:0:0:0:0:0:/hdd/mp3/1.mp3")); //eServiceHandler *sapi=eServiceInterface::getInstance()->getService(); //EIT *eit=sapi->getEIT(); //my_setEIT(eit); } eShowInfo::~eShowInfo() { // we have to do almost nothing here. all widgets are automatically removed // since they are child of us. the eWidget-destructor will to this for us. } static eString getDescription(eString tag) { if (tag == "TALB") return _("album"); else if (tag == "TIT2") return _("title"); else if (tag == "TPE1") return _("artist"); else if (tag == "TCON") return _("genre"); else if (tag == "TDRC") return _("year"); else if (tag == "TCOM") return _("composer"); else if (tag == "TRCK") return _("track"); else if (tag == "TLEN") return _("length"); else return tag; } int eShowInfo::my_siTags(const eServiceReference &service) { if (!service->id3) { lb1->setText("!service->id3"); return 0; } int i =0; eString tagString, descrString; for (std::map<eString,eString>::const_iterator i(service->id3->getID3Tags().begin()); i != service->id3->getID3Tags().end(); ++i) { tagString+=getDescription(i->first)+'\n'; lb2->setText(tagString); if ( i->first.find("TLEN") != eString::npos ) { int len = atoi( i->second.c_str() ) / 1000; descrString+=eString().sprintf("%d:%02d", len/60, len%60)+'\n'; lb3->setText(descrString); } else { descrString+=i->second+'\n'; lb4->setText(descrString); } } }
leider bekomme ich beim übersetzen folgende fehlerCodehowinfobar.cpp: In function `int plugin_exec(PluginParam*)': showinfobar.cpp:92: warning: unused variable 'result' showinfobar.cpp: In member function `int eShowInfo::my_siTags(const eServiceReference&)': showinfobar.cpp:206: error: base operand of `->' has non-pointer type `const eServiceReference' showinfobar.cpp:213: error: base operand of `->' has non-pointer type `const eServiceReference' showinfobar.cpp:214: error: base operand of `->' has non-pointer type `const eServiceReference' showinfobar.cpp:216: error: `getDescription' undeclared (first use this function) showinfobar.cpp:216: error: (Each undeclared identifier is reported only once for each function it appears in.) showinfobar.cpp:210: warning: unused variable 'i' make: *** [showinfobar.o] Fehler 1
klappt leider nicht.
es muß doch zuschaffen sein, an die streaminfo zu kommen...... -
ich schieb das mal hoch, weil ich noch keine lösung gefudnen habe. und es doch wichtig für mich wäre......
-
sorry, hatte deine letzten postings irgendwie übersehen. ich schau mal, ob ich was rauskriege.
-
vielen Dank =). Ich habe dir mal ein mal ein paar Screenshots angehängt. Die zeigen, wie weit ich bis jetzt bin. =)
-
hier mal ein erster screenshot. code folgt, sobald ich es fertig habe.
-
Tyrel: Eventuell solltest du auf deinem Ersten Screenshot das "cam" ausblenden ... ich wollt's ja nur mal anmerken ...
Olove
-
-
Olove: Danke für den Hinweis ;).
dre: Super =) :] . Dein Screenschot sieht ja schon richtig gut und sehr vielversprechend aus. Ich bin begeistert. =)
Ich verwende eine feste Adresse
der stream läuft, ich habe ihn gerade eben nochmals mit amarok getestetim plugin selbst wird diese url wie folgt ausgerufen:
Code
Alles anzeigen... my_playService(string2ref("4096:0:0:0:0:0:0:0:0:0:http://208.53.158.126:7014")); .... bool my_playService(const eServiceReference &ref) { // ignore locked service if (ref.isLocked() && eConfig::getInstance()->pLockActive()) return false; eZapMain::getInstance()->playService(ref, eZapMain::psSetMode|eZapMain::psDontAdd); return true; }
-
hier mal der code, wie es mit TV & MP3 funktioniert (noch nicht mit deinem Stream!)
C
Alles anzeigen/******************************************************************************* * showInfo - Test *******************************************************************************/ #include <plugin.h> #include <stdio.h> #include <stdlib.h> #include <lib/gui/ewindow.h> #include <lib/gui/ebutton.h> #include <lib/gui/emessage.h> #include <lib/gui/listbox.h> #include <iostream> #include <sys/types.h> #include <sys/dir.h> #include <dirent.h> #include <stdlib.h> #include <lib/base/console.h> #include <lib/dvb/service.h> #include <enigma.h> #include <enigma_main.h> #include <map> #include <time.h> #include <fcntl.h> #include <unistd.h> #include <sys/stat.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <net/if.h> #include <arpa/inet.h> #include <linux/if_ether.h> #include <linux/input.h> #include <iomanip> #include <iostream> #include <fstream> #include <timer.h> #include <enigma_plugins.h> #include <enigma_standby.h> #include <sselect.h> #include <upgrade.h> #include <math.h> #include <lib/dvb/frontend.h> #include <lib/driver/eavswitch.h> #include <lib/dvb/dvb.h> #include <lib/dvb/edvb.h> #include <lib/dvb/epgcache.h> #include <lib/dvb/servicestructure.h> #include <lib/dvb/decoder.h> #include <lib/dvb/dvbservice.h> #include <lib/dvb/service.h> #include <lib/dvb/record.h> #include <lib/dvb/serviceplaylist.h> #include <lib/gdi/fb.h> #include <lib/gdi/glcddc.h> #include <lib/gdi/gfbdc.h> #include <lib/gdi/epng.h> #include <lib/gui/emessage.h> #include <lib/system/http_dyn.h> #include <lib/system/econfig.h> #include <lib/system/info.h> #include <lib/system/dmfp.h> #include <enigma_dyn.h> #include <enigma_dyn_utils.h> #include <epgwindow.h> #include <streaminfo.h> #include <lib/dvb/servicemp3.h> using namespace std; // Funktionen definieren extern "C" int plugin_exec( PluginParam *par ); extern eString getCurService(void); extern eServiceReference string2ref(const eString &service); bool my_playService(const eServiceReference &service); //Fenster class eShowInfo : public eWindow { //private: eLabel *lb1,*lb2,*lb3,*lb4,*lb5, *lb6, *lb7, *lb8, *lb9, *lb10; void eShowInfo::my_setEIT(EIT *eit); public: eShowInfo(); // the constructor. ~eShowInfo(); // the destructor. }; int plugin_exec( PluginParam *par ) { eShowInfo myShowInfo; // our demo dialog instance. myShowInfo.show(); // show the dialog... myShowInfo.exec(); // give control to dialog.. (the dialog is modal!) myShowInfo.hide(); return 0; } /***************************************************************************** * myShowInfo * Fenster wird aufgebaut *****************************************************************************/ eShowInfo::eShowInfo(): eWindow(1) { cmove(ePoint(70, 60)); cresize(eSize(560, 460)); setText("showInfo"); // Label lb1=new eLabel(this); lb1->move(ePoint(10, 10)); lb1->resize(eSize(400, 30)); lb1->loadDeco(); lb1->setText("Label 1"); lb2=new eLabel(this); lb2->move(ePoint(10, 50)); lb2->resize(eSize(400, 30)); lb2->loadDeco(); lb2->setText("Label 2"); lb3=new eLabel(this); lb3->move(ePoint(10, 50+40)); lb3->resize(eSize(400, 30)); lb3->loadDeco(); lb3->setText("Label 3"); lb4=new eLabel(this); lb4->move(ePoint(10, 50+40+40)); lb4->resize(eSize(400, 30)); lb4->loadDeco(); lb4->setText("Label 4"); lb5=new eLabel(this); lb5->move(ePoint(10, 50+40+40+40)); lb5->resize(eSize(400, 30)); lb5->loadDeco(); lb5->setText("Label 5"); lb6=new eLabel(this); lb6->move(ePoint(10, 50+40+40+40+40)); lb6->resize(eSize(400, 30)); lb6->loadDeco(); lb6->setText("Label 6"); lb7=new eLabel(this); lb7->move(ePoint(10, 50+40+40+40+40+40)); lb7->resize(eSize(400, 30)); lb7->loadDeco(); lb7->setText("Label 7"); lb8=new eLabel(this); lb8->move(ePoint(10, 50+40+40+40+40+40+40)); lb8->resize(eSize(400, 30)); lb8->loadDeco(); lb8->setText("Label 8"); lb9=new eLabel(this); lb9->move(ePoint(10, 50+40+40+40+40+40+40+40)); lb9->resize(eSize(400, 30)); lb9->loadDeco(); lb9->setText("Label 9"); lb10=new eLabel(this); lb10->move(ePoint(10, 50+40+40+40+40+40+40+40+40)); lb10->resize(eSize(400, 30)); lb10->loadDeco(); lb10->setText("Label 10"); eServiceReference &myref = eServiceInterface::getInstance()->service; eServiceHandler *sapi=eServiceInterface::getInstance()->getService(); eService *service = eServiceInterface::getInstance()->addRef(myref); if( service && service->id3 ) { std::map<eString,eString> &tags = service->id3->getID3Tags(); eString artist="unknown", album="unknown", title="", num=""; if (tags.count("TALB")) album=tags.find("TALB")->second; if (tags.count("TIT2")) title=tags.find("TIT2")->second; if (tags.count("TPE1")) artist=tags.find("TPE1")->second; if (tags.count("TRCK")) num=tags.find("TRCK")->second; lb1->setText("Interpret: " + artist); lb2->setText("Album: " + album); lb3->setText("Song: " + title); lb4->setText("Nummer: " + num); } else { EIT *eit=sapi->getEIT(); my_setEIT(eit); } } eShowInfo::~eShowInfo() { // we have to do almost nothing here. all widgets are automatically removed // since they are child of us. the eWidget-destructor will to this for us. } void eShowInfo::my_setEIT(EIT *eit) { eString cur_event_text=""; if (eit) { eString nowtext, nexttext, nowtime="", nexttime="", descr; int val=0; int p=0; for (ePtrList<EITEvent>::iterator i(eit->events); i != eit->events.end(); ++i) { EITEvent *event=*i; LocalEventData led; switch(p) { case 0: led.getLocalData(event, &nowtext, &descr); cur_event_text=nowtext; lb1->setText("akt.Senung: "+nowtext); if (!nowtext.isNull()) val|=1; break; case 1: led.getLocalData(event, &nexttext); lb2->setText("nächt. Sendung: "+nexttext); if (!nexttext.isNull()) val|=2; break; } tm *t=event->start_time!=-1?localtime(&event->start_time):0; eString start=""; if (t && event->duration) { start.sprintf("%02d:%02d", t->tm_hour, t->tm_min); lb3->setText("start: "+start); } eString duration; if (event->duration>0) { duration.sprintf("%d min", event->duration/60); lb4->setText("Dauer akt. Sendung: "+duration); //DAUER } else { duration=""; } switch (p) { case 0: { nowtime=start; lb5->setText("now time: "+nowtime); break; } case 1: { nexttime=start; lb6->setText("next time: "+nexttime); break; } } p++; } } }
-
Hi Dre,
super. Es geht für mp3s wie genial. Ich bin total happy. Danke. =).