class MediaPixmap(Pixmap):
def applySkin(self, desktop):
self.default_pixmap = None
- for (attrib, value) in self.skinAttributes:
- if attrib == "pixmap":
- self.default_pixmap = value
- break
+ if self.skinAttributes is not None:
+ for (attrib, value) in self.skinAttributes:
+ if attrib == "pixmap":
+ self.default_pixmap = value
+ break
if self.default_pixmap is None:
self.default_pixmap = resolveFilename(SCOPE_SKIN_IMAGE, "no_coverArt.png")
return Pixmap.applySkin(self, desktop)
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")),
self.righttimer = False
self.rightKeyTimer = eTimer()
- self.rightKeyTimer.timeout.get().append(self.rightTimerFire)
+ self.rightKeyTimer.callback.append(self.rightTimerFire)
self.lefttimer = False
self.leftKeyTimer = eTimer()
- self.leftKeyTimer.timeout.get().append(self.leftTimerFire)
+ self.leftKeyTimer.callback.append(self.leftTimerFire)
self.currList = "filelist"
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