Extension
index
/home/mike/src/jokosher/trunk/Jokosher/Extension.py

# The Jokosher Extension API
# write proper docstrings so that we can autogenerate the docs

 
Modules
       
gettext
gtk
imp
inspect
os
sys

 
Classes
       
ExtensionAPI

 
class ExtensionAPI
     Methods defined here:
__init__(self, mainapp)
add_file_to_selected_instrument(self, uri)
Creates a new event from the file at the given URI and 
adds it to the first selected instrument.
Return values:
0: success
1: bad URI or file could not be loaded
2: no instrument selected
add_instrument(self, instr_type)
Adds an instrument with the type 'instr_type'
from get_available_instruments() to the project.
Return values:
0: success
1: that project type does not exist
add_menu_item(self, menu_item_name, callback_function)
Adds a menu item to a Jokosher extension menu.
get_available_instruments(self)
Returns a list of instrument 'type' strings.
The list will contain exactly one string for each
available type of instrument.
play(self, play_state=True)
If play_state is True, it will play the project from the beginning.
Otherwise, it will stop all playing.
stop(self)
Stops the project if it is currently playing.
Same as play(play_state=False)

 
Functions
       
LoadAllExtensions()
Walk through all the EXTENSION_DIRS and import every .py file we find.

 
Data
        API = None
EXTENSION_DIRS = ['/home/mike/.jokosher/extensions/', '/usr/lib/jokosher/extensions/']
EXTENSION_DIR_USER = '/home/mike/.jokosher/extensions/'
OVERRIDE_EXTENSION_DIRS = ''
PREFERRED_EXTENSION_DIR = '/home/mike/.jokosher/extensions/'
RESP_INSTALL = 9999
RESP_REPLACE = 9998