1
How to write a plugin for pympd:
4
A plugin for pympd must be a class named 'Plugin', where the name of the
7
It's important to note that plugins are in their own scope, so they will not
8
inherit the imported modules from pympd, they must import the modules themself.
10
Four functions are needed in the plugin class:
13
param: data is a tuple of (gtk.Window, gtk.Menu, pympdclient.pympdclient, base_dir
14
gtk.Window = the main Window of pympd
15
gtk.Menu = the plugin menu on pympd
16
pympdclient = a controller for pympd
17
base_dir = the directory we are in (base directory)
18
usage: called when the plugin is loaded
20
_spin(self, data, bool=None)
21
param: data is mpdclient.Status (see below for data members)
22
if bool is true, then the song has changed.
23
usage: called every time pympd spins, it is useful for reacting to mpd data.
25
_conf(self, bool=None)
26
param: bool is a boolean.
27
usage: If bool == None, we want to know if you have a dialog, otherwise
28
we want your dialog to pop up.
32
usage: called when the plugin is unloaded, it is recommended to destroy
33
all the gtk items created over here, so they are no longer persistant.
35
recommended functions:
37
buildPluginMenu(pluginMenu)
38
add on to the plugin menu in the menubar on top, by appending onto the menu
42
build a config dialog, if your program needs it.
44
mpdclient.Status: (taken from mackstann's mpdclient.py)
46
"Class representing the status of the player at a given point in time."