Example #1
0
 def __init__(self, parent=None, start_url=None):
     QtGui.QWidget.__init__(self, parent)
     self.ui = Ui_MainWindow()
     self.ui.setupUi(self)
     self.ui.seekSlider.setIconVisible(False)
     self.ui.volumeSlider.setMuteVisible(False)
     self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
     self.setup_player_ui()
     self.total_time = None
     self.doubanfm = DoubanFM(start_url, debug=False)
     self.connect(self.ui.pushButtonHeart, QtCore.SIGNAL('clicked()'),
                  self.heart_song)
     self.connect(self.ui.pushButtonTrash, QtCore.SIGNAL('clicked()'),
                  self.trash_song)
     self.connect(self.ui.pushButtonSkip, QtCore.SIGNAL('clicked()'),
                  self.skip_song)
     self.connect(self.ui.pushButtonToggle, QtCore.SIGNAL('clicked()'),
                  self.play_toggle)
     self.connect(self.ui.pushButtonCover, QtCore.SIGNAL('clicked()'),
                  self.on_click_cover)
     self.connect(self.ui.pushButtonShare, QtCore.SIGNAL('clicked()'),
                  self.on_click_share)
     self.connect(self, QtCore.SIGNAL('cover_image_ready()'),
                  self.__set_cover)
     l.info('DoubanFM init')
     self.next_song()
Example #2
0
 def __init__(self, start_url=None):
     self.doubanfm = DoubanFM(start_url)
     self.player = gst.element_factory_make("playbin2", "player")
     bus = self.player.get_bus()
     bus.add_signal_watch()
     bus.connect("message", self.on_message)