def _accept(self): BlueServer._accept(self) if not xmms.is_running(): xmms.control.enqueue_and_play_launch_if_session_not_started( [], xmms_prg='xmms', session=0, poll_delay=0.10000000000000001, timeout=10.0)
def play(self, item, playerGUI): """ play an audioitem with xmms """ logger.debug('%s.play(item=%r, playerGUI=%r)', self.__module__, item, playerGUI) if item.url: filename = item.url else: filename = item.filename self.playerGUI = playerGUI # Do we care if the file streamed over the network? if not os.path.isfile(filename) and filename.find('://') == -1: return _('%s\nnot found!') % filename # need to convert filename for cds to /mnt/cdrom/Track??.cda # the /mnt/cdrom is supposed to be where you mount your cd if filename.startswith('cdda://'): filename = '%s/Track%.2d.cda' % (item.parent.media.mountdir, int(item.url[7:])) if plugin.getbyname('MIXER'): plugin.getbyname('MIXER').reset() self.item = item #reset idle timeout so update thread doesn't kill xmms after I start a song self.idle = 0 if not xmms.is_running(): xmms.enqueue_and_play_launch_if_session_not_started( [(filename)], xmms_prg=config.FXMMS_CMD) time.sleep(0.2) self.hide_windows() # turn off repeat mode if (xmms.is_repeat()): xmms.toggle_repeat() else: xmms.playlist_clear() xmms.enqueue_and_play([(filename)]) # restart OSD update thread if neccessary if (not self.is_alive): thread.start_new_thread(self.__update_thread, ()) return None
def play(self, item, playerGUI): """ play an audioitem with xmms """ logger.debug('%s.play(item=%r, playerGUI=%r)', self.__module__, item, playerGUI) if item.url: filename = item.url else: filename = item.filename self.playerGUI = playerGUI # Do we care if the file streamed over the network? if not os.path.isfile(filename) and filename.find('://') == -1: return _('%s\nnot found!') % filename # need to convert filename for cds to /mnt/cdrom/Track??.cda # the /mnt/cdrom is supposed to be where you mount your cd if filename.startswith('cdda://'): filename = '%s/Track%.2d.cda' % (item.parent.media.mountdir, int(item.url[7:])) if plugin.getbyname('MIXER'): plugin.getbyname('MIXER').reset() self.item = item #reset idle timeout so update thread doesn't kill xmms after I start a song self.idle = 0 if not xmms.is_running(): xmms.enqueue_and_play_launch_if_session_not_started([(filename)],xmms_prg=config.FXMMS_CMD) time.sleep(0.2) self.hide_windows() # turn off repeat mode if (xmms.is_repeat()): xmms.toggle_repeat() else: xmms.playlist_clear() xmms.enqueue_and_play([(filename)]) # restart OSD update thread if neccessary if (not self.is_alive): thread.start_new_thread(self.__update_thread, ()) return None
def paintEvent(self, qe): if not self.isVisible() or not xmms.is_running(): return self.time = QTime.currentTime() pts = QPointArray() paint = QPainter(self) xmms_pos = (1.0 * xmms.get_output_time() / xmms.get_playlist_time(xmms.get_playlist_pos())) # paint.setBrush(QColor(255, 255 * xmms_pos, 255 * xmms_pos)) paint.setPen(QColor(255, 255, 255)) h = self.height() / 3 if hasattr(self, "soundinfocache"): self.soundinfocache.repaint(paint, h, self.width()) paint.drawText(0, 500, self.soundinfocache.title) s = xmms_pos * self.width() paint.drawRect(max(0, s), 0, 1, self.height()) paint.drawRect(0, h * (2 - xmms_pos), self.width(), 1)
def is_active(self, dbus_iface=None): #print xmms_support if not self.isFrozen: self.active = xmms_support and xmms.is_running() return self.active
def is_active(self, dbus_iface = None): #print xmms_support if not self.isFrozen: self.active = xmms_support and xmms.is_running() return self.active
def _accept(self): BlueServer._accept(self) if not xmms.is_running(): xmms.control.enqueue_and_play_launch_if_session_not_started([], xmms_prg='xmms', session=0, poll_delay=0.10000000000000001, timeout=10.0)