X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/d9ee52e4f0fbe9a1ae00d0e66f9e6f0a07fa319f..e330dbae62e83dd2aa2ff63a984519a84b23c3ad:/lib/nav/core.cpp diff --git a/lib/nav/core.cpp b/lib/nav/core.cpp index 10d18e32..45771f15 100644 --- a/lib/nav/core.cpp +++ b/lib/nav/core.cpp @@ -14,11 +14,10 @@ void eNavigation::serviceEvent(iPlayableService* service, int event) case iPlayableService::evEnd: assert(m_playlist); /* we need to have a playlist */ - /* at first, kill the running service */ - m_event(this, evStopService); - m_runningService = 0; - m_service_event_conn = 0; - /* our running main service stopped. identify what to do next. */ + /* at first, kill the running service */ + stopService(); + + /* our running main service stopped. identify what to do next. */ /* unless the playlist current position is invalid (because there was */ /* playlist, for example when the service was engaged with playService */ @@ -41,6 +40,9 @@ void eNavigation::serviceEvent(iPlayableService* service, int event) case iPlayableService::evStart: m_event(this, evNewService); break; + case iPlayableService::evUpdatedEventInfo: + m_event(this, evUpdatedEventInfo); + break; default: break; } @@ -48,6 +50,8 @@ void eNavigation::serviceEvent(iPlayableService* service, int event) RESULT eNavigation::playService(const eServiceReference &service) { + stopService(); + assert(m_servicehandler); RESULT res = m_servicehandler->play(service, m_runningService); if (m_runningService) @@ -97,6 +101,30 @@ RESULT eNavigation::getPlaylist(ePtr &playlist) return 0; } +RESULT eNavigation::stopService(void) +{ + /* check if there is a running service... */ + if (!m_runningService) + return 1; + /* send stop event */ + m_event(this, evStopService); + + /* kill service. */ + m_runningService = 0; + m_service_event_conn = 0; + return 0; +} + +RESULT eNavigation::recordService(const eServiceReference &ref, ePtr &service) +{ + assert(m_servicehandler); + RESULT res = m_servicehandler->record(ref, service); + eDebug("record: %d", res); + if (res) + service = 0; + return res; +} + RESULT eNavigation::pause(int dop) { if (!m_runningService)