+int eStaticServiceDVBBouquetInformation::isPlayable(const eServiceReference &ref, const eServiceReference &ignore)
+{
+ if (ref.flags & eServiceReference::isGroup)
+ {
+ ePtr<iDVBChannelList> db;
+ ePtr<eDVBResourceManager> res;
+
+ if (eDVBResourceManager::getInstance(res))
+ {
+ eDebug("eStaticServiceDVBBouquetInformation::isPlayable failed.. no resource manager!");
+ return 0;
+ }
+
+ if (res->getChannelList(db))
+ {
+ eDebug("eStaticServiceDVBBouquetInformation::isPlayable failed.. no channel list!");
+ return 0;
+ }
+
+ eBouquet *bouquet=0;
+ if (db->getBouquet(ref, bouquet))
+ {
+ eDebug("eStaticServiceDVBBouquetInformation::isPlayable failed.. getBouquet failed!");
+ return 0;
+ }
+
+ int cur=0;
+ eDVBChannelID chid, chid_ignore;
+ ((const eServiceReferenceDVB&)ignore).getChannelID(chid_ignore);
+ for (std::list<eServiceReference>::iterator it(bouquet->m_services.begin()); it != bouquet->m_services.end(); ++it)
+ {
+ ((const eServiceReferenceDVB&)*it).getChannelID(chid);
+ int tmp=res->canAllocateChannel(chid, chid_ignore);
+ if (tmp > cur)
+ {
+ m_playable_service = *it;
+ cur = tmp;
+ }
+ }
+ if (cur)
+ return cur;
+ }
+ m_playable_service = eServiceReference();
+ return 0;
+}
+