some changes for service groups
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 30 Nov 2006 12:42:58 +0000 (12:42 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 30 Nov 2006 12:42:58 +0000 (12:42 +0000)
lib/dvb/db.cpp
lib/dvb/dvb.cpp
lib/dvb/sec.cpp
lib/python/Screens/ChannelSelection.py
lib/python/Screens/InfoBarGenerics.py
lib/service/listboxservice.cpp
lib/service/servicedvb.cpp

index 39a0d3e..07546a3 100644 (file)
@@ -81,7 +81,7 @@ RESULT eBouquet::flushChanges()
        {
                eServiceReference tmp = *i;
                std::string str = tmp.path;
-               if ( (i->flags&eServiceReference::flagDirectory) == eServiceReference::flagDirectory )
+               if ( i->flags&eServiceReference::canDescent )
                {
                        unsigned int p1 = str.find("FROM BOUQUET \"");
                        if (p1 == std::string::npos)
@@ -642,7 +642,7 @@ void eDVBDB::loadBouquet(const char *path)
                                        eDebug("only DVB Bouquets supported");
                                        continue;
                                }
-                               if ( (tmp.flags&eServiceReference::flagDirectory) == eServiceReference::flagDirectory )
+                               if ( tmp.flags&eServiceReference::canDescent )
                                {
                                        unsigned int pos = tmp.path.rfind('/');
                                        if ( pos != std::string::npos )
@@ -679,6 +679,8 @@ void eDVBDB::loadBouquet(const char *path)
 void eDVBDB::reloadBouquets()
 {
        m_bouquets.clear();
+       loadBouquet("groups.tv");
+       loadBouquet("groups.radio");
        loadBouquet("bouquets.tv");
        loadBouquet("bouquets.radio");
 // create default bouquets when missing
index 711b5ef..063c377 100644 (file)
@@ -529,7 +529,7 @@ int eDVBResourceManager::canAllocateFrontend(ePtr<iDVBFrontendParameters> &fepar
 
 int eDVBResourceManager::canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID& ignore)
 {
-       int ret=3000;
+       int ret=30000;
        if (m_cached_channel)
        {
                eDVBChannel *cache_chan = (eDVBChannel*)&(*m_cached_channel);
index 7342a4b..faad062 100644 (file)
@@ -144,12 +144,14 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite
                                        if ( di_param.m_diseqc_mode == eDVBSatelliteDiseqcParameters::V1_2 )  // ROTOR
                                                rotor = true;
 
-                                       ret = 1000;
+                                       ret=10000;
+                                       if (rotor && curRotorPos != -1)
+                                               ret -= abs(curRotorPos-sat.orbital_position);
                                }
                                else
                                {
                                        csw = band;
-                                       ret = 2000;
+                                       ret = 15000;
                                }
 
                                while (linked_prev_ptr != -1)  // check for linked tuners..
index acd53bc..8d728f0 100644 (file)
@@ -78,7 +78,9 @@ class ChannelContextMenu(Screen):
 
                if not csel.bouquet_mark_edit and not csel.movemode:
                        if not inBouquetRootList:
-                               if (csel.getCurrentSelection().flags & eServiceReference.flagDirectory) != eServiceReference.flagDirectory:
+                               flags = csel.getCurrentSelection().flags
+                               isPlayable = not ((flags & eServiceReference.isMarker) or (flags & eServiceReference.isDirectory))
+                               if isPlayable:
                                        if config.ParentalControl.configured.value:
                                                if parentalControl.getProtectionLevel(csel.getCurrentSelection().toCompareString()) == -1:
                                                        menu.append((_("add to parental protection"), boundFunction(self.addParentalProtection, csel.getCurrentSelection())))
@@ -572,7 +574,7 @@ class ChannelSelectionBase(Screen):
                                        if not bouquetIterator.valid(): #end of list
                                                break
                                        self.bouquetNumOffsetCache[bouquetIterator.toString()]=offsetCount
-                                       if ((bouquetIterator.flags & eServiceReference.flagDirectory) != eServiceReference.flagDirectory):
+                                       if not (bouquetIterator.flags & eServiceReference.isDirectory):
                                                continue
                                        servicelist = serviceHandler.list(bouquetIterator)
                                        if not servicelist is None:
@@ -872,9 +874,7 @@ class ChannelSelectionBase(Screen):
                                        s = list.getNext()
                                        if not s.valid():
                                                break
-                                       if (s.flags & eServiceReference.isGroup):
-                                               continue
-                                       if (s.flags & eServiceReference.flagDirectory) == eServiceReference.flagDirectory:
+                                       if s.flags & eServiceReference.isDirectory:
                                                info = serviceHandler.info(s)
                                                if info:
                                                        bouquets.append((info.getName(s), s))
@@ -895,7 +895,7 @@ class ChannelSelectionBase(Screen):
                                s = list.getNext()
                                if not s.valid():
                                        break
-                               if (s.flags & eServiceReference.isGroup) and (s.flags & eServiceReference.flagDirectory) == eServiceReference.flagDirectory:
+                               if (s.flags & eServiceReference.isGroup) and (s.flags & eServiceReference.mustDescent):
                                        info = serviceHandler.info(s)
                                        if info:
                                                groups.append((info.getName(s), s))
index 389e119..3ec37c6 100644 (file)
@@ -230,7 +230,7 @@ class InfoBarNumberZap:
                                        bouquet = self.servicelist.appendDVBTypes(bouquetlist.getNext())
                                        if not bouquet.valid(): #check end of list
                                                break
-                                       if (bouquet.flags & eServiceReference.flagDirectory) != eServiceReference.flagDirectory:
+                                       if not (bouquet.flags & eServiceReference.isDirectory):
                                                continue
                                        service, number = self.searchNumberHelper(serviceHandler, number, bouquet)
                if not service is None:
index f6d9e78..2e0dfa9 100644 (file)
@@ -432,11 +432,9 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
                ePtr<iStaticServiceInformation> service_info;
                m_service_center->info(*m_cursor, service_info);
                eServiceReference ref = *m_cursor;
-               bool checkPlayable =
-                       (ref.flags & eServiceReference::flagDirectory) != eServiceReference::flagDirectory ||
-                       (ref.flags & eServiceReference::isGroup);
+               bool isPlayable = !(ref.flags & eServiceReference::isDirectory || ref.flags & eServiceReference::isMarker);
 
-               if (checkPlayable && m_is_playable_ignore.valid() && service_info && !service_info->isPlayable(*m_cursor, m_is_playable_ignore))
+               if (isPlayable && m_is_playable_ignore.valid() && service_info && !service_info->isPlayable(*m_cursor, m_is_playable_ignore))
                        painter.setForegroundColor(gRGB(0xbbbbbb));
 
                int xoffset=0;  // used as offset when painting the folder/marker symbol
@@ -549,7 +547,15 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
                                        eRect area = m_element_position[p];
                                        int correction = (area.height() - pixmap_size.height()) / 2;
 
-                                       if (m_cursor->flags & eServiceReference::flagDirectory)
+                                       if (isPlayable)
+                                       {
+                                               if (e != celServiceTypePixmap)
+                                                       continue;
+                                               m_element_position[celServiceInfo] = area;
+                                               m_element_position[celServiceInfo].setLeft(area.left() + pixmap_size.width() + 8);
+                                               m_element_position[celServiceInfo].setWidth(area.width() - pixmap_size.width() - 8);
+                                       }
+                                       else if (m_cursor->flags & eServiceReference::isDirectory)
                                        {
                                                if (e != celFolderPixmap)
                                                        continue;
@@ -561,13 +567,7 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
                                                        continue;
                                        }
                                        else
-                                       {
-                                               if (e != celServiceTypePixmap)
-                                                       continue;
-                                               m_element_position[celServiceInfo] = area;
-                                               m_element_position[celServiceInfo].setLeft(area.left() + pixmap_size.width() + 8);
-                                               m_element_position[celServiceInfo].setWidth(area.width() - pixmap_size.width() - 8);
-                                       }
+                                               eFatal("unknown service type in listboxservice");
 
                                        area.moveBy(offset);
                                        painter.clip(area);
index 76fc005..1264b87 100644 (file)
@@ -172,8 +172,9 @@ int eStaticServiceDVBBouquetInformation::isPlayable(const eServiceReference &ref
                ((const eServiceReferenceDVB&)ignore).getChannelID(chid_ignore);
                for (std::list<eServiceReference>::iterator it(bouquet->m_services.begin()); it != bouquet->m_services.end(); ++it)
                {
-                       int tmp=res->canAllocateChannel(chid, chid_ignore);
                        ((const eServiceReferenceDVB&)*it).getChannelID(chid);
+                       int tmp=res->canAllocateChannel(chid, chid_ignore);
+                       eDebug("%d %s", tmp, it->toString().c_str());
                        if (tmp > cur)
                        {
                                m_playable_service = *it;
@@ -545,7 +546,7 @@ RESULT eDVBServiceList::getNext(eServiceReference &ref)
 
 RESULT eDVBServiceList::startEdit(ePtr<iMutableServiceList> &res)
 {
-       if (m_parent.flags & eServiceReference::flagDirectory) // bouquet
+       if (m_parent.flags & eServiceReference::canDescent) // bouquet
        {
                ePtr<iDVBChannelList> db;
                ePtr<eDVBResourceManager> resm;
@@ -639,7 +640,7 @@ RESULT eServiceFactoryDVB::list(const eServiceReference &ref, ePtr<iListableServ
 RESULT eServiceFactoryDVB::info(const eServiceReference &ref, ePtr<iStaticServiceInformation> &ptr)
 {
        /* is a listable service? */
-       if ((ref.flags & eServiceReference::flagDirectory) == eServiceReference::flagDirectory) // bouquet
+       if (ref.flags & eServiceReference::canDescent) // bouquet
        {
                if ( !ref.name.empty() )  // satellites or providers list
                        ptr = m_StaticServiceDVBInfo;