replace some sUser with more readable code
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 22 Jul 2008 18:26:34 +0000 (18:26 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 22 Jul 2008 18:26:34 +0000 (18:26 +0000)
lib/python/Plugins/Extensions/DVDPlayer/plugin.py
lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp

index 8e9031d..f433ce6 100644 (file)
@@ -424,14 +424,14 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP
                        self.doShow()
 
        def __chapterUpdated(self):
                        self.doShow()
 
        def __chapterUpdated(self):
-               self.currentChapter = self.service.info().getInfo(iServiceInformation.sUser+8)
-               self.totalChapters = self.service.info().getInfo(iServiceInformation.sUser+80)
+               self.currentChapter = self.service.info().getInfo(iServiceInformation.sCurrentChapter)
+               self.totalChapters = self.service.info().getInfo(iServiceInformation.sTotalChapters)
                self.setChapterLabel()
                print "__chapterUpdated: %d/%d" % (self.currentChapter, self.totalChapters)
 
        def __titleUpdated(self):
                self.setChapterLabel()
                print "__chapterUpdated: %d/%d" % (self.currentChapter, self.totalChapters)
 
        def __titleUpdated(self):
-               self.currentTitle = self.service.info().getInfo(iServiceInformation.sUser+9)
-               self.totalTitles = self.service.info().getInfo(iServiceInformation.sUser+90)
+               self.currentTitle = self.service.info().getInfo(iServiceInformation.sCurrentTitle)
+               self.totalTitles = self.service.info().getInfo(iServiceInformation.sTotalTitles)
                self.setChapterLabel()
                print "__titleUpdated: %d/%d" % (self.currentTitle, self.totalTitles)
                if not self.in_menu:
                self.setChapterLabel()
                print "__titleUpdated: %d/%d" % (self.currentTitle, self.totalTitles)
                if not self.in_menu:
index bbcb1f2..30ebaec 100644 (file)
@@ -419,28 +419,27 @@ int eServiceDVD::getInfo(int w)
                case sAlbum:
                        return resIsPyObject;  // then getInfoObject should be called
                case sComment:
                case sAlbum:
                        return resIsPyObject;  // then getInfoObject should be called
                case sComment:
-               case sTracknumber:
                case sGenre:
                        return resIsString;  // then getInfoString should be called
                case sGenre:
                        return resIsString;  // then getInfoString should be called
-               case sUser+8:
+               case sCurrentChapter:
                {
                        struct ddvd_time info;
                        ddvd_get_last_time(m_ddvdconfig, &info);
                        return info.pos_chapter;
                }
                {
                        struct ddvd_time info;
                        ddvd_get_last_time(m_ddvdconfig, &info);
                        return info.pos_chapter;
                }
-               case sUser+80:
+               case sTotalChapters:
                {
                        struct ddvd_time info;
                        ddvd_get_last_time(m_ddvdconfig, &info);
                        return info.end_chapter;
                }
                {
                        struct ddvd_time info;
                        ddvd_get_last_time(m_ddvdconfig, &info);
                        return info.end_chapter;
                }
-               case sUser+9:
+               case sCurrentTitle:
                {
                        struct ddvd_time info;
                        ddvd_get_last_time(m_ddvdconfig, &info);
                        return info.pos_title;
                }
                {
                        struct ddvd_time info;
                        ddvd_get_last_time(m_ddvdconfig, &info);
                        return info.pos_title;
                }
-               case sUser+90:
+               case sTotalTitles:
                {
                        struct ddvd_time info;
                        ddvd_get_last_time(m_ddvdconfig, &info);
                {
                        struct ddvd_time info;
                        ddvd_get_last_time(m_ddvdconfig, &info);