add isCurrentlSeekable to iPlayableService
authorFelix Domke <tmbinc@elitedvb.net>
Fri, 27 Jan 2006 23:56:49 +0000 (23:56 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Fri, 27 Jan 2006 23:56:49 +0000 (23:56 +0000)
lib/service/iservice.h
lib/service/servicedvb.cpp
lib/service/servicedvb.h

index bc8d0244a3ceccd2ec5636d446cd32824132c509..2f489b172c47fade11f2ff75b77796cd4c8daf2e 100644 (file)
@@ -310,6 +310,7 @@ public:
                /* if you want to do several seeks in a row, you can enable the trickmode. 
                   audio will be switched off, sync will be disabled etc. */
        virtual RESULT setTrickmode(int trick=0)=0;
+       virtual RESULT isCurrentlySeekable()=0;
 };
 
 TEMPLATE_TYPEDEF(ePtr<iSeekableService>, iSeekableServicePtr);
index 7beb6c2506ab137f63e850ca3a6456e35367cb78..650b609e16713d6fd4784cbe3748e0a588857d39 100644 (file)
@@ -712,7 +712,7 @@ RESULT eDVBServicePlay::setFastForward(int ratio)
     
 RESULT eDVBServicePlay::seek(ePtr<iSeekableService> &ptr)
 {
-       if (m_is_pvr || m_timeshift_active)
+       if (m_is_pvr || m_timeshift_enabled)
        {
                ptr = this;
                return 0;
@@ -722,15 +722,13 @@ RESULT eDVBServicePlay::seek(ePtr<iSeekableService> &ptr)
        return -1;
 }
 
+       /* TODO: when timeshift is enabled but not active, this doesn't work. */
 RESULT eDVBServicePlay::getLength(pts_t &len)
 {
        ePtr<iDVBPVRChannel> pvr_channel;
        
-       if (m_service_handler.getPVRChannel(pvr_channel))
-       {
-               eDebug("getPVRChannel failed!");
+       if ((m_timeshift_enabled ? m_service_handler_timeshift : m_service_handler).getPVRChannel(pvr_channel))
                return -1;
-       }
        
        return pvr_channel->getLength(len);
 }
@@ -815,6 +813,11 @@ RESULT eDVBServicePlay::setTrickmode(int trick)
        return 0;
 }
 
+RESULT eDVBServicePlay::isCurrentlySeekable()
+{
+       return m_is_pvr || m_timeshift_active;
+}
+
 RESULT eDVBServicePlay::frontendStatusInfo(ePtr<iFrontendStatusInformation> &ptr)
 {
        ptr = this;
@@ -1140,6 +1143,7 @@ RESULT eDVBServicePlay::stopTimeshift()
        m_record = 0;
        
        close(m_timeshift_fd);
+       eDebug("remove timeshift file");
        remove(m_timeshift_file.c_str());
        
        return 0;
index 2929397a7eef10527fad93c33fb4d89351e35a68..a07e4410b7b0515840ff2062a85a630f640d533f 100644 (file)
@@ -88,6 +88,7 @@ public:
        RESULT seekRelative(int direction, pts_t to);
        RESULT getPlayPosition(pts_t &pos);
        RESULT setTrickmode(int trick=0);
+       RESULT isCurrentlySeekable();
 
                // iServiceInformation
        RESULT getName(std::string &name);