Ejemplo n.º 1
0
	def __init__(self, player):
		QtGui.QWidget.__init__(self)
		AbstractPlayerWidget.__init__(self, player)
		
		# Widgets
		layout = QtGui.QHBoxLayout()
		
		#self.progressBar = QtGui.QProgressBar()
		self.progressBar = QtGui.QSlider(QtCore.Qt.Horizontal)
		self.progressBar.setTracking(False)
		self.progressBar.valueChanged.connect(self.seekTo)
		self.progressBar.setEnabled(False)
		
		self.timer = QtCore.QTimer()
		self.timer.setInterval(1000)
		self.timer.timeout.connect(self.showProgress)
		
		prevButton = QtGui.QPushButton(QtGui.QIcon.fromTheme('media-skip-backward'), None)
		prevButton.clicked.connect(self.playPreviousTrack)
		self.playButton = QtGui.QPushButton(self.PLAY_ICON, None)
		self.playButton.clicked.connect(self.togglePause)
		nextButton = QtGui.QPushButton(QtGui.QIcon.fromTheme('media-skip-forward'), None)
		nextButton.clicked.connect(self.playNextTrack)
		stopButton = QtGui.QPushButton(QtGui.QIcon.fromTheme('media-playback-stop'), None)
		stopButton.clicked.connect(self.stop)
		layout.addWidget(prevButton)
		layout.addWidget(self.playButton)
		layout.addWidget(nextButton)
		layout.addWidget(stopButton)
		layout.addWidget(self.progressBar)
		self.setLayout(layout)
Ejemplo n.º 2
0
	def __init__(self, player):
		AbstractPlayerWidget.__init__(self, player)
		gtk.HBox.__init__(self)

		
		# -------- Widgets ---------
		self.progressBar = gtk.ProgressBar()
		self.progressBar.add_events(gtk.gdk.BUTTON_PRESS_MASK)
		self.progressBar.add_events(gtk.gdk.BUTTON_RELEASE_MASK)
		self.progressBar.set_sensitive(False)
		self.progressBar.set_text(_("Pending..."))
		self.progressBar.connect('button-release-event', self.seekTo)
			
		self.timer = Updater()
		self.timer.set_target(self.showProgress)
		
		
		#BB = gtk.HButtonBox()
		#BB.set_spacing(10)
		prevButton = gtk.ToolButton(gtk.STOCK_MEDIA_PREVIOUS)
		prevButton.connect_object("clicked", AbstractPlayerWidget.playPreviousTrack, self)
		
		self.playButton = gtk.ToolButton(gtk.STOCK_MEDIA_PLAY)
		self.playButton.connect_object("clicked", AbstractPlayerWidget.togglePause, self)
		
		nextButton = gtk.ToolButton(gtk.STOCK_MEDIA_NEXT)
		stopButton = gtk.ToolButton(gtk.STOCK_MEDIA_STOP)
		
		
		nextButton.connect_object("clicked", AbstractPlayerWidget.playNextTrack, self)
		stopButton.connect_object("clicked", AbstractPlayerWidget.stop, self)
		self.pack_start(prevButton, False)
		self.pack_start(self.playButton, False)
		self.pack_start(nextButton, False)
		self.pack_start(stopButton, False)

		volumeButton = gtk.VolumeButton()
		#volumeButton.connect("value-changed", self.on_volume_change)
		self.pack_start(volumeButton, False)
		self.pack_start(self.progressBar)