diff options
author | Anton Khirnov <wyskas@gmail.com> | 2009-06-20 17:10:53 +0200 |
---|---|---|
committer | Anton Khirnov <wyskas@gmail.com> | 2009-06-20 17:10:53 +0200 |
commit | c6af9fe01cb3bea21471f839ec26a07b04ac24c2 (patch) | |
tree | 704e0d0542e8bf5a22a3d8632c9885cd989c1d5b /nephilim/plugins/PlayControl.py | |
parent | e7e7093a12fb5eb52fd0bb3071a7c85c7d8aefbd (diff) |
plugin: make mpclient a var instead of a function.
Diffstat (limited to 'nephilim/plugins/PlayControl.py')
-rw-r--r-- | nephilim/plugins/PlayControl.py | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/nephilim/plugins/PlayControl.py b/nephilim/plugins/PlayControl.py index a809a3a..8153eb7 100644 --- a/nephilim/plugins/PlayControl.py +++ b/nephilim/plugins/PlayControl.py @@ -82,31 +82,31 @@ class wgPlayControl(QtGui.QToolBar): self.random = self.addAction(QtGui.QIcon('gfx/media-playlist-shuffle.svgz'), 'random') self.random.setCheckable(True) - self.connect(self.random, QtCore.SIGNAL('toggled(bool)'), self.p.mpclient().random) - self.connect(self.p.mpclient(), QtCore.SIGNAL('random_changed'), self.random.setChecked) + self.connect(self.random, QtCore.SIGNAL('toggled(bool)'), self.p.mpclient.random) + self.connect(self.p.mpclient, QtCore.SIGNAL('random_changed'), self.random.setChecked) self.repeat = self.addAction(QtGui.QIcon('gfx/media-playlist-repeat.svg'), 'repeat') self.repeat.setCheckable(True) - self.connect(self.p.mpclient(), QtCore.SIGNAL('repeat_changed'), self.repeat.setChecked) - self.connect(self.repeat, QtCore.SIGNAL('toggled(bool)'), self.p.mpclient().repeat) + self.connect(self.p.mpclient, QtCore.SIGNAL('repeat_changed'), self.repeat.setChecked) + self.connect(self.repeat, QtCore.SIGNAL('toggled(bool)'), self.p.mpclient.repeat) self.single = self.addAction(QtGui.QIcon('gfx/single.png'), 'single mode') self.single.setCheckable(True) - self.connect(self.p.mpclient(), QtCore.SIGNAL('single_changed'), self.single.setChecked) - self.connect(self.single, QtCore.SIGNAL('toggled(bool)'), self.p.mpclient().single) + self.connect(self.p.mpclient, QtCore.SIGNAL('single_changed'), self.single.setChecked) + self.connect(self.single, QtCore.SIGNAL('toggled(bool)'), self.p.mpclient.single) self.consume = self.addAction(QtGui.QIcon('gfx/consume.png'), 'consume mode') self.consume.setCheckable(True) - self.connect(self.p.mpclient(), QtCore.SIGNAL('consume_changed'), self.consume.setChecked) - self.connect(self.consume, QtCore.SIGNAL('toggled(bool)'), self.p.mpclient().consume) + self.connect(self.p.mpclient, QtCore.SIGNAL('consume_changed'), self.consume.setChecked) + self.connect(self.consume, QtCore.SIGNAL('toggled(bool)'), self.p.mpclient.consume) self.connect(self, QtCore.SIGNAL('orientationChanged(Qt::Orientation)'), self.vol_slider.setOrientation) - self.connect(self.p.mpclient(), QtCore.SIGNAL('state_changed'), self.onStateChange) - self.connect(self.p.mpclient(), QtCore.SIGNAL('volume_changed'), self.onVolumeChange) + self.connect(self.p.mpclient, QtCore.SIGNAL('state_changed'), self.onStateChange) + self.connect(self.p.mpclient, QtCore.SIGNAL('volume_changed'), self.onVolumeChange) def onStateChange(self, new_state): - status = self.p.mpclient().status() + status = self.p.mpclient.status() if new_state == 'play': self.play_action.setIcon(self.pause_icon) @@ -119,26 +119,26 @@ class wgPlayControl(QtGui.QToolBar): self.vol_slider.setValue(new_vol) def on_play_click(self): - status=self.p.mpclient().status() + status=self.p.mpclient.status() if status['state']=='play': self.logger.info('Toggling playback') - self.p.mpclient().pause() + self.p.mpclient.pause() elif status['state']=='stop': self.logger.info('Pausing playback') - self.p.mpclient().play(None) + self.p.mpclient.play(None) else: - self.p.mpclient().resume() + self.p.mpclient.resume() def on_stop_click(self): self.logger.info('Stopping playback') - self.p.mpclient().stop() + self.p.mpclient.stop() def on_prev_click(self): self.logger.info('Playing previous') - self.p.mpclient().previous() + self.p.mpclient.previous() def on_next_click(self): self.logger.info('Playing next') - self.p.mpclient().next() + self.p.mpclient.next() def onVolumeSliderChange(self): - self.p.mpclient().set_volume(self.vol_slider.value()) + self.p.mpclient.set_volume(self.vol_slider.value()) class PlayControl(Plugin): o = None |