move volumeslider to the same position as in e1
[enigma2.git] / lib / dvb / db.cpp
index 38a062a2a5cd1dc562462996bc575e2c911c1193..33a422f8182dea26af3417cd578d7fffcfd266e0 100644 (file)
@@ -1,5 +1,6 @@
 #include <errno.h>
 #include <lib/dvb/db.h>
+#include <lib/dvb/dvb.h>
 #include <lib/dvb/frontend.h>
 #include <lib/dvb/epgcache.h>
 #include <lib/base/eerror.h>
@@ -148,10 +149,24 @@ RESULT eDVBService::getName(const eServiceReference &ref, std::string &name)
        return 0;
 }
 
-RESULT eDVBService::getEvent(const eServiceReference &ref, ePtr<eServiceEvent> &ptr)
+RESULT eDVBService::getEvent(const eServiceReference &ref, ePtr<eServiceEvent> &ptr, time_t start_time)
 {
-       time_t t=-1;
-       return eEPGCache::getInstance()->lookupEventTime(ref, t, ptr);
+       return eEPGCache::getInstance()->lookupEventTime(ref, start_time, ptr);
+}
+
+bool eDVBService::isPlayable(const eServiceReference &ref, const eServiceReference &ignore)
+{
+       ePtr<eDVBResourceManager> res_mgr;
+       if ( eDVBResourceManager::getInstance( res_mgr ) )
+               eDebug("isPlayble... no res manager!!");
+       else
+       {
+               eDVBChannelID chid, chid_ignore;
+               ((const eServiceReferenceDVB&)ref).getChannelID(chid);
+               ((const eServiceReferenceDVB&)ignore).getChannelID(chid_ignore);
+               return res_mgr->canAllocateChannel(chid, chid_ignore);
+       }
+       return false;
 }
 
 int eDVBService::checkFilter(const eServiceReferenceDVB &ref, const eDVBChannelQuery &query)
@@ -839,15 +854,12 @@ eDVBDBSatellitesQuery::eDVBDBSatellitesQuery(eDVBDB *db, const eServiceReference
                        {
                                eServiceReferenceDVB ref;
                                ref.setDVBNamespace(dvbnamespace);
+                               ref.flags=eServiceReference::flagDirectory;
                                char buf[64];
-// TODO get real satellite name..
-// but i dont like to parse the satellites.xml here.. and in the python part
-                               snprintf(buf, 64, "Services - %d", dvbnamespace>>16);
-                               ref.name=buf;
                                snprintf(buf, 64, "(satellitePosition == %d) && ", dvbnamespace>>16);
+
                                ref.path=buf+source.path;
                                unsigned int pos=ref.path.find("FROM");
-                               ref.flags=eServiceReference::flagDirectory;
                                ref.path.erase(pos);
                                ref.path+="ORDER BY name";
 //                             eDebug("ref.path now %s", ref.path.c_str());
@@ -858,8 +870,6 @@ eDVBDBSatellitesQuery::eDVBDBSatellitesQuery(eDVBDB *db, const eServiceReference
                                ref.path.erase(pos+5);
                                ref.path+="PROVIDERS ORDER BY name";
 //                             eDebug("ref.path now %s", ref.path.c_str());
-                               snprintf(buf, 64, "Providers - %d", dvbnamespace>>16);
-                               ref.name=buf;
                                m_list.push_back(ref);
                        }
                }