added nav core
authorFelix Domke <tmbinc@elitedvb.net>
Sun, 23 May 2004 10:39:21 +0000 (10:39 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Sun, 23 May 2004 10:39:21 +0000 (10:39 +0000)
13 files changed:
configure.ac
lib/Makefile.am
lib/dvb/dvb.cpp
lib/nav/Makefile.am [new file with mode: 0644]
lib/nav/core.cpp [new file with mode: 0644]
lib/nav/core.h [new file with mode: 0644]
lib/service/iservice.h
lib/service/servicedvb.cpp
lib/service/servicedvb.h
lib/service/servicemp3.cpp
lib/service/servicemp3.h
main/Makefile.am
main/enigma.cpp

index 54d97899c526f60b88ed72d66cba9d0f9d0f7b05..19dee31b897011a519980f4c1ca5439db9af8c6a 100644 (file)
@@ -9,14 +9,14 @@ AC_PROG_CXX
 AC_PROG_RANLIB
 
 TUXBOX_APPS_DVB
 AC_PROG_RANLIB
 
 TUXBOX_APPS_DVB
-TUXBOX_APPS_DRIVER
+#TUXBOX_APPS_DRIVER
 
 TUXBOX_APPS_LIB_CONFIG(FREETYPE,freetype-config)
 
 TUXBOX_APPS_LIB_CONFIG(FREETYPE,freetype-config)
-TUXBOX_APPS_LIB_PKGCONFIG(FRIBIDI,fribidi)
+#TUXBOX_APPS_LIB_PKGCONFIG(FRIBIDI,fribidi)
 TUXBOX_APPS_LIB_PKGCONFIG(ID3TAG,id3tag)
 TUXBOX_APPS_LIB_PKGCONFIG(MAD,mad)
 TUXBOX_APPS_LIB_PKGCONFIG(MD5SUM,tuxbox-md5sum)
 TUXBOX_APPS_LIB_PKGCONFIG(ID3TAG,id3tag)
 TUXBOX_APPS_LIB_PKGCONFIG(MAD,mad)
 TUXBOX_APPS_LIB_PKGCONFIG(MD5SUM,tuxbox-md5sum)
-TUXBOX_APPS_LIB_PKGCONFIG(PLUGINS,tuxbox-plugins)
+#TUXBOX_APPS_LIB_PKGCONFIG(PLUGINS,tuxbox-plugins)
 TUXBOX_APPS_LIB_PKGCONFIG(PNG,libpng)
 TUXBOX_APPS_LIB_PKGCONFIG(SIGC,sigc++-1.2)
 TUXBOX_APPS_LIB_PKGCONFIG(XMLTREE,tuxbox-xmltree)
 TUXBOX_APPS_LIB_PKGCONFIG(PNG,libpng)
 TUXBOX_APPS_LIB_PKGCONFIG(SIGC,sigc++-1.2)
 TUXBOX_APPS_LIB_PKGCONFIG(XMLTREE,tuxbox-xmltree)
@@ -35,6 +35,7 @@ lib/dvb/Makefile
 lib/dvb_si/Makefile
 lib/gdi/Makefile
 lib/gui/Makefile
 lib/dvb_si/Makefile
 lib/gdi/Makefile
 lib/gui/Makefile
+lib/nav/Makefile
 lib/network/Makefile
 lib/service/Makefile
 main/Makefile
 lib/network/Makefile
 lib/service/Makefile
 main/Makefile
index 7811ca1fc102c8cd96998e7155fb5a5ed948433c..c4197e31e3f6843c0f92c620f8e1adf58171d98b 100644 (file)
@@ -1,3 +1,4 @@
-SUBDIRS = base  dvb dvb_si gdi  gui  network  service driver 
+SUBDIRS = base  dvb dvb_si gdi  gui  network  service driver nav
+
 
 
 
 
index 176b07c5633a43e0e0b88a1312e413878c60fa2a..895ff0843ea35d82a0025421e573e7f1f5602029 100644 (file)
@@ -180,7 +180,7 @@ RESULT eDVBChannel::setChannel(const eDVBChannelID &channelid)
 
 RESULT eDVBChannel::connectStateChange(const Slot1<void,iDVBChannel*> &stateChange, ePtr<eConnection> &connection)
 {
 
 RESULT eDVBChannel::connectStateChange(const Slot1<void,iDVBChannel*> &stateChange, ePtr<eConnection> &connection)
 {
-       connection = new eConnection(   m_stateChanged.connect(stateChange) );
+       connection = new eConnection(m_stateChanged.connect(stateChange));
        return 0;
 }
 
        return 0;
 }
 
diff --git a/lib/nav/Makefile.am b/lib/nav/Makefile.am
new file mode 100644 (file)
index 0000000..a180e0b
--- /dev/null
@@ -0,0 +1,8 @@
+INCLUDES = \
+       -I$(top_srcdir)/include
+
+noinst_LIBRARIES = libenigma_nav.a
+
+libenigma_nav_a_SOURCES = \
+       core.cpp
+       
diff --git a/lib/nav/core.cpp b/lib/nav/core.cpp
new file mode 100644 (file)
index 0000000..b5c229c
--- /dev/null
@@ -0,0 +1,88 @@
+#include <lib/nav/core.h>
+
+void eNavigation::serviceEvent(iPlayableService* service, int event)
+{
+       if (service != m_runningService)
+       {
+               eDebug("nav: event for other service");
+               return;
+       }
+
+       switch (event)
+       {
+       case iPlayableService::evEnd:
+                       /* our running main service stopped. */
+               if (!m_playlist.empty())
+                       m_playlist.erase(m_playlist.begin());
+               if (!m_playlist.empty())
+               {
+                       RESULT res;
+                       res = playService(m_playlist.front());
+                       if (res)
+                               m_event(this, evPlayFailed);
+               } else
+                       m_event(this, evPlaylistDone);
+               break;
+       case iPlayableService::evStart:
+               m_event(this, evNewService);
+               break;
+       default:
+               break;
+       }
+}
+
+RESULT eNavigation::playService(const eServiceReference &service)
+{
+       RESULT res = m_servicehandler->play(service, m_runningService);
+       if (m_runningService)
+       {
+               m_runningService->connectEvent(slot(*this, &eNavigation::serviceEvent), m_service_event_conn);
+               res = m_runningService->start();
+       }
+       return res;
+}
+
+RESULT eNavigation::enqueueService(const eServiceReference &service)
+{
+       int doplay = m_playlist.empty();
+       m_playlist.push_back(service);
+       if (doplay)
+               return playService(m_playlist.front());
+       return 0;
+}
+
+RESULT eNavigation::connectEvent(const Slot2<void,eNavigation*,int> &event, ePtr<eConnection> &connection)
+{
+       connection = new eConnection(m_event.connect(event));
+       return 0;
+}
+
+RESULT eNavigation::getCurrentService(ePtr<iPlayableService> &service)
+{
+       service = m_runningService;
+       return 0;
+}
+
+RESULT eNavigation::pause(int dop)
+{
+       if (!m_runningService)
+               return -1;
+       ePtr<iPauseableService> p;
+       if (m_runningService->getIPausableService(p))
+               return -2;
+       if (dop)
+               return p->pause();
+       else
+               return p->unpause();
+}
+
+eNavigation::eNavigation(iServiceHandler *serviceHandler)
+{
+       m_servicehandler = serviceHandler;
+}
+
+eNavigation::~eNavigation()
+{
+}
+
+DEFINE_REF(eNavigation);
diff --git a/lib/nav/core.h b/lib/nav/core.h
new file mode 100644 (file)
index 0000000..056c150
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef __nav_core_h
+#define __nav_core_h
+
+#include <lib/base/object.h>
+#include <lib/service/iservice.h>
+#include <connection.h>
+
+class eNavigation: public iObject, public Object
+{
+       DECLARE_REF;
+private:
+       ePtr<iPlayableService> m_runningService;
+       ePtr<iServiceHandler> m_servicehandler;
+       Signal2<void,eNavigation*,int> m_event;
+       ePtr<eConnection> m_service_event_conn;
+       void serviceEvent(iPlayableService* service, int event);
+       
+       std::list<eServiceReference> m_playlist;
+public:
+       enum
+       {
+               evNewService,
+               evPlayFailed,
+               evPlaylistDone
+       };
+       RESULT playService(const eServiceReference &service);
+       RESULT enqueueService(const eServiceReference &service);
+       RESULT connectEvent(const Slot2<void,eNavigation*,int> &event, ePtr<eConnection> &connection);
+/*     int connectServiceEvent(const Slot1<void,iPlayableService*,int> &event, ePtr<eConnection> &connection); */
+       RESULT getCurrentService(ePtr<iPlayableService> &service);
+       
+       RESULT pause(int p);
+       eNavigation(iServiceHandler *serviceHandler);
+       virtual ~eNavigation();
+};
+
+#endif
index bedb0d6f583fe148e881e8ad4dda377f37e76e6c..9eeb07c8ba5be48b9312a98a11e2099e2e01a63a 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <lib/base/object.h>
 #include <lib/base/estring.h>
 
 #include <lib/base/object.h>
 #include <lib/base/estring.h>
+#include <connection.h>
 #include <list>
 
 class eServiceReference
 #include <list>
 
 class eServiceReference
@@ -133,6 +134,12 @@ public:
        }
 };
 
        }
 };
 
+class iServiceInformation: public virtual iObject
+{
+public:
+       virtual RESULT getName(eString &name)=0;
+};
+
 class iPauseableService: public virtual iObject
 {
 public:
 class iPauseableService: public virtual iObject
 {
 public:
@@ -144,9 +151,16 @@ class iPlayableService: public virtual iObject
 {
        friend class iServiceHandler;
 public:
 {
        friend class iServiceHandler;
 public:
-               // it's PRIVATE to the class factory
+       enum
+       {
+               evStart,
+               evEnd
+       };
+       virtual RESULT connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection)=0;
        virtual RESULT start()=0;
        virtual RESULT start()=0;
+       virtual RESULT stop()=0;
        virtual RESULT getIPausableService(ePtr<iPauseableService> &ptr)=0;
        virtual RESULT getIPausableService(ePtr<iPauseableService> &ptr)=0;
+       virtual RESULT getIServiceInformation(ePtr<iServiceInformation> &ptr)=0;
 };
 
 class iRecordableService: public virtual iObject
 };
 
 class iRecordableService: public virtual iObject
index fc48fa66cdef80c35ea9d005daf4f006a17bddaf..62dbee5456918c429cc6ec3bc629245fc928eec5 100644 (file)
@@ -28,15 +28,8 @@ eServiceFactoryDVB::~eServiceFactoryDVB()
 
 RESULT eServiceFactoryDVB::play(const eServiceReference &ref, ePtr<iPlayableService> &ptr)
 {
 
 RESULT eServiceFactoryDVB::play(const eServiceReference &ref, ePtr<iPlayableService> &ptr)
 {
-       RESULT res;
                // check resources...
        ptr = new eDVBServicePlay(ref);
                // check resources...
        ptr = new eDVBServicePlay(ref);
-       res = ptr->start();
-       if (res)
-       {
-               ptr = 0;
-               return res;
-       }
        return 0;
 }
 
        return 0;
 }
 
@@ -138,10 +131,20 @@ void eDVBServicePlay::serviceEvent(int event)
 RESULT eDVBServicePlay::start()
 {
        eDebug("starting DVB service");
 RESULT eDVBServicePlay::start()
 {
        eDebug("starting DVB service");
-       m_serviceHandler.tune((eServiceReferenceDVB&)m_reference);
+       return m_serviceHandler.tune((eServiceReferenceDVB&)m_reference);
+}
+
+RESULT eDVBServicePlay::stop()
+{
+       eDebug("stopping..");
        return 0;
 }
 
        return 0;
 }
 
+RESULT eDVBServicePlay::connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection)
+{
+       return -1;
+}
+
 RESULT eDVBServicePlay::getIPausableService(ePtr<iPauseableService> &ptr)
 {
                // not yet possible, maybe later...
 RESULT eDVBServicePlay::getIPausableService(ePtr<iPauseableService> &ptr)
 {
                // not yet possible, maybe later...
@@ -149,6 +152,18 @@ RESULT eDVBServicePlay::getIPausableService(ePtr<iPauseableService> &ptr)
        return -1;
 }
 
        return -1;
 }
 
+RESULT eDVBServicePlay::getIServiceInformation(ePtr<iServiceInformation> &ptr)
+{
+       ptr = this;
+       return 0;
+}
+
+RESULT eDVBServicePlay::getName(eString &name)
+{
+       name = "DVB service";
+       return 0;
+}
+
 DEFINE_REF(eDVBServicePlay)
 
 eAutoInitP0<eServiceFactoryDVB> init_eServiceFactoryDVB(eAutoInitNumbers::service+1, "eServiceFactoryDVB");
 DEFINE_REF(eDVBServicePlay)
 
 eAutoInitP0<eServiceFactoryDVB> init_eServiceFactoryDVB(eAutoInitNumbers::service+1, "eServiceFactoryDVB");
index fac9edf27ecb7676bb7d476003c2eef897c28975..1de4586c6cbd0bec37f6013fec4744d14250bab8 100644 (file)
@@ -20,7 +20,7 @@ public:
        RESULT list(const eServiceReference &, ePtr<iListableService> &ptr);
 };
 
        RESULT list(const eServiceReference &, ePtr<iListableService> &ptr);
 };
 
-class eDVBServicePlay: public virtual iPlayableService, public virtual iObject, public Object
+class eDVBServicePlay: public virtual iPlayableService, public virtual iObject, public Object, public virtual iServiceInformation
 {
 DECLARE_REF;
 private:
 {
 DECLARE_REF;
 private:
@@ -38,8 +38,14 @@ public:
        virtual ~eDVBServicePlay();
 
                // iPlayableService
        virtual ~eDVBServicePlay();
 
                // iPlayableService
+       RESULT connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection);
        RESULT start();
        RESULT start();
+       RESULT stop();
        RESULT getIPausableService(ePtr<iPauseableService> &ptr);
        RESULT getIPausableService(ePtr<iPauseableService> &ptr);
+       RESULT getIServiceInformation(ePtr<iServiceInformation> &ptr);
+       
+               // iServiceInformation
+       RESULT getName(eString &name);
 };
 
 #endif
 };
 
 #endif
index fb5993e418e7d49f3446d867c140f54bf2b7ed1b..27ae1147882a02d6bb5eeeda8a5cc006b031fdbb 100644 (file)
@@ -1,5 +1,6 @@
 #include <lib/base/eerror.h>
 #include <lib/base/object.h>
 #include <lib/base/eerror.h>
 #include <lib/base/object.h>
+#include <lib/base/ebase.h>
 #include <string>
 #include <lib/service/servicemp3.h>
 #include <lib/service/service.h>
 #include <string>
 #include <lib/service/servicemp3.h>
 #include <lib/service/service.h>
@@ -31,15 +32,8 @@ DEFINE_REF(eServiceFactoryMP3)
        // iServiceHandler
 RESULT eServiceFactoryMP3::play(const eServiceReference &ref, ePtr<iPlayableService> &ptr)
 {
        // iServiceHandler
 RESULT eServiceFactoryMP3::play(const eServiceReference &ref, ePtr<iPlayableService> &ptr)
 {
-       RESULT res;
                // check resources...
        ptr = new eServiceMP3(ref.path.c_str());
                // check resources...
        ptr = new eServiceMP3(ref.path.c_str());
-       res = ptr->start();
-       if (res)
-       {
-               ptr = 0;
-               return res;
-       }
        return 0;
 }
 
        return 0;
 }
 
@@ -57,33 +51,65 @@ RESULT eServiceFactoryMP3::list(const eServiceReference &, ePtr<iListableService
 
 // eServiceMP3
 
 
 // eServiceMP3
 
-eServiceMP3::eServiceMP3(const char *filename): filename(filename), ref(0)
+
+void eServiceMP3::test_end()
 {
 {
-       printf("MP3: %s start\n", filename);
+       eDebug("end of mp3!");
+       stop();
+}
+
+eServiceMP3::eServiceMP3(const char *filename): ref(0), filename(filename), test(eApp)
+{
+       m_state = stIdle;
 }
 
 eServiceMP3::~eServiceMP3()
 {
 }
 
 eServiceMP3::~eServiceMP3()
 {
-       printf("MP3: %s stop\n", filename.c_str());
+       if (m_state == stRunning)
+               stop();
 }
 }
-       
-void eServiceMP3::AddRef()
+
+DEFINE_REF(eServiceMP3);       
+
+RESULT eServiceMP3::connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection)
+{
+       connection = new eConnection(m_event.connect(event));
+       return 0;
+}
+
+RESULT eServiceMP3::start()
 {
 {
-       ++ref;
+       assert(m_state == stIdle);
+       
+       m_state = stRunning;
+
+       printf("mp3 starts\n");
+       printf("MP3: %s start\n", filename.c_str());
+       test.start(10000, 1);
+       CONNECT(test.timeout, eServiceMP3::test_end);
+       m_event(this, evStart);
+       return 0;
 }
 
 }
 
-void eServiceMP3::Release()
+RESULT eServiceMP3::stop()
 {
 {
-       if (!--ref)
-               delete this;
+       assert(m_state != stIdle);
+       if (m_state == stStopped)
+               return -1;
+       test.stop();
+       printf("MP3: %s stop\n", filename.c_str());
+       m_state = stStopped;
+       m_event(this, evEnd);
+       return 0;
 }
 
 }
 
-RESULT eServiceMP3::start() { printf("mp3 starts\n"); return 0; }
 RESULT eServiceMP3::getIPausableService(ePtr<iPauseableService> &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::getIPausableService(ePtr<iPauseableService> &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::getIServiceInformation(ePtr<iServiceInformation>&) { return -1; }
+
 
 eAutoInitP0<eServiceFactoryMP3> init_eServiceFactoryMP3(eAutoInitNumbers::service+1, "eServiceFactoryMP3");
 
 eAutoInitP0<eServiceFactoryMP3> init_eServiceFactoryMP3(eAutoInitNumbers::service+1, "eServiceFactoryMP3");
index 0f2c074fcea84e74f9cc6ac2953efc2c5f12a6bb..b443d6ebfec973817bfe21f9858a1e8302b29d32 100644 (file)
@@ -17,26 +17,35 @@ public:
        RESULT list(const eServiceReference &, ePtr<iListableService> &ptr);
 };
 
        RESULT list(const eServiceReference &, ePtr<iListableService> &ptr);
 };
 
-class eServiceMP3: public virtual iPlayableService, public virtual iPauseableService, public virtual iObject
+class eServiceMP3: public virtual iPlayableService, public virtual iPauseableService, public virtual iObject, public Object
 {
 {
+DECLARE_REF;
+private:
        friend class eServiceFactoryMP3;
        std::string filename;
        eServiceMP3(const char *filename);      
        friend class eServiceFactoryMP3;
        std::string filename;
        eServiceMP3(const char *filename);      
-       int ref;
+       eTimer test;
+       void test_end();
+       Signal2<void,iPlayableService*,int> m_event;
+       enum
+       {
+               stIdle, stRunning, stStopped,
+       };
+       int m_state;
 public:
        virtual ~eServiceMP3();
 
 public:
        virtual ~eServiceMP3();
 
-               // iObject
-       void AddRef();
-       void Release();
-
                // iPlayableService
                // iPlayableService
+       RESULT connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection);
        RESULT start();
        RESULT start();
+       RESULT stop();
        RESULT getIPausableService(ePtr<iPauseableService> &ptr);
 
                // iPausableService
        RESULT pause();
        RESULT unpause();
        RESULT getIPausableService(ePtr<iPauseableService> &ptr);
 
                // iPausableService
        RESULT pause();
        RESULT unpause();
+       
+       RESULT getIServiceInformation(ePtr<iServiceInformation>&);
 };
 
 #endif
 };
 
 #endif
index 2f63dff1297063882cc92579f86c12134eba1138..1e663e76d892a88c3ff4e62efc325aed75fbdc68 100644 (file)
@@ -13,6 +13,7 @@ enigma2_LDADD_WHOLE = \
        $(top_builddir)/lib/dvb_si/libenigma_dvb_si.a \
        $(top_builddir)/lib/gui/libenigma_gui.a \
        $(top_builddir)/lib/gdi/libenigma_gdi.a \
        $(top_builddir)/lib/dvb_si/libenigma_dvb_si.a \
        $(top_builddir)/lib/gui/libenigma_gui.a \
        $(top_builddir)/lib/gdi/libenigma_gdi.a \
+       $(top_builddir)/lib/nav/libenigma_nav.a \
        $(top_builddir)/lib/network/libenigma_network.a \
        $(top_builddir)/lib/service/libenigma_service.a
 
        $(top_builddir)/lib/network/libenigma_network.a \
        $(top_builddir)/lib/service/libenigma_service.a
 
index 7543e451496d36ce5d6a8e88badf8afcf97f775f..4cc8eaf96c8c753453fe9ae18fd74dc79f94b939 100644 (file)
@@ -14,6 +14,7 @@
 #include <unistd.h>
 
 #include <lib/service/iservice.h>
 #include <unistd.h>
 
 #include <lib/service/iservice.h>
+#include <lib/nav/core.h>
 
 class eMain: public eApplication, public Object
 {
 
 class eMain: public eApplication, public Object
 {
@@ -24,6 +25,8 @@ class eMain: public eApplication, public Object
        ePtr<eDVBDB> m_dvbdb;
 
        ePtr<iPlayableService> m_playservice;
        ePtr<eDVBDB> m_dvbdb;
 
        ePtr<iPlayableService> m_playservice;
+       ePtr<eNavigation> m_nav;
+       ePtr<eConnection> m_conn_event;
 public:
        eMain()
        {
 public:
        eMain()
        {
@@ -35,6 +38,8 @@ public:
                ePtr<eServiceCenter> service_center;
                eServiceCenter::getInstance(service_center);
 
                ePtr<eServiceCenter> service_center;
                eServiceCenter::getInstance(service_center);
 
+               m_nav = new eNavigation(service_center);
+#if 1
                if (service_center)
                {
                        eServiceReference ref("2:0:1:0:0:0:0:0:0:0:/");
                if (service_center)
                {
                        eServiceReference ref("2:0:1:0:0:0:0:0:0:0:/");
@@ -52,17 +57,58 @@ public:
                                                eDebug("%s", i->toString().c_str());
                        }
                }
                                                eDebug("%s", i->toString().c_str());
                        }
                }
+#endif         
+               m_nav->connectEvent(slot(*this, &eMain::event), m_conn_event);
                
                
-               eServiceReference ref("1:0:1:6de2:44d:1:c00000:0:0:0:");
+//             eServiceReference ref("1:0:1:6de2:44d:1:c00000:0:0:0:");
+               eServiceReference ref("4097:47:0:0:0:0:0:0:0:0:/sine_60s_100.mp3");
+               eServiceReference ref1("4097:47:0:0:0:0:0:0:0:0:/sine_60s_100.mp31");
+               eServiceReference ref2("4097:47:0:0:0:0:0:0:0:0:/sine_60s_100.mp32");
                
                
-               if (service_center)
+               if (m_nav->enqueueService(ref))
+                       eDebug("play sucked around!");
+               else
+                       eDebug("play r00lz!");
+
+               m_nav->enqueueService(ref1);
+               m_nav->enqueueService(ref2);
+               m_nav->enqueueService(ref1);
+       }
+       
+       void event(eNavigation *nav, int ev)
+       {
+               switch (ev)
                {
                {
-                       if (service_center->play(ref, m_playservice))
-                               eDebug("play sucked around!");
-                       else
-                               eDebug("play r00lz!");
-               } else
-                       eDebug("no service center: no play.");
+               case eNavigation::evNewService:
+               {
+                       ePtr<iPlayableService> service;
+                       nav->getCurrentService(service);
+                       if (!service)
+                       {
+                               eDebug("no running service!");
+                               break;
+                       }
+                       ePtr<iServiceInformation> s;
+                       if (service->getIServiceInformation(s))
+                       {
+                               eDebug("failed to get iserviceinformation");
+                               break;
+                       }
+                       eString name;
+                       s->getName(name);
+                       eDebug("NEW running service: %s", name.c_str());
+                       break;
+               }
+               case eNavigation::evPlayFailed:
+                       eDebug("play failed!");
+                       break;
+               case eNavigation::evPlaylistDone:
+                       eDebug("playlist done");
+                       break;
+               default:
+                       eDebug("Navigation event %d", ev);
+                       break;
+               }
        }
        
        ~eMain()
        }
        
        ~eMain()