diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-12-27 10:23:07 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-12-27 10:23:07 +0000 |
| commit | dc2c27a337f958696295d818281805f6c17a4631 (patch) | |
| tree | 3e53015b3cf7a63f9e3bf59f47072adabb0932a8 /lib/python/Plugins/Extensions/MediaPlayer/plugin.py | |
| parent | 1a3a68d135903b60ad9aa5ee829cec58d663754a (diff) | |
| download | enigma2-dc2c27a337f958696295d818281805f6c17a4631.tar.gz enigma2-dc2c27a337f958696295d818281805f6c17a4631.zip | |
add possibility to add complete content of a directory to playlist just with
one button press
Diffstat (limited to 'lib/python/Plugins/Extensions/MediaPlayer/plugin.py')
| -rw-r--r-- | lib/python/Plugins/Extensions/MediaPlayer/plugin.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py index 46e2db24..63e2b302 100644 --- a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py @@ -107,7 +107,7 @@ class MediaPlayer(Screen, InfoBarSeek, InfoBarAudioSelection, InfoBarCueSheetSup self["MediaPlayerActions"] = HelpableActionMap(self, "MediaPlayerActions", { - "play": (self.playEntry, _("play entry")), + "play": (self.xplayEntry, _("play entry")), "pause": (self.pauseEntry, _("pause")), "stop": (self.stopEntry, _("stop entry")), "previous": (self.previousEntry, _("play previous playlist entry")), @@ -591,7 +591,24 @@ class MediaPlayer(Screen, InfoBarSeek, InfoBarAudioSelection, InfoBarCueSheetSup if serviceRefList[count] == serviceref: self.changeEntry(count) break - + + def xplayEntry(self): + if self.currList == "playlist": + self.playEntry() + else: + self.stopEntry() + self.playlist.clear() + sel = self.filelist.getSelection() + if sel: + if sel[1]: # can descent + # add directory to playlist + self.copyDirectory(sel[0]) + else: + # add files to playlist + self.copyDirectory(os_path.dirname(sel[0].getPath()) + "/", recursive = False) + if len(self.playlist) > 0: + self.changeEntry(0) + def playEntry(self): if len(self.playlist.getServiceRefList()): needsInfoUpdate = False |
