Package peppy :: Package plugins :: Module mpd_major_mode :: Class MPDComm
[frames] | no frames]

Class MPDComm

              object --+    
                       |    
lib.nextpanel.debugmixin --+
                           |
                          MPDComm

Wrapper around mpd_connection to save state information.

Small wrapper around mpdclient2's mpd_connection object to save state information about the mpd instance. All views into the mpd instance and all minor modes that access the mpd object will then share the same information, rather than having to look somewhere else to find it.

Instance Methods
 
__init__(self, host, port, timeout=0.5)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
reset(self)
 
shutdown(self, msg=None)
 
cmd(self, cmd, *args)
 
sync(self, cmd, *args, **kw)
 
sync_dict(self, cmd, *args)
 
callback(self, callback, cmd, *args)
 
isLoggedIn(self)
 
isPlaying(self)
True if playing music; false if paused or stopped.
 
playPause(self)
User method to play or pause.
 
stopPlaying(self)
User method to stop playing.
 
prevSong(self)
User method to skip to previous song.
 
nextSong(self)
User method to skip to next song.
 
volumeUp(self, step)
Increase volume, usable at any time.
 
volumeDown(self, step)
Decrease volume, usable at any time.
 
setMute(self)
Mute or unmute, usable at any time

Inherited from lib.nextpanel.debugmixin: dprint

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables

Inherited from lib.nextpanel.debugmixin: debuglevel

Properties

Inherited from object: __class__

Method Details

__init__(self, host, port, timeout=0.5)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

playPause(self)

 

User method to play or pause.

Called to play music either from a stopped state or to resume from pause.

prevSong(self)

 

User method to skip to previous song.

Usable only when playing.

nextSong(self)

 

User method to skip to next song.

Usable only when playing.

volumeUp(self, step)

 

Increase volume, usable at any time.

Volume ranges from 0 - 100 inclusive.

Parameters:
  • step - step size to increase

volumeDown(self, step)

 

Decrease volume, usable at any time.

Volume ranges from 0 - 100 inclusive.

Parameters:
  • step - step size to increase

setMute(self)

 

Mute or unmute, usable at any time

Mute volume or restore muted sound to previous volume level.