add a repeat playlist function to mediaplayer (on behalf of Nix_niX)
authorAndreas Frisch <andreas.frisch@multimedia-labs.de>
Fri, 8 Aug 2008 09:18:14 +0000 (09:18 +0000)
committerAndreas Frisch <andreas.frisch@multimedia-labs.de>
Fri, 8 Aug 2008 09:18:14 +0000 (09:18 +0000)
data/skin_default.xml
data/skin_default/icons/repeat_off.png [new file with mode: 0755]
data/skin_default/icons/repeat_on.png [new file with mode: 0755]
data/skin_default/mediaplayer_bg.png
lib/python/Plugins/Extensions/MediaPlayer/plugin.py
po/de.po

index 55849a9..c84352d 100644 (file)
@@ -445,7 +445,8 @@ self.instance.move(ePoint((720-wsizex)/2, (576-wsizey)/(count &gt; 7 and 2 or 3)
                <widget name="title" position="20,108" size="413,18" font="Regular;16" valign="top" transparent="1" />
                <widget name="coverArt" pixmap="skin_default/no_coverArt.png" position="446,11" size="116,116" transparent="1" alphatest="blend" />
                <ePixmap pixmap="skin_default/icons/mp_buttons.png" position="454,136" size="108,13" alphatest="on" />
-               <widget name="PositionGauge" position="15,138" size="418,10" pointer="skin_default/position_pointer.png:540,0" seek_pointer="skin_default/position_pointer.png:540,0" transparent="1" />
+               <widget name="PositionGauge" position="15,138" size="396,10" pointer="skin_default/position_pointer.png:540,0" seek_pointer="skin_default/position_pointer.png:540,0" transparent="1" />
+               <widget name="repeat" pixmaps="skin_default/icons/repeat_off.png,skin_default/icons/repeat_on.png" position="416,135" size="22,15" transparent="1" alphatest="on"/>
                <widget name="filelist" position="15,163" size="550,138" scrollbarMode="showOnDemand" />
                <widget name="playlist" position="15,314" size="550,154" scrollbarMode="showOnDemand" selectionDisabled="1" />
                <widget name="currenttext" position="0,0" size="0,0" />
diff --git a/data/skin_default/icons/repeat_off.png b/data/skin_default/icons/repeat_off.png
new file mode 100755 (executable)
index 0000000..493aa42
Binary files /dev/null and b/data/skin_default/icons/repeat_off.png differ
diff --git a/data/skin_default/icons/repeat_on.png b/data/skin_default/icons/repeat_on.png
new file mode 100755 (executable)
index 0000000..2729eec
Binary files /dev/null and b/data/skin_default/icons/repeat_on.png differ
index 7b469ae..620d58d 100644 (file)
Binary files a/data/skin_default/mediaplayer_bg.png and b/data/skin_default/mediaplayer_bg.png differ
index 27b4776..22fe7c5 100644 (file)
@@ -6,7 +6,7 @@ from Screens.MessageBox import MessageBox
 from Screens.InputBox import InputBox
 from Components.ActionMap import NumberActionMap, HelpableActionMap
 from Components.Label import Label
-from Components.Pixmap import Pixmap
+from Components.Pixmap import Pixmap,MultiPixmap
 from Components.Label import Label
 from Components.FileList import FileList
 from Components.MediaPlayer import PlayList
@@ -87,7 +87,9 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
                self["genretext"] = Label(_("Genre:"))
                self["genre"] = Label("")
                self["coverArt"] = MediaPixmap()
+               self["repeat"] = MultiPixmap()
 
+               self.repeat = False
                self.seek_target = None
 
                class MoviePlayerActionMap(NumberActionMap):
@@ -163,7 +165,7 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
                self.coverArtFileName = ""
                self.isAudioCD = False
                self.AudioCD_albuminfo = {}
-
+               
                self.playlistIOInternal = PlaylistIOInternal()
                list = self.playlistIOInternal.open(resolveFilename(SCOPE_CONFIG, "playlist.e2pls"))
                if list:
@@ -437,6 +439,7 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
                menu.append((_("save playlist"), "saveplaylist"));
                menu.append((_("load playlist"), "loadplaylist"));
                menu.append((_("delete saved playlist"), "deleteplaylist"));
+               menu.append((_("repeat playlist"), "repeat"));
                self.session.openWithCallback(self.menuCallback, ChoiceBox, title="", list=menu)
 
        def menuCallback(self, choice):
@@ -472,7 +475,13 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
                        self.delete_saved_playlist()
                elif choice[1] == "shuffle":
                        self.playlist.PlayListShuffle()
-
+               elif choice[1] == "repeat":
+                       if self.repeat == True:
+                               self.repeat = False
+                               self["repeat"].setPixmapNum(0)
+                       else:
+                               self.repeat = True
+                               self["repeat"].setPixmapNum(1)
 
        def showEventInformation(self):
                from Screens.EventView import EventViewSimple
@@ -599,6 +608,9 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
                next = self.playlist.getCurrentIndex() + 1
                if next < len(self.playlist):
                        self.changeEntry(next)
+               elif ( len(self.playlist) > 0 ) and ( self.repeat == True ):
+                       self.stopEntry()
+                       self.changeEntry(0)
 
        def nextMarkOrEntry(self):
                if not self.jumpPreviousNextMark(lambda x: x):
index c2c6058..4d1ef7b 100644 (file)
--- a/po/de.po
+++ b/po/de.po
@@ -3872,6 +3872,9 @@ msgstr "Entferne gewählten Satellit"
 msgid "remove this mark"
 msgstr "Diese Markierung entfernen"
 
+msgid "repeat playlist"
+msgstr "Wiederholung der Wiedergabeliste"
+
 msgid "repeated"
 msgstr "wiederholend"