Globals
index
/home/laszlo/Dev/joko-gtk-builder/Jokosher/Globals.py

#       THIS FILE IS PART OF THE JOKOSHER PROJECT AND LICENSED UNDER THE GPL. SEE
#       THE 'COPYING' FILE FOR DETAILS
#
#       Globals.py
#       
#       This module contains variable definitions that can be used across the code
#       base and also includes methods for reading and writing these settings to
#       the Jokosher configuration in JOKOSHER_CONFIG_HOME/config.
#
#-------------------------------------------------------------------------------

 
Modules
       
ConfigParser
PlatformUtils
errno
gettext
gobject
gtk
locale
os
pygtk
shutil
xdg

 
Classes
       
Categories
Settings

 
class Categories
     Data and other attributes defined here:
amplifiers = 2
broken = 0
chorus = 3
compressors = 4
delays = 5
distortions = 6
equalizers = 7
filters = 8
flangers = 9
miscellaneous = 10
modulators = 11
oscillators = 12
phasers = 13
reverbs = 14
simulators = 15
unclassified = 1

 
class Settings
    Handles loading/saving settings from/to a file on disk.
 
  Methods defined here:
__init__(self)
read(self)
Reads configuration settings from the config file and loads
then into the Settings dictionaries.
write(self)
Writes configuration settings to the Settings config file.

Data and other attributes defined here:
extensions = {'extensions_blacklist': ''}
general = {'addinstrumentwindowheight': '350', 'addinstrumentwindowwidth': '397', 'instrumenteffectwindowheight': '450', 'instrumenteffectwindowwidth': '650', 'projectfolder': '/home/laszlo/t.ogg', 'recentprojects': '/home/laszlo/Dev/joko-bits/import-test/import-te.../Dev/joko-bits/banana/banana.jokosher|New Project', 'startupaction': 'nothing', 'version': '1', 'windowheight': '550', 'windowwidth': '900'}
playback = {'audiosink': 'pulsesink', 'device': 'alsa_output.pci-0000_00_1b.0.analog-stereo', 'devicename': 'Default (alsa_output.pci-0000_00_1b.0.analog-stereo)'}
recentprojects = {'create_times': '1294065971|1294084162|1294073332|1294073351|1292410839|1294060410|1294074158', 'last_used_times': '1294402687|1294399615|1294084058|1294084081|1292410839|1294083752|1294084005', 'names': 'import-testxx|Not unnamed|import-test|Empty 2|New Project|Four Instrument|Empty-1', 'paths': '/home/laszlo/Dev/joko-bits/import-test/import-te...kosher/projects/2010-12-15-12-14/project.jokosher'}
recording = {'audiosrc': 'pulsesrc', 'device': 'default', 'file_extension': 'flac', 'fileformat': 'flacenc', 'samplerate': '0'}
sections = {'Extensions': {'extensions_blacklist': ''}, 'General': {'addinstrumentwindowheight': '350', 'addinstrumentwindowwidth': '397', 'instrumenteffectwindowheight': '450', 'instrumenteffectwindowwidth': '650', 'projectfolder': '/home/laszlo/t.ogg', 'recentprojects': '/home/laszlo/Dev/joko-bits/import-test/import-te.../Dev/joko-bits/banana/banana.jokosher|New Project', 'startupaction': 'nothing', 'version': '1', 'windowheight': '550', 'windowwidth': '900'}, 'Playback': {'audiosink': 'pulsesink', 'device': 'alsa_output.pci-0000_00_1b.0.analog-stereo', 'devicename': 'Default (alsa_output.pci-0000_00_1b.0.analog-stereo)'}, 'RecentProjects': {'create_times': '1294065971|1294084162|1294073332|1294073351|1292410839|1294060410|1294074158', 'last_used_times': '1294402687|1294399615|1294084058|1294084081|1292410839|1294083752|1294084005', 'names': 'import-testxx|Not unnamed|import-test|Empty 2|New Project|Four Instrument|Empty-1', 'paths': '/home/laszlo/Dev/joko-bits/import-test/import-te...kosher/projects/2010-12-15-12-14/project.jokosher'}, 'Recording': {'audiosrc': 'pulsesrc', 'device': 'default', 'file_extension': 'flac', 'fileformat': 'flacenc', 'samplerate': '0'}}

 
Functions
       
CheckBackendList(backend_list)
CopyAllFiles(src_dir, dest_dir, only_these_files=None)
Copies all the files, but only the files from one directory to another.
FAT32SafeFilename(filename)
Returns a copy fo the given string that has all the
characters that are not allowed in FAT32 path names
taken out.
 
Parameters:
        filename -- the filename string.
LoadGtkBuilderFilename(filename)
PopulateAudioBackends()
PopulateEncoders()
Check if the hardcoded list of encoders is available on the system.
VerifyAllElements(bin_desc)
debug(*listToPrint)
Global debug function to redirect all the debugging output from the other
methods.
 
Parameters:
        *listToPrint -- list of elements to append to the debugging output.
getCachedInstrumentPixbuf(get_type)
getCachedInstruments(checkForNew=False)
Creates the Instrument cache if it hasn't been created already and
return it.
 
Parameters:
        checkForNew --  True = scan the Instrument folders for new_dir.
                                        False = don't scan for new Instruments.
                                        
Returns:
        a list with the Instruments cached in memory.
idleCacheInstruments()
Loads the Instruments 'lazily' to avoid blocking the GUI.
 
Returns:
        True -- keep calling itself to load more Instruments.
        False -- stop calling itself and sort Instruments alphabetically.

 
Data
        AVAILABLE_EXTENSIONS = []
CAPTURE_BACKENDS = [('GNOME Settings', 'gconfaudiosrc'), ('ALSA', 'alsasrc'), ('OSS', 'osssrc'), ('JACK', 'jackaudiosrc'), ('PulseAudio', 'pulsesrc'), ('Direct Sound', 'dshowaudiosrc'), ('Core Audio', 'osxaudiosrc')]
DEBUG_GST = False
DEBUG_STDOUT = False
DEFAULT_INSTRUMENTS = []
EFFECT_PRESETS_PATH = '/home/laszlo/.local/share/jokosher/presets/effects'
EFFECT_PRESETS_VERSION = None
EXPORT_FORMATS = []
EXTENSION_PATHS = ('/home/laszlo/Dev/joko-gtk-builder/Jokosher/../extensions', '/home/laszlo/.local/share/jokosher/extensions')
GTK_BUILDER_PATH = '/home/laszlo/Dev/joko-gtk-builder/Jokosher/../gtk-builder-ui'
HELP_PATH = '/home/laszlo/Dev/joko-gtk-builder/Jokosher/../help/jokosher/C/jokosher.xml'
IMAGE_PATH = '/home/laszlo/Dev/joko-gtk-builder/Jokosher/../images'
INSTR_PATHS = ('/home/laszlo/Dev/joko-gtk-builder/Jokosher/../Instruments', '/home/laszlo/.local/share/jokosher/instruments')
JOKOSHER_CONFIG_HOME = '/home/laszlo/.config/jokosher'
JOKOSHER_DATA_HOME = '/home/laszlo/.local/share/jokosher'
LADPSA_CATEGORIES_LIST = [('Broken', 'effect_broken.png'), ('Unclassified', 'effect_unclassified.png'), ('Amplifiers', 'effect_amplifiers.png'), ('Chorus', 'effect_chorus.png'), ('Compressors', 'effect_compressors.png'), ('Delays', 'effect_delays.png'), ('Distortions', 'effect_distortion.png'), ('Equalizers', 'effect_equalizers.png'), ('Filters', 'effect_filters.png'), ('Flangers', 'effect_flangers.png'), ('Miscellaneous', 'effect_miscellaneous.png'), ('Modulators', 'effect_modulators.png'), ('Oscillators', 'effect_oscillators.png'), ('Phasers', 'effect_phasers.png'), ('Reverbs', 'effect_reverbs.png'), ('Simulators', 'effect_simulators.png')]
LADSPA_CATEGORIES_DICT = {'ladspa-AmpIII': 15, 'ladspa-AmpIV': 15, 'ladspa-AmpV': 15, 'ladspa-CabinetI': 15, 'ladspa-CabinetII': 15, 'ladspa-Chorus1': 3, 'ladspa-Chorus2': 3, 'ladspa-ChorusI': 3, 'ladspa-ChorusII': 3, 'ladspa-Clip': 2, ...}
LADSPA_FACTORY_REGISTRY = None
LADSPA_NAME_MAP = []
LOCALE_APP = 'jokosher'
LOCALE_PATH = '/home/laszlo/Dev/joko-gtk-builder/Jokosher/../locale'
MIXDOWN_PROFILES_PATH = '/home/laszlo/.local/share/jokosher/mixdownprofiles'
PLAYBACK_BACKENDS = [('Autodetect', 'autoaudiosink'), ('Use GNOME Settings', 'gconfaudiosink'), ('ALSA', 'alsasink'), ('OSS', 'osssink'), ('JACK', 'jackaudiosink'), ('PulseAudio', 'pulsesink'), ('Direct Sound', 'directsoundsink'), ('Core Audio', 'osxaudiosink')]
PROJECTS_PATH = '/home/laszlo/.local/share/jokosher/projects'
SAMPLE_RATES = [8000, 11025, 22050, 32000, 44100, 48000, 96000, 192000]
USE_LOCAL_HELP = True
VERSION = '0.11.1'
XDG_RESOURCE_NAME = 'jokosher'
create_dirs = ['extensions', 'instruments', ('instruments', 'images'), 'presets', ('presets', 'effects'), ('presets', 'mixdown'), 'mixdownprofiles', 'projects']
current_locale = 'C'
data_path = '/home/laszlo/Dev/joko-gtk-builder/Jokosher'
dirs = 'projects'
e = OSError(17, 'File exists')
instrumentPropertyList = []
jokosher_dir_empty = False
new_dir = '/home/laszlo/.local/share/jokosher/projects'
old_dir = '/home/laszlo/.jokosher/projects'
settings = <Globals.Settings instance>