Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoramartin <olpc@xo-05-28-21.localdomain>2007-09-10 05:03:46 (GMT)
committer amartin <olpc@xo-05-28-21.localdomain>2007-09-10 05:03:46 (GMT)
commit94bb67b45c07c8ba6fa94be17852e29958d6c75d (patch)
treee09658498ce3d6e2b2841cb57b2390363a9f149b
parent7e682ce7620f1f8a9fb9b4ffc4f4039dbfdffc56 (diff)
parentf5c1a8c3c8fa92d25c45345f971e2789ffb58271 (diff)
Merge branch 'master' of git+ssh://amartin@dev.laptop.org/git/projects/tamtam
-rw-r--r--Edit/MainWindow.py8
-rw-r--r--Jam/Picker.py2
-rw-r--r--Jam/Popup.py5
-rw-r--r--Jam/Toolbars.py20
-rw-r--r--NEWS4
-rw-r--r--[-rwxr-xr-x]TamTam.py902
-rw-r--r--Util/ThemeWidgets.py3
-rw-r--r--activity/activity-tamtam.svg67
-rw-r--r--activity/activity-tamtamedit.svg29
-rw-r--r--activity/activity-tamtamsynthlab.svg24
-rw-r--r--activity/activity.info2
-rw-r--r--activity/activity_edit.info6
-rw-r--r--activity/activity_jam.info6
-rw-r--r--activity/activity_mini.info6
-rw-r--r--activity/activity_sl.info6
-rw-r--r--setup_all.py41
-rw-r--r--setup_edit.py26
-rw-r--r--setup_jam.py26
-rw-r--r--setup_mini.py26
-rw-r--r--setup_sl.py26
20 files changed, 1172 insertions, 63 deletions
diff --git a/Edit/MainWindow.py b/Edit/MainWindow.py
index e34fc19..58f82f1 100644
--- a/Edit/MainWindow.py
+++ b/Edit/MainWindow.py
@@ -2053,13 +2053,13 @@ class InstrumentButton( gtk.DrawingArea ):
def set_palette(self, palette):
self._palette = palette
self._palette.props.invoker = WidgetInvoker(self)
+ self._palette.props.invoker._position_hint = WidgetInvoker.AT_CURSOR #This is a hack, will change with newer Palette API
+
class instrumentPalette(Palette):
def __init__(self, label, trackID, edit):
Palette.__init__(self, label)
-
- self.set_property("position", Palette.AT_CURSOR)
-
+
self.trackID = trackID
self.edit = edit
@@ -2087,5 +2087,5 @@ class instrumentPalette(Palette):
self.volumeBox.pack_start(self.volumeSlider, padding = 5)
self.volumeBox.show_all()
- self.set_content(self.volumeBox)
+ self.set_content(self.volumeBox)
\ No newline at end of file
diff --git a/Jam/Picker.py b/Jam/Picker.py
index e7f8b82..b69a73f 100644
--- a/Jam/Picker.py
+++ b/Jam/Picker.py
@@ -71,7 +71,7 @@ class Picker( gtk.HBox ):
# tooltip
block._palette = Palette( name )
block._palette.props.invoker = WidgetInvoker(block)
- block._palette.set_property( "position", Palette.AT_CURSOR )
+ block._palette.props.invoker._position_hint = WidgetInvoker.AT_CURSOR
block.add_events( gtk.gdk.BUTTON_PRESS_MASK
| gtk.gdk.BUTTON_RELEASE_MASK
diff --git a/Jam/Popup.py b/Jam/Popup.py
index 2326e3a..6f6a7e1 100644
--- a/Jam/Popup.py
+++ b/Jam/Popup.py
@@ -30,9 +30,7 @@ class NoneInvoker( Invoker ):
def __init__( self ):
Invoker.__init__( self )
-
- def get_default_position( self ):
- return Palette.AT_CURSOR
+ self._position_hint = Invoker.AT_CURSOR
def get_rect( self ):
return gtk.gdk.Rectangle( 0, 0, 0, 0 )
@@ -50,7 +48,6 @@ class Popup( Palette ):
self.block = None
self.props.invoker = NoneInvoker()
- self.set_property( "position", Palette.AT_CURSOR )
self.set_group_id( "TamTamPopup" )
self._set_state( Palette.SECONDARY ) # skip to fully exposed
diff --git a/Jam/Toolbars.py b/Jam/Toolbars.py
index 08ce06f..194ea5b 100644
--- a/Jam/Toolbars.py
+++ b/Jam/Toolbars.py
@@ -21,8 +21,7 @@ class JamToolbar( gtk.Toolbar ):
self.toolItem = {}
self.volumeImg = gtk.Image()
- self.volumeImg.set_from_file( Config.IMAGE_ROOT + 'volume2.png' )
- self._insert_widget( self.volumeImg, -1 )
+ self.volumeImg.set_from_file( Config.TAM_TAM_ROOT + '/icons/volume2.svg' )
self.volumeAdjustment = gtk.Adjustment( 0.5, 0, 1.0, 0.1, 0.1, 0 )
self.volumeAdjustment.connect( 'value-changed', self.handleVolume )
@@ -31,12 +30,12 @@ class JamToolbar( gtk.Toolbar ):
self.volumeSlider.set_draw_value( False )
self._add_tooltip( self.volumeSlider, _("Master Volume") )
self._insert_widget( self.volumeSlider, -1 )
+ self._insert_widget( self.volumeImg, -1 )
self._insert_separator( True )
self.tempoImg = gtk.Image()
- self.tempoImg.set_from_file( Config.IMAGE_ROOT + 'tempo2.png' )
- self._insert_widget( self.tempoImg, -1 )
+ self.tempoImg.set_from_file( Config.TAM_TAM_ROOT + '/icons/tempo2.svg' )
self.tempoAdjustment = gtk.Adjustment( Config.PLAYER_TEMPO, Config.PLAYER_TEMPO_LOWER, Config.PLAYER_TEMPO_UPPER+1, 10, 10, 0 )
self.tempoAdjustment.connect( 'value-changed', self.handleTempo )
@@ -45,16 +44,19 @@ class JamToolbar( gtk.Toolbar ):
self.tempoSlider.set_draw_value( False )
self._add_tooltip( self.tempoSlider, _("Tempo") )
self._insert_widget( self.tempoSlider, -1 )
+ self._insert_widget( self.tempoImg, -1 )
self.show_all()
- def _add_palette( self, widget, palette, position = Palette.DEFAULT ):
+ #def _add_palette( self, widget, palette, position = Palette.DEFAULT ):
+ def _add_palette( self, widget, palette ):
widget._palette = palette
widget._palette.props.invoker = WidgetInvoker( widget )
- widget._palette.set_property( "position", position )
+ #widget._palette.set_property( "position", position )
def _add_tooltip( self, widget, tooltip ):
- self._add_palette( widget, Palette( tooltip ), Palette.DEFAULT )
+ #self._add_palette( widget, Palette( tooltip ), Palette.DEFAULT )
+ self._add_palette( widget, Palette( tooltip ) )
def _insert_widget( self, widget, pos ):
self.toolItem[ widget ] = gtk.ToolItem()
@@ -77,13 +79,13 @@ class JamToolbar( gtk.Toolbar ):
self.owner._setVolume( widget.get_value() )
img = self.mapRange( widget.value, widget.lower, widget.upper, 0, 3 )
- self.volumeImg.set_from_file(Config.IMAGE_ROOT + 'volume' + str(img) + '.png')
+ self.volumeImg.set_from_file(Config.TAM_TAM_ROOT + '/icons/volume' + str(img) + '.svg')
def handleTempo( self, widget ):
self.owner._setTempo( widget.get_value() )
img = self.mapRange( widget.value, widget.lower, widget.upper, 1, 8 )
- self.tempoImg.set_from_file(Config.IMAGE_ROOT + 'tempo' + str(img) + '.png')
+ self.tempoImg.set_from_file(Config.TAM_TAM_ROOT + '/icons/tempo' + str(img) + '.svg')
class DesktopToolbar( gtk.Toolbar ):
diff --git a/NEWS b/NEWS
index b7b62cc..5e511ae 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+38
+
+* Adapt to new Palette API (Flipo)
+
37
* Small layout change in edit (Flipo)
diff --git a/TamTam.py b/TamTam.py
index e71b508..7305853 100755..100644
--- a/TamTam.py
+++ b/TamTam.py
@@ -285,6 +285,908 @@ class TamTam(Activity):
elif self.mode == 'jam':
self.metadata['tamtam_subactivity'] = self.mode
self.modeList[self.mode].handleJournalSave(file_path)
+
+class TamTamJam(Activity):
+ # TamTam is the topmost container in the TamTam application
+ # At all times it has one child, which may be one of
+ # - the welcome screen
+ # - the mini-tamtam
+ # - the synth lab
+ # - edit mode
+
+ def __init__(self, handle, mode='welcome'):
+ Activity.__init__(self, handle)
+ self.ensure_dirs()
+
+ color = gtk.gdk.color_parse(Config.WS_BCK_COLOR)
+ self.modify_bg(gtk.STATE_NORMAL, color)
+
+ self.set_title('TamTam Jam')
+ self.set_resizable(False)
+
+ self.trackpad = Trackpad( self )
+ #self.keyboardWindow = KeyboardWindow(size = 8, popup = True)
+ #self.keyboardWindow.color_piano()
+
+ self.preloadTimeout = None
+
+ self.focusInHandler = self.connect('focus_in_event',self.onFocusIn)
+ self.focusOutHandler = self.connect('focus_out_event',self.onFocusOut)
+ self.connect('notify::active', self.onActive)
+ self.connect('destroy', self.onDestroy)
+ self.connect( "key-press-event", self.onKeyPress )
+ self.connect( "key-release-event", self.onKeyRelease )
+ #self.connect( "key-press-event", self.keyboardWindow.handle_keypress)
+ #self.connect( "key-release-event", self.keyboardWindow.handle_keyrelease)
+ #self.connect( "button-press-event", self.keyboardWindow.handle_mousePress)
+ #self.connect( "button-release-event", self.keyboardWindow.handle_mouseRelease)
+
+ self.mode = None
+ self.modeList = {}
+
+ self.instrumentPanel = InstrumentPanel( force_load = False )
+ self.preloadList = [ self.instrumentPanel ]
+
+ #load the sugar toolbar
+ self.toolbox = activity.ActivityToolbox(self)
+ self.set_toolbox(self.toolbox)
+
+ self.activity_toolbar = self.toolbox.get_activity_toolbar()
+ self.activity_toolbar.share.hide()
+ self.activity_toolbar.keep.hide()
+
+ self.toolbox.show()
+
+ self.set_mode("jam")
+
+ def onPreloadTimeout( self ):
+ if Config.DEBUG > 4: print "TamTam::onPreloadTimeout", self.preloadList
+
+ t = time.time()
+ if self.preloadList[0].load( t + 0.100 ): # finished preloading this object
+ self.preloadList.pop(0)
+ if not len(self.preloadList):
+ if Config.DEBUG > 1: print "TamTam::finished preloading", time.time() - t
+ self.preloadTimeout = False
+ return False # finished preloading everything
+
+ if Config.DEBUG > 4: print "TamTam::preload returned after", time.time() - t
+
+ return True
+
+ def doNothing(): #a callback function to appease SynthLab
+ pass
+
+ def set_mode(self, mode, arg = None):
+ if Config.DEBUG: print 'DEBUG: TamTam::set_mode from', self.mode, 'to', mode
+
+ if self.mode != None:
+ self.modeList[ self.mode ].onDeactivate()
+ if FAKE_ACTIVITY:
+ self.remove( self.modeList[ self.mode ] )
+
+ self.mode = None
+ self.trackpad.setContext(mode)
+
+ if mode == 'welcome':
+ if not (mode in self.modeList):
+ self.modeList[mode] = Welcome(self, self.set_mode)
+ self.mode = mode
+ if len( self.preloadList ):
+ self.preloadTimeout = gobject.timeout_add( 300, self.onPreloadTimeout )
+ elif self.preloadTimeout:
+ gobject.source_remove( self.preloadTimeout )
+ self.predrawTimeout = False
+
+ if mode == 'jam':
+ if not (mode in self.modeList):
+ self.metadata['title'] = 'TamTam Jam'
+ self.modeList[mode] = JamMain(self, self.set_mode)
+ self.mode = mode
+
+ if mode == 'mini':
+ if not (mode in self.modeList):
+ self.metadata['title'] = 'TamTam Mini'
+ self.modeList[mode] = miniTamTamMain(self, self.set_mode)
+ else:
+ self.modeList[mode].regenerate()
+ if self.instrumentPanel in self.preloadList:
+ self.instrumentPanel.load() # finish loading
+ self.modeList[mode].setInstrumentPanel( self.instrumentPanel )
+ self.mode = mode
+
+ if mode == 'edit':
+ if not (mode in self.modeList):
+ self.metadata['title'] = 'TamTam Edit'
+ self.modeList[mode] = MainWindow(self, self.set_mode)
+ if self.instrumentPanel in self.preloadList:
+ self.instrumentPanel.load() # finish loading
+ self.modeList[mode].setInstrumentPanel( self.instrumentPanel )
+ self.mode = mode
+
+ if mode == 'synth':
+ if not (mode in self.modeList):
+ self.metadata['title'] = 'TamTam SynthLab'
+ self.modeList[mode] = SynthLabWindow(self, self.set_mode, None)
+ self.mode = mode
+
+ if self.mode == None:
+ print 'DEBUG: TamTam::set_mode invalid mode:', mode
+ else:
+ try: # activity mode
+ self.set_canvas( self.modeList[ self.mode ] )
+ except: # fake mode
+ self.add( self.modeList[ self.mode ] )
+ self.modeList[ self.mode ].onActivate(arg)
+ self.show()
+
+ def onFocusIn(self, event, data=None):
+ if Config.DEBUG > 3: print 'DEBUG: TamTam::onFocusOut in TamTam.py'
+ csnd = new_csound_client()
+ csnd.connect(True)
+ if self.mode == 'synth':
+ self.modeList[ self.mode ].updateSound()
+ self.modeList[ self.mode ].updateTables()
+ #csnd.load_instruments()
+
+ def onFocusOut(self, event, data=None):
+ if Config.DEBUG > 3: print 'DEBUG: TamTam::onFocusOut in TamTam.py'
+ csnd = new_csound_client()
+ csnd.connect(False)
+
+ def onActive(self, widget = None, event = None):
+ pass
+
+ def onKeyPress(self, widget, event):
+ if Config.DEBUG > 5: print 'DEBUG: TamTam::onKeyPress in TamTam.py'
+ if event.state == gtk.gdk.MOD1_MASK:
+ key = event.keyval
+ if key == gtk.keysyms.j:
+ self.set_mode("jam")
+ return
+ elif key == gtk.keysyms.m:
+ self.set_mode('mini')
+ return
+ elif key == gtk.keysyms.s:
+ self.set_mode('synth')
+ return
+ elif key == gtk.keysyms.w:
+ self.set_mode('welcome')
+ return
+ elif key == gtk.keysyms.e:
+ self.set_mode('edit')
+ return
+ elif key == gtk.keysyms.t:
+ self.toolbox.show()
+ return
+ elif key == gtk.keysyms.y:
+ self.toolbox.hide()
+ if self.mode:
+ self.modeList[ self.mode ].onKeyPress(widget, event)
+
+ def onKeyRelease(self, widget, event):
+ if Config.DEBUG > 5: print 'DEBUG: TamTam::onKeyRelease in TamTam.py'
+ self.modeList[ self.mode ].onKeyRelease(widget, event)
+ pass
+
+ def onDestroy(self, arg2):
+ if Config.DEBUG: print 'DEBUG: TamTam::onDestroy()'
+ os.system('rm -f ' + Config.PREF_DIR + '/synthTemp*')
+
+ for m in self.modeList:
+ if self.modeList[m] != None:
+ self.modeList[m].onDestroy()
+
+ csnd = new_csound_client()
+ csnd.connect(False)
+ csnd.destroy()
+
+ gtk.main_quit()
+
+ def ensure_dir(self, dir, perms=0777, rw=os.R_OK|os.W_OK):
+ if not os.path.isdir( dir ):
+ try:
+ os.makedirs(dir, perms)
+ except OSError, e:
+ print 'ERROR: failed to make dir %s: %i (%s)\n' % (dir, e.errno, e.strerror)
+ if not os.access(dir, rw):
+ print 'ERROR: directory %s is missing required r/w access\n' % dir
+
+ def ensure_dirs(self):
+ self.ensure_dir(Config.TUNE_DIR)
+ self.ensure_dir(Config.SYNTH_DIR)
+ self.ensure_dir(Config.SNDS_DIR)
+ self.ensure_dir(Config.SCRATCH_DIR)
+
+ if not os.path.isdir(Config.PREF_DIR):
+ os.mkdir(Config.PREF_DIR)
+ os.system('chmod 0777 ' + Config.PREF_DIR + ' &')
+ for snd in ['mic1','mic2','mic3','mic4','lab1','lab2','lab3','lab4', 'lab5', 'lab6']:
+ shutil.copyfile(Config.SOUNDS_DIR + '/' + snd , Config.SNDS_DIR + '/' + snd)
+ os.system('chmod 0777 ' + Config.SNDS_DIR + '/' + snd + ' &')
+
+ def read_file(self,file_path):
+ self.modeList['jam'].handleJournalLoad(file_path)
+
+ def write_file(self,file_path):
+ self.modeList['jam'].handleJournalSave(file_path)
+
+class TamTamEdit(Activity):
+ # TamTam is the topmost container in the TamTam application
+ # At all times it has one child, which may be one of
+ # - the welcome screen
+ # - the mini-tamtam
+ # - the synth lab
+ # - edit mode
+
+ def __init__(self, handle, mode='edit'):
+ Activity.__init__(self, handle)
+ self.ensure_dirs()
+
+ color = gtk.gdk.color_parse(Config.WS_BCK_COLOR)
+ self.modify_bg(gtk.STATE_NORMAL, color)
+
+ self.set_title('TamTam Edit')
+ self.set_resizable(False)
+
+ self.trackpad = Trackpad( self )
+ #self.keyboardWindow = KeyboardWindow(size = 8, popup = True)
+ #self.keyboardWindow.color_piano()
+
+ self.preloadTimeout = None
+
+ self.focusInHandler = self.connect('focus_in_event',self.onFocusIn)
+ self.focusOutHandler = self.connect('focus_out_event',self.onFocusOut)
+ self.connect('notify::active', self.onActive)
+ self.connect('destroy', self.onDestroy)
+ self.connect( "key-press-event", self.onKeyPress )
+ self.connect( "key-release-event", self.onKeyRelease )
+ #self.connect( "key-press-event", self.keyboardWindow.handle_keypress)
+ #self.connect( "key-release-event", self.keyboardWindow.handle_keyrelease)
+ #self.connect( "button-press-event", self.keyboardWindow.handle_mousePress)
+ #self.connect( "button-release-event", self.keyboardWindow.handle_mouseRelease)
+
+ self.mode = None
+ self.modeList = {}
+
+ self.instrumentPanel = InstrumentPanel( force_load = False )
+ self.preloadList = [ self.instrumentPanel ]
+
+ #load the sugar toolbar
+ self.toolbox = activity.ActivityToolbox(self)
+ self.set_toolbox(self.toolbox)
+
+ self.activity_toolbar = self.toolbox.get_activity_toolbar()
+ self.activity_toolbar.share.hide()
+ self.activity_toolbar.keep.hide()
+
+ self.toolbox.show()
+
+ self.set_mode("edit")
+
+ def onPreloadTimeout( self ):
+ if Config.DEBUG > 4: print "TamTam::onPreloadTimeout", self.preloadList
+
+ t = time.time()
+ if self.preloadList[0].load( t + 0.100 ): # finished preloading this object
+ self.preloadList.pop(0)
+ if not len(self.preloadList):
+ if Config.DEBUG > 1: print "TamTam::finished preloading", time.time() - t
+ self.preloadTimeout = False
+ return False # finished preloading everything
+
+ if Config.DEBUG > 4: print "TamTam::preload returned after", time.time() - t
+
+ return True
+
+ def doNothing(): #a callback function to appease SynthLab
+ pass
+
+ def set_mode(self, mode, arg = None):
+ if Config.DEBUG: print 'DEBUG: TamTam::set_mode from', self.mode, 'to', mode
+
+ if self.mode != None:
+ self.modeList[ self.mode ].onDeactivate()
+ if FAKE_ACTIVITY:
+ self.remove( self.modeList[ self.mode ] )
+
+ self.mode = None
+ self.trackpad.setContext(mode)
+
+ if mode == 'welcome':
+ if not (mode in self.modeList):
+ self.modeList[mode] = Welcome(self, self.set_mode)
+ self.mode = mode
+ if len( self.preloadList ):
+ self.preloadTimeout = gobject.timeout_add( 300, self.onPreloadTimeout )
+ elif self.preloadTimeout:
+ gobject.source_remove( self.preloadTimeout )
+ self.predrawTimeout = False
+
+ if mode == 'jam':
+ if not (mode in self.modeList):
+ self.metadata['title'] = 'TamTam Jam'
+ self.modeList[mode] = JamMain(self, self.set_mode)
+ self.mode = mode
+
+ if mode == 'mini':
+ if not (mode in self.modeList):
+ self.metadata['title'] = 'TamTam Mini'
+ self.modeList[mode] = miniTamTamMain(self, self.set_mode)
+ else:
+ self.modeList[mode].regenerate()
+ if self.instrumentPanel in self.preloadList:
+ self.instrumentPanel.load() # finish loading
+ self.modeList[mode].setInstrumentPanel( self.instrumentPanel )
+ self.mode = mode
+
+ if mode == 'edit':
+ if not (mode in self.modeList):
+ self.metadata['title'] = 'TamTam Edit'
+ self.modeList[mode] = MainWindow(self, self.set_mode)
+ if self.instrumentPanel in self.preloadList:
+ self.instrumentPanel.load() # finish loading
+ self.modeList[mode].setInstrumentPanel( self.instrumentPanel )
+ self.mode = mode
+
+ if mode == 'synth':
+ if not (mode in self.modeList):
+ self.metadata['title'] = 'TamTam SynthLab'
+ self.modeList[mode] = SynthLabWindow(self, self.set_mode, None)
+ self.mode = mode
+
+ if self.mode == None:
+ print 'DEBUG: TamTam::set_mode invalid mode:', mode
+ else:
+ try: # activity mode
+ self.set_canvas( self.modeList[ self.mode ] )
+ except: # fake mode
+ self.add( self.modeList[ self.mode ] )
+ self.modeList[ self.mode ].onActivate(arg)
+ self.show()
+
+ def onFocusIn(self, event, data=None):
+ if Config.DEBUG > 3: print 'DEBUG: TamTam::onFocusOut in TamTam.py'
+ csnd = new_csound_client()
+ csnd.connect(True)
+ if self.mode == 'synth':
+ self.modeList[ self.mode ].updateSound()
+ self.modeList[ self.mode ].updateTables()
+ #csnd.load_instruments()
+
+ def onFocusOut(self, event, data=None):
+ if Config.DEBUG > 3: print 'DEBUG: TamTam::onFocusOut in TamTam.py'
+ csnd = new_csound_client()
+ csnd.connect(False)
+
+ def onActive(self, widget = None, event = None):
+ pass
+
+ def onKeyPress(self, widget, event):
+ if Config.DEBUG > 5: print 'DEBUG: TamTam::onKeyPress in TamTam.py'
+ if event.state == gtk.gdk.MOD1_MASK:
+ key = event.keyval
+ if key == gtk.keysyms.j:
+ self.set_mode("jam")
+ return
+ elif key == gtk.keysyms.m:
+ self.set_mode('mini')
+ return
+ elif key == gtk.keysyms.s:
+ self.set_mode('synth')
+ return
+ elif key == gtk.keysyms.w:
+ self.set_mode('welcome')
+ return
+ elif key == gtk.keysyms.e:
+ self.set_mode('edit')
+ return
+ elif key == gtk.keysyms.t:
+ self.toolbox.show()
+ return
+ elif key == gtk.keysyms.y:
+ self.toolbox.hide()
+ if self.mode:
+ self.modeList[ self.mode ].onKeyPress(widget, event)
+
+ def onKeyRelease(self, widget, event):
+ if Config.DEBUG > 5: print 'DEBUG: TamTam::onKeyRelease in TamTam.py'
+ self.modeList[ self.mode ].onKeyRelease(widget, event)
+ pass
+
+ def onDestroy(self, arg2):
+ if Config.DEBUG: print 'DEBUG: TamTam::onDestroy()'
+ os.system('rm -f ' + Config.PREF_DIR + '/synthTemp*')
+
+ for m in self.modeList:
+ if self.modeList[m] != None:
+ self.modeList[m].onDestroy()
+
+ csnd = new_csound_client()
+ csnd.connect(False)
+ csnd.destroy()
+
+ gtk.main_quit()
+
+ def ensure_dir(self, dir, perms=0777, rw=os.R_OK|os.W_OK):
+ if not os.path.isdir( dir ):
+ try:
+ os.makedirs(dir, perms)
+ except OSError, e:
+ print 'ERROR: failed to make dir %s: %i (%s)\n' % (dir, e.errno, e.strerror)
+ if not os.access(dir, rw):
+ print 'ERROR: directory %s is missing required r/w access\n' % dir
+
+ def ensure_dirs(self):
+ self.ensure_dir(Config.TUNE_DIR)
+ self.ensure_dir(Config.SYNTH_DIR)
+ self.ensure_dir(Config.SNDS_DIR)
+ self.ensure_dir(Config.SCRATCH_DIR)
+
+ if not os.path.isdir(Config.PREF_DIR):
+ os.mkdir(Config.PREF_DIR)
+ os.system('chmod 0777 ' + Config.PREF_DIR + ' &')
+ for snd in ['mic1','mic2','mic3','mic4','lab1','lab2','lab3','lab4', 'lab5', 'lab6']:
+ shutil.copyfile(Config.SOUNDS_DIR + '/' + snd , Config.SNDS_DIR + '/' + snd)
+ os.system('chmod 0777 ' + Config.SNDS_DIR + '/' + snd + ' &')
+
+ def read_file(self,file_path):
+ self.modeList['edit'].handleJournalLoad(file_path)
+
+ def write_file(self,file_path):
+ self.modeList['edit'].handleJournalSave(file_path)
+
+class TamTamSynthLab(Activity):
+ # TamTam is the topmost container in the TamTam application
+ # At all times it has one child, which may be one of
+ # - the welcome screen
+ # - the mini-tamtam
+ # - the synth lab
+ # - edit mode
+
+ def __init__(self, handle, mode='synth'):
+ Activity.__init__(self, handle)
+ self.ensure_dirs()
+
+ color = gtk.gdk.color_parse(Config.WS_BCK_COLOR)
+ self.modify_bg(gtk.STATE_NORMAL, color)
+
+ self.set_title('TamTam SynthLab')
+ self.set_resizable(False)
+
+ self.trackpad = Trackpad( self )
+ #self.keyboardWindow = KeyboardWindow(size = 8, popup = True)
+ #self.keyboardWindow.color_piano()
+
+ self.preloadTimeout = None
+
+ self.focusInHandler = self.connect('focus_in_event',self.onFocusIn)
+ self.focusOutHandler = self.connect('focus_out_event',self.onFocusOut)
+ self.connect('notify::active', self.onActive)
+ self.connect('destroy', self.onDestroy)
+ self.connect( "key-press-event", self.onKeyPress )
+ self.connect( "key-release-event", self.onKeyRelease )
+ #self.connect( "key-press-event", self.keyboardWindow.handle_keypress)
+ #self.connect( "key-release-event", self.keyboardWindow.handle_keyrelease)
+ #self.connect( "button-press-event", self.keyboardWindow.handle_mousePress)
+ #self.connect( "button-release-event", self.keyboardWindow.handle_mouseRelease)
+
+ self.mode = None
+ self.modeList = {}
+
+ self.instrumentPanel = InstrumentPanel( force_load = False )
+ self.preloadList = [ self.instrumentPanel ]
+
+ #load the sugar toolbar
+ self.toolbox = activity.ActivityToolbox(self)
+ self.set_toolbox(self.toolbox)
+
+ self.activity_toolbar = self.toolbox.get_activity_toolbar()
+ self.activity_toolbar.share.hide()
+ self.activity_toolbar.keep.hide()
+
+ self.toolbox.show()
+
+ self.set_mode("synth")
+
+ def onPreloadTimeout( self ):
+ if Config.DEBUG > 4: print "TamTam::onPreloadTimeout", self.preloadList
+
+ t = time.time()
+ if self.preloadList[0].load( t + 0.100 ): # finished preloading this object
+ self.preloadList.pop(0)
+ if not len(self.preloadList):
+ if Config.DEBUG > 1: print "TamTam::finished preloading", time.time() - t
+ self.preloadTimeout = False
+ return False # finished preloading everything
+
+ if Config.DEBUG > 4: print "TamTam::preload returned after", time.time() - t
+
+ return True
+
+ def doNothing(): #a callback function to appease SynthLab
+ pass
+
+ def set_mode(self, mode, arg = None):
+ if Config.DEBUG: print 'DEBUG: TamTam::set_mode from', self.mode, 'to', mode
+
+ if self.mode != None:
+ self.modeList[ self.mode ].onDeactivate()
+ if FAKE_ACTIVITY:
+ self.remove( self.modeList[ self.mode ] )
+
+ self.mode = None
+ self.trackpad.setContext(mode)
+
+ if mode == 'welcome':
+ if not (mode in self.modeList):
+ self.modeList[mode] = Welcome(self, self.set_mode)
+ self.mode = mode
+ if len( self.preloadList ):
+ self.preloadTimeout = gobject.timeout_add( 300, self.onPreloadTimeout )
+ elif self.preloadTimeout:
+ gobject.source_remove( self.preloadTimeout )
+ self.predrawTimeout = False
+
+ if mode == 'jam':
+ if not (mode in self.modeList):
+ self.metadata['title'] = 'TamTam Jam'
+ self.modeList[mode] = JamMain(self, self.set_mode)
+ self.mode = mode
+
+ if mode == 'mini':
+ if not (mode in self.modeList):
+ self.metadata['title'] = 'TamTam Mini'
+ self.modeList[mode] = miniTamTamMain(self, self.set_mode)
+ else:
+ self.modeList[mode].regenerate()
+ if self.instrumentPanel in self.preloadList:
+ self.instrumentPanel.load() # finish loading
+ self.modeList[mode].setInstrumentPanel( self.instrumentPanel )
+ self.mode = mode
+
+ if mode == 'edit':
+ if not (mode in self.modeList):
+ self.metadata['title'] = 'TamTam Edit'
+ self.modeList[mode] = MainWindow(self, self.set_mode)
+ if self.instrumentPanel in self.preloadList:
+ self.instrumentPanel.load() # finish loading
+ self.modeList[mode].setInstrumentPanel( self.instrumentPanel )
+ self.mode = mode
+
+ if mode == 'synth':
+ if not (mode in self.modeList):
+ self.metadata['title'] = 'TamTam SynthLab'
+ self.modeList[mode] = SynthLabWindow(self, self.set_mode, None)
+ self.mode = mode
+
+ if self.mode == None:
+ print 'DEBUG: TamTam::set_mode invalid mode:', mode
+ else:
+ try: # activity mode
+ self.set_canvas( self.modeList[ self.mode ] )
+ except: # fake mode
+ self.add( self.modeList[ self.mode ] )
+ self.modeList[ self.mode ].onActivate(arg)
+ self.show()
+
+ def onFocusIn(self, event, data=None):
+ if Config.DEBUG > 3: print 'DEBUG: TamTam::onFocusOut in TamTam.py'
+ csnd = new_csound_client()
+ csnd.connect(True)
+ if self.mode == 'synth':
+ self.modeList[ self.mode ].updateSound()
+ self.modeList[ self.mode ].updateTables()
+ #csnd.load_instruments()
+
+ def onFocusOut(self, event, data=None):
+ if Config.DEBUG > 3: print 'DEBUG: TamTam::onFocusOut in TamTam.py'
+ csnd = new_csound_client()
+ csnd.connect(False)
+
+ def onActive(self, widget = None, event = None):
+ pass
+
+ def onKeyPress(self, widget, event):
+ if Config.DEBUG > 5: print 'DEBUG: TamTam::onKeyPress in TamTam.py'
+ if event.state == gtk.gdk.MOD1_MASK:
+ key = event.keyval
+ if key == gtk.keysyms.j:
+ self.set_mode("jam")
+ return
+ elif key == gtk.keysyms.m:
+ self.set_mode('mini')
+ return
+ elif key == gtk.keysyms.s:
+ self.set_mode('synth')
+ return
+ elif key == gtk.keysyms.w:
+ self.set_mode('welcome')
+ return
+ elif key == gtk.keysyms.e:
+ self.set_mode('edit')
+ return
+ elif key == gtk.keysyms.t:
+ self.toolbox.show()
+ return
+ elif key == gtk.keysyms.y:
+ self.toolbox.hide()
+ if self.mode:
+ self.modeList[ self.mode ].onKeyPress(widget, event)
+
+ def onKeyRelease(self, widget, event):
+ if Config.DEBUG > 5: print 'DEBUG: TamTam::onKeyRelease in TamTam.py'
+ self.modeList[ self.mode ].onKeyRelease(widget, event)
+ pass
+
+ def onDestroy(self, arg2):
+ if Config.DEBUG: print 'DEBUG: TamTam::onDestroy()'
+ os.system('rm -f ' + Config.PREF_DIR + '/synthTemp*')
+
+ for m in self.modeList:
+ if self.modeList[m] != None:
+ self.modeList[m].onDestroy()
+
+ csnd = new_csound_client()
+ csnd.connect(False)
+ csnd.destroy()
+
+ gtk.main_quit()
+
+ def ensure_dir(self, dir, perms=0777, rw=os.R_OK|os.W_OK):
+ if not os.path.isdir( dir ):
+ try:
+ os.makedirs(dir, perms)
+ except OSError, e:
+ print 'ERROR: failed to make dir %s: %i (%s)\n' % (dir, e.errno, e.strerror)
+ if not os.access(dir, rw):
+ print 'ERROR: directory %s is missing required r/w access\n' % dir
+
+ def ensure_dirs(self):
+ self.ensure_dir(Config.TUNE_DIR)
+ self.ensure_dir(Config.SYNTH_DIR)
+ self.ensure_dir(Config.SNDS_DIR)
+ self.ensure_dir(Config.SCRATCH_DIR)
+
+ if not os.path.isdir(Config.PREF_DIR):
+ os.mkdir(Config.PREF_DIR)
+ os.system('chmod 0777 ' + Config.PREF_DIR + ' &')
+ for snd in ['mic1','mic2','mic3','mic4','lab1','lab2','lab3','lab4', 'lab5', 'lab6']:
+ shutil.copyfile(Config.SOUNDS_DIR + '/' + snd , Config.SNDS_DIR + '/' + snd)
+ os.system('chmod 0777 ' + Config.SNDS_DIR + '/' + snd + ' &')
+
+ def read_file(self,file_path):
+ self.modeList['synth'].handleJournalLoad(file_path)
+
+ def write_file(self,file_path):
+ self.modeList['synth'].handleJournalSave(file_path)
+
+class TamTamMini(Activity):
+ # TamTam is the topmost container in the TamTam application
+ # At all times it has one child, which may be one of
+ # - the welcome screen
+ # - the mini-tamtam
+ # - the synth lab
+ # - edit mode
+
+ def __init__(self, handle, mode='mini'):
+ Activity.__init__(self, handle)
+ self.ensure_dirs()
+
+ color = gtk.gdk.color_parse(Config.WS_BCK_COLOR)
+ self.modify_bg(gtk.STATE_NORMAL, color)
+
+ self.set_title('TamTam Mini')
+ self.set_resizable(False)
+
+ self.trackpad = Trackpad( self )
+ #self.keyboardWindow = KeyboardWindow(size = 8, popup = True)
+ #self.keyboardWindow.color_piano()
+
+ self.preloadTimeout = None
+
+ self.focusInHandler = self.connect('focus_in_event',self.onFocusIn)
+ self.focusOutHandler = self.connect('focus_out_event',self.onFocusOut)
+ self.connect('notify::active', self.onActive)
+ self.connect('destroy', self.onDestroy)
+ self.connect( "key-press-event", self.onKeyPress )
+ self.connect( "key-release-event", self.onKeyRelease )
+ #self.connect( "key-press-event", self.keyboardWindow.handle_keypress)
+ #self.connect( "key-release-event", self.keyboardWindow.handle_keyrelease)
+ #self.connect( "button-press-event", self.keyboardWindow.handle_mousePress)
+ #self.connect( "button-release-event", self.keyboardWindow.handle_mouseRelease)
+
+ self.mode = None
+ self.modeList = {}
+
+ self.instrumentPanel = InstrumentPanel( force_load = False )
+ self.preloadList = [ self.instrumentPanel ]
+
+ #load the sugar toolbar
+ self.toolbox = activity.ActivityToolbox(self)
+ self.set_toolbox(self.toolbox)
+
+ self.activity_toolbar = self.toolbox.get_activity_toolbar()
+ self.activity_toolbar.share.hide()
+ self.activity_toolbar.keep.hide()
+
+ self.toolbox.show()
+
+ self.set_mode("mini")
+
+ def onPreloadTimeout( self ):
+ if Config.DEBUG > 4: print "TamTam::onPreloadTimeout", self.preloadList
+
+ t = time.time()
+ if self.preloadList[0].load( t + 0.100 ): # finished preloading this object
+ self.preloadList.pop(0)
+ if not len(self.preloadList):
+ if Config.DEBUG > 1: print "TamTam::finished preloading", time.time() - t
+ self.preloadTimeout = False
+ return False # finished preloading everything
+
+ if Config.DEBUG > 4: print "TamTam::preload returned after", time.time() - t
+
+ return True
+
+ def doNothing(): #a callback function to appease SynthLab
+ pass
+
+ def set_mode(self, mode, arg = None):
+ if Config.DEBUG: print 'DEBUG: TamTam::set_mode from', self.mode, 'to', mode
+
+ if self.mode != None:
+ self.modeList[ self.mode ].onDeactivate()
+ if FAKE_ACTIVITY:
+ self.remove( self.modeList[ self.mode ] )
+
+ self.mode = None
+ self.trackpad.setContext(mode)
+
+ if mode == 'welcome':
+ if not (mode in self.modeList):
+ self.modeList[mode] = Welcome(self, self.set_mode)
+ self.mode = mode
+ if len( self.preloadList ):
+ self.preloadTimeout = gobject.timeout_add( 300, self.onPreloadTimeout )
+ elif self.preloadTimeout:
+ gobject.source_remove( self.preloadTimeout )
+ self.predrawTimeout = False
+
+ if mode == 'jam':
+ if not (mode in self.modeList):
+ self.metadata['title'] = 'TamTam Jam'
+ self.modeList[mode] = JamMain(self, self.set_mode)
+ self.mode = mode
+
+ if mode == 'mini':
+ if not (mode in self.modeList):
+ self.metadata['title'] = 'TamTam Mini'
+ self.modeList[mode] = miniTamTamMain(self, self.set_mode)
+ else:
+ self.modeList[mode].regenerate()
+ if self.instrumentPanel in self.preloadList:
+ self.instrumentPanel.load() # finish loading
+ self.modeList[mode].setInstrumentPanel( self.instrumentPanel )
+ self.mode = mode
+
+ if mode == 'edit':
+ if not (mode in self.modeList):
+ self.metadata['title'] = 'TamTam Edit'
+ self.modeList[mode] = MainWindow(self, self.set_mode)
+ if self.instrumentPanel in self.preloadList:
+ self.instrumentPanel.load() # finish loading
+ self.modeList[mode].setInstrumentPanel( self.instrumentPanel )
+ self.mode = mode
+
+ if mode == 'synth':
+ if not (mode in self.modeList):
+ self.metadata['title'] = 'TamTam SynthLab'
+ self.modeList[mode] = SynthLabWindow(self, self.set_mode, None)
+ self.mode = mode
+
+ if self.mode == None:
+ print 'DEBUG: TamTam::set_mode invalid mode:', mode
+ else:
+ try: # activity mode
+ self.set_canvas( self.modeList[ self.mode ] )
+ except: # fake mode
+ self.add( self.modeList[ self.mode ] )
+ self.modeList[ self.mode ].onActivate(arg)
+ self.show()
+
+ def onFocusIn(self, event, data=None):
+ if Config.DEBUG > 3: print 'DEBUG: TamTam::onFocusOut in TamTam.py'
+ csnd = new_csound_client()
+ csnd.connect(True)
+ if self.mode == 'synth':
+ self.modeList[ self.mode ].updateSound()
+ self.modeList[ self.mode ].updateTables()
+ #csnd.load_instruments()
+
+ def onFocusOut(self, event, data=None):
+ if Config.DEBUG > 3: print 'DEBUG: TamTam::onFocusOut in TamTam.py'
+ csnd = new_csound_client()
+ csnd.connect(False)
+
+ def onActive(self, widget = None, event = None):
+ pass
+
+ def onKeyPress(self, widget, event):
+ if Config.DEBUG > 5: print 'DEBUG: TamTam::onKeyPress in TamTam.py'
+ if event.state == gtk.gdk.MOD1_MASK:
+ key = event.keyval
+ if key == gtk.keysyms.j:
+ self.set_mode("jam")
+ return
+ elif key == gtk.keysyms.m:
+ self.set_mode('mini')
+ return
+ elif key == gtk.keysyms.s:
+ self.set_mode('synth')
+ return
+ elif key == gtk.keysyms.w:
+ self.set_mode('welcome')
+ return
+ elif key == gtk.keysyms.e:
+ self.set_mode('edit')
+ return
+ elif key == gtk.keysyms.t:
+ self.toolbox.show()
+ return
+ elif key == gtk.keysyms.y:
+ self.toolbox.hide()
+ if self.mode:
+ self.modeList[ self.mode ].onKeyPress(widget, event)
+
+ def onKeyRelease(self, widget, event):
+ if Config.DEBUG > 5: print 'DEBUG: TamTam::onKeyRelease in TamTam.py'
+ self.modeList[ self.mode ].onKeyRelease(widget, event)
+ pass
+
+ def onDestroy(self, arg2):
+ if Config.DEBUG: print 'DEBUG: TamTam::onDestroy()'
+ os.system('rm -f ' + Config.PREF_DIR + '/synthTemp*')
+
+ for m in self.modeList:
+ if self.modeList[m] != None:
+ self.modeList[m].onDestroy()
+
+ csnd = new_csound_client()
+ csnd.connect(False)
+ csnd.destroy()
+
+ gtk.main_quit()
+
+ def ensure_dir(self, dir, perms=0777, rw=os.R_OK|os.W_OK):
+ if not os.path.isdir( dir ):
+ try:
+ os.makedirs(dir, perms)
+ except OSError, e:
+ print 'ERROR: failed to make dir %s: %i (%s)\n' % (dir, e.errno, e.strerror)
+ if not os.access(dir, rw):
+ print 'ERROR: directory %s is missing required r/w access\n' % dir
+
+ def ensure_dirs(self):
+ self.ensure_dir(Config.TUNE_DIR)
+ self.ensure_dir(Config.SYNTH_DIR)
+ self.ensure_dir(Config.SNDS_DIR)
+ self.ensure_dir(Config.SCRATCH_DIR)
+
+ if not os.path.isdir(Config.PREF_DIR):
+ os.mkdir(Config.PREF_DIR)
+ os.system('chmod 0777 ' + Config.PREF_DIR + ' &')
+ for snd in ['mic1','mic2','mic3','mic4','lab1','lab2','lab3','lab4', 'lab5', 'lab6']:
+ shutil.copyfile(Config.SOUNDS_DIR + '/' + snd , Config.SNDS_DIR + '/' + snd)
+ os.system('chmod 0777 ' + Config.SNDS_DIR + '/' + snd + ' &')
+
+ def read_file(self,file_path):
+ self.metadata['tamtam_subactivity'] = 'mini'
+
+ def write_file(self,file_path):
+ f = open(file_path,'w')
+ f.close()
+
if __name__ == "__main__":
diff --git a/Util/ThemeWidgets.py b/Util/ThemeWidgets.py
index 06828ca..0acc498 100644
--- a/Util/ThemeWidgets.py
+++ b/Util/ThemeWidgets.py
@@ -863,6 +863,7 @@ class ImageButton(gtk.Button):
def set_palette(self, palette):
self._palette = palette
self._palette.props.invoker = WidgetInvoker(self)
+ self._palette.props.invoker._position_hint = WidgetInvoker.AT_CURSOR
class ImageToggleButton(gtk.ToggleButton):
@@ -1021,6 +1022,7 @@ class ImageToggleButton(gtk.ToggleButton):
def set_palette(self, palette):
self._palette = palette
self._palette.props.invoker = WidgetInvoker(self)
+ self._palette.props.invoker._position_hint = WidgetInvoker.AT_CURSOR
class ImageRadioButton(gtk.RadioButton):
@@ -1179,6 +1181,7 @@ class ImageRadioButton(gtk.RadioButton):
def set_palette(self, palette):
self._palette = palette
self._palette.props.invoker = WidgetInvoker(self)
+ self._palette.props.invoker._position_hint = WidgetInvoker.AT_CURSOR
class keyButton(gtk.Button):
import cairo
diff --git a/activity/activity-tamtam.svg b/activity/activity-tamtam.svg
index a9f0279..563df7b 100644
--- a/activity/activity-tamtam.svg
+++ b/activity/activity-tamtam.svg
@@ -1,45 +1,24 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 12.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
- <!ENTITY ns_svg "http://www.w3.org/2000/svg">
- <!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
- <!ENTITY stroke_color "#000000">
- <!ENTITY fill_color "#AAAAAA">
-]>
-<svg version="1.1" id="Icon" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="44.346" height="50.289"
- viewBox="0 0 44.346 50.289" overflow="visible" enable-background="new 0 0 44.346 50.289" xml:space="preserve">
-<g id="Drum">
- <rect id="rect10" x="6.395" y="22.177" fill="&fill_color;" stroke="&stroke_color;" stroke-width="3.5" width="32.002" height="21.371"/>
- <path id="path21" fill="none" stroke="&stroke_color;" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" d="
- M38.395,43.546l-8.469-21.369l-0.002-0.002L22.27,43.544l-7.625-21.367L6.394,43.546"/>
-
- <linearGradient id="path8_1_" gradientUnits="userSpaceOnUse" x1="3.8826" y1="760.2461" x2="40.9119" y2="760.2461" gradientTransform="matrix(1 0 0 1 0 -740.5645)">
- <stop offset="0" style="stop-color:&stroke_color;"/>
- <stop offset="1" style="stop-color:&stroke_color;"/>
- </linearGradient>
- <path id="path8" fill="url(#path8_1_)" stroke="&stroke_color;" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" d="
- M5.237,17.188h34.321c0.747,0,1.354,0.606,1.354,1.354v2.281c0,0.746-0.605,1.353-1.354,1.353H5.237
- c-0.749,0-1.354-0.606-1.354-1.353v-2.281C3.882,17.794,4.488,17.188,5.237,17.188z"/>
-
- <linearGradient id="path17_1_" gradientUnits="userSpaceOnUse" x1="3.8826" y1="786.6074" x2="40.9119" y2="786.6074" gradientTransform="matrix(1 0 0 1 0 -740.5645)">
- <stop offset="0" style="stop-color:&stroke_color;"/>
- <stop offset="1" style="stop-color:&stroke_color;"/>
- </linearGradient>
- <path id="path17" fill="url(#path17_1_)" stroke="&stroke_color;" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" d="
- M5.237,43.548h34.321c0.747,0,1.354,0.604,1.354,1.353v2.281c0,0.75-0.605,1.357-1.354,1.357H5.237
- c-0.749,0-1.354-0.607-1.354-1.357V44.9C3.882,44.156,4.488,43.548,5.237,43.548z"/>
-</g>
-<g id="Drumstick_2">
- <path id="path25" fill="&fill_color;" stroke="&stroke_color;" stroke-width="3.5" d="M28.111,15.492c-1.005,1.087-2.702,1.148-3.795,0.139
- c-1.088-1.009-1.155-2.706-0.148-3.793c1.005-1.087,2.704-1.149,3.791-0.141C29.049,12.707,29.117,14.404,28.111,15.492z"/>
-
- <line id="line27" fill="none" stroke="&stroke_color;" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" x1="28.451" y1="12.312" x2="42.595" y2="5.357"/>
-</g>
-<g id="Drumstick_1">
- <path id="path23" fill="&fill_color;" stroke="&stroke_color;" stroke-width="3.5" d="M20.755,9.079c0.531,1.401-0.166,2.961-1.554,3.488
- s-2.944-0.182-3.475-1.582c-0.528-1.4,0.168-2.962,1.554-3.489C18.669,6.972,20.225,7.679,20.755,9.079z"/>
-
- <line id="line29" fill="none" stroke="&stroke_color;" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" x1="1.75" y1="1.75" x2="15.865" y2="8.768"/>
-</g>
-</svg>
+<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' [
+ <!ENTITY stroke_color "#010101">
+ <!ENTITY fill_color "#FFFFFF">
+]><svg enable-background="new 0 0 55 55" height="55px" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px"><g display="block" id="activity-tamtam">
+
+ <path d=" M9.653,18.199h35.54c0.772,0,1.4,0.628,1.4,1.403v2.362c0,0.771-0.628,1.401-1.4,1.401H9.653c-0.775,0-1.403-0.628-1.403-1.401 v-2.361C8.25,18.826,8.877,18.199,9.653,18.199z" display="inline" fill="&stroke_color;" id="path8" stroke="&stroke_color;" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5"/>
+
+ <rect display="inline" fill="&fill_color;" height="22.128" id="rect10" stroke="&stroke_color;" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5" width="33.139" x="10.852" y="23.365"/>
+
+ <path d=" M9.653,45.493h35.54c0.772,0,1.4,0.627,1.4,1.401v2.362c0,0.775-0.628,1.405-1.4,1.405H9.653c-0.775,0-1.403-0.629-1.403-1.405 v-2.362C8.25,46.124,8.877,45.493,9.653,45.493z" display="inline" fill="&stroke_color;" id="path17" stroke="&stroke_color;" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5"/>
+
+ <path d=" M10.851,45.491l8.544-22.126l7.896,22.125l7.926-22.126" display="inline" fill="none" id="path19" stroke="&stroke_color;" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5"/>
+
+ <path d=" M43.987,45.491l-8.77-22.126" display="inline" fill="none" id="path21" stroke="&stroke_color;" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5"/>
+
+ <line display="inline" fill="none" id="line27" stroke="&stroke_color;" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5" x1="33.69" x2="48.336" y1="13.149" y2="5.948"/>
+
+ <line display="inline" fill="none" id="line29" stroke="&stroke_color;" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5" x1="6.042" x2="20.658" y1="2.213" y2="9.48"/>
+
+ <path d=" M25.721,9.802c0.55,1.451-0.171,3.066-1.608,3.612c-1.437,0.545-3.049-0.188-3.599-1.639c-0.547-1.45,0.174-3.067,1.609-3.613 C23.561,7.62,25.172,8.352,25.721,9.802z" display="inline" fill="&fill_color;" id="path23" stroke="&stroke_color;" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.25"/>
+
+ <path d=" M33.338,16.442c-1.04,1.125-2.798,1.189-3.928,0.144c-1.128-1.044-1.197-2.801-0.155-3.927c1.041-1.125,2.8-1.19,3.926-0.146 C34.31,13.558,34.381,15.316,33.338,16.442z" display="inline" fill="&fill_color;" id="path25" stroke="&stroke_color;" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.25"/>
+</g></svg>
diff --git a/activity/activity-tamtamedit.svg b/activity/activity-tamtamedit.svg
new file mode 100644
index 0000000..73e9998
--- /dev/null
+++ b/activity/activity-tamtamedit.svg
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14576) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Calque_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ width="48.5px" height="51.725px" viewBox="0 0 48.5 51.725" enable-background="new 0 0 48.5 51.725" xml:space="preserve">
+<line id="line27" fill="none" stroke="#010101" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" x1="31.272" y1="12.686" x2="45.919" y2="5.485"/>
+<line id="line29" fill="none" stroke="#010101" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" x1="3.625" y1="1.75" x2="18.241" y2="9.017"/>
+<path id="path23" fill="#FFFFFF" stroke="#010101" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" d="
+ M23.304,9.339c0.55,1.451-0.171,3.066-1.608,3.612c-1.437,0.545-3.049-0.188-3.599-1.639c-0.547-1.45,0.174-3.067,1.609-3.613
+ C21.144,7.157,22.755,7.889,23.304,9.339z"/>
+<path id="path25" fill="#FFFFFF" stroke="#010101" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" d="
+ M30.921,15.979c-1.04,1.125-2.798,1.189-3.928,0.144c-1.128-1.044-1.197-2.801-0.155-3.927c1.041-1.125,2.8-1.19,3.927-0.146
+ C31.894,13.095,31.964,14.853,30.921,15.979z"/>
+<path id="path25_1_" stroke="#010101" stroke-linecap="round" stroke-linejoin="round" d="M11.276,39.136
+ c1.04-1.125,2.798-1.189,3.928-0.144c1.128,1.044,1.197,2.801,0.155,3.927c-1.041,1.125-2.8,1.19-3.927,0.146
+ C10.303,42.02,10.233,40.262,11.276,39.136z"/>
+<path id="path25_2_" stroke="#010101" stroke-linecap="round" stroke-linejoin="round" d="M19.671,36.032
+ c1.04-1.125,2.798-1.189,3.928-0.144c1.128,1.044,1.197,2.801,0.155,3.927c-1.041,1.125-2.8,1.19-3.927,0.146
+ C18.699,38.916,18.628,37.158,19.671,36.032z"/>
+<path id="path25_3_" stroke="#010101" stroke-linecap="round" stroke-linejoin="round" d="M31.171,38.365
+ c1.04-1.125,2.798-1.189,3.928-0.144c1.128,1.044,1.197,2.801,0.155,3.927c-1.041,1.125-2.8,1.19-3.927,0.146
+ C30.199,41.249,30.128,39.491,31.171,38.365z"/>
+<rect x="1.75" y="17.975" fill-rule="evenodd" clip-rule="evenodd" fill="none" stroke="#000000" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="bevel" width="45" height="32"/>
+<line fill="none" stroke="#000000" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" x1="23.551" y1="24.641" x2="16.062" y2="27.725"/>
+<line fill="none" stroke="#000000" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" x1="23.932" y1="22.891" x2="15.932" y2="25.975"/>
+<line fill="none" stroke="#000000" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" x1="24.051" y1="23.475" x2="24.051" y2="37.475"/>
+<line fill="none" stroke="#000000" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" x1="15.718" y1="25.975" x2="15.718" y2="39.975"/>
+<line fill="none" stroke="#010101" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" x1="35.542" y1="39.454" x2="35.542" y2="23.454"/>
+</svg>
diff --git a/activity/activity-tamtamsynthlab.svg b/activity/activity-tamtamsynthlab.svg
new file mode 100644
index 0000000..12b81ce
--- /dev/null
+++ b/activity/activity-tamtamsynthlab.svg
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14576) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Calque_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ width="45.794px" height="51.787px" viewBox="0 0 45.794 51.787" enable-background="new 0 0 45.794 51.787" xml:space="preserve">
+<path fill-rule="evenodd" clip-rule="evenodd" fill="none" stroke="#000000" stroke-width="3.5" stroke-linecap="square" d="
+ M6.25,21.996c0-1.772,2.62-3.958,4.74-3.958H33.51c2.12,0,4.74,2.187,4.74,3.958v14.678c0,7.385-7.161,13.364-16,13.364
+ s-16-5.979-16-13.364V21.996z"/>
+<g>
+ <path fill-rule="evenodd" clip-rule="evenodd" fill="none" stroke="#000000" stroke-width="3" stroke-linecap="round" d="
+ M13.462,34.086c4.741-19.554,9.149,0,9.149,0"/>
+
+ <path fill-rule="evenodd" clip-rule="evenodd" fill="none" stroke="#000000" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" d="
+ M31.469,32.705c-4.741,19.555-9.148,0-9.148,0"/>
+</g>
+<line id="line27" fill="none" stroke="#010101" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" x1="29.397" y1="12.686" x2="44.044" y2="5.485"/>
+<line id="line29" fill="none" stroke="#010101" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" x1="1.75" y1="1.75" x2="16.366" y2="9.017"/>
+<path id="path23" fill="#FFFFFF" stroke="#010101" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" d="
+ M21.429,9.339c0.55,1.451-0.171,3.066-1.608,3.612c-1.437,0.545-3.049-0.188-3.599-1.639c-0.547-1.45,0.174-3.067,1.609-3.613
+ C19.269,7.157,20.88,7.889,21.429,9.339z"/>
+<path id="path25" fill="#FFFFFF" stroke="#010101" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" d="
+ M29.046,15.979c-1.04,1.125-2.798,1.189-3.928,0.144c-1.128-1.044-1.197-2.801-0.155-3.927c1.041-1.125,2.8-1.19,3.927-0.146
+ C30.019,13.095,30.089,14.853,29.046,15.979z"/>
+</svg>
diff --git a/activity/activity.info b/activity/activity.info
index 30d2cea..33f9670 100644
--- a/activity/activity.info
+++ b/activity/activity.info
@@ -3,4 +3,4 @@ name = TamTam
service_name = org.laptop.TamTam
icon = activity-tamtam
class = TamTam.TamTam
-activity_version = 37
+activity_version = 38
diff --git a/activity/activity_edit.info b/activity/activity_edit.info
new file mode 100644
index 0000000..ec1b72f
--- /dev/null
+++ b/activity/activity_edit.info
@@ -0,0 +1,6 @@
+[Activity]
+name = TamTamEdit
+service_name = org.laptop.TamTamEdit
+icon = activity-tamtamedit
+class = TamTam.TamTamEdit
+activity_version = 38
diff --git a/activity/activity_jam.info b/activity/activity_jam.info
new file mode 100644
index 0000000..25dc0ae
--- /dev/null
+++ b/activity/activity_jam.info
@@ -0,0 +1,6 @@
+[Activity]
+name = TamTamJam
+service_name = org.laptop.TamTamJam
+icon = activity-tamtam
+class = TamTam.TamTamJam
+activity_version = 38
diff --git a/activity/activity_mini.info b/activity/activity_mini.info
new file mode 100644
index 0000000..c098e4b
--- /dev/null
+++ b/activity/activity_mini.info
@@ -0,0 +1,6 @@
+[Activity]
+name = TamTamMini
+service_name = org.laptop.TamTamMini
+icon = activity-tamtam
+class = TamTam.TamTamMini
+activity_version = 38
diff --git a/activity/activity_sl.info b/activity/activity_sl.info
new file mode 100644
index 0000000..5027e20
--- /dev/null
+++ b/activity/activity_sl.info
@@ -0,0 +1,6 @@
+[Activity]
+name = TamTamSynthLab
+service_name = org.laptop.TamTamSynthLab
+icon = activity-tamtamsynthlab
+class = TamTam.TamTamSynthLab
+activity_version = 38
diff --git a/setup_all.py b/setup_all.py
new file mode 100644
index 0000000..fdc78b1
--- /dev/null
+++ b/setup_all.py
@@ -0,0 +1,41 @@
+#!/usr/bin/python
+
+# Copyright (C) 2006, Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+from sugar.activity import bundlebuilder
+import os
+import shutil
+
+os.rename('activity/activity.info', 'activity/activity_old.info')
+shutil.copyfile('activity/activity_sl.info', 'activity/activity.info')
+bundlebuilder.start('TamTamSynthLab')
+os.rename('activity/activity_old.info', 'activity/activity.info')
+
+os.rename('activity/activity.info', 'activity/activity_old.info')
+shutil.copyfile('activity/activity_mini.info', 'activity/activity.info')
+bundlebuilder.start('TamTamMini')
+os.rename('activity/activity_old.info', 'activity/activity.info')
+
+os.rename('activity/activity.info', 'activity/activity_old.info')
+shutil.copyfile('activity/activity_jam.info', 'activity/activity.info')
+bundlebuilder.start('TamTamJam')
+os.rename('activity/activity_old.info', 'activity/activity.info')
+
+os.rename('activity/activity.info', 'activity/activity_old.info')
+shutil.copyfile('activity/activity_edit.info', 'activity/activity.info')
+bundlebuilder.start('TamTamEdit')
+os.rename('activity/activity_old.info', 'activity/activity.info') \ No newline at end of file
diff --git a/setup_edit.py b/setup_edit.py
new file mode 100644
index 0000000..04aca41
--- /dev/null
+++ b/setup_edit.py
@@ -0,0 +1,26 @@
+#!/usr/bin/python
+
+# Copyright (C) 2006, Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+from sugar.activity import bundlebuilder
+import os
+import shutil
+
+os.rename('activity/activity.info', 'activity/activity_old.info')
+shutil.copyfile('activity/activity_edit.info', 'activity/activity.info')
+bundlebuilder.start('TamTamEdit')
+os.rename('activity/activity_old.info', 'activity/activity.info')
diff --git a/setup_jam.py b/setup_jam.py
new file mode 100644
index 0000000..c31dc28
--- /dev/null
+++ b/setup_jam.py
@@ -0,0 +1,26 @@
+#!/usr/bin/python
+
+# Copyright (C) 2006, Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+from sugar.activity import bundlebuilder
+import os
+import shutil
+
+os.rename('activity/activity.info', 'activity/activity_old.info')
+shutil.copyfile('activity/activity_jam.info', 'activity/activity.info')
+bundlebuilder.start('TamTamJam')
+os.rename('activity/activity_old.info', 'activity/activity.info')
diff --git a/setup_mini.py b/setup_mini.py
new file mode 100644
index 0000000..91ce6a8
--- /dev/null
+++ b/setup_mini.py
@@ -0,0 +1,26 @@
+#!/usr/bin/python
+
+# Copyright (C) 2006, Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+from sugar.activity import bundlebuilder
+import os
+import shutil
+
+os.rename('activity/activity.info', 'activity/activity_old.info')
+shutil.copyfile('activity/activity_mini.info', 'activity/activity.info')
+bundlebuilder.start('TamTamMini')
+os.rename('activity/activity_old.info', 'activity/activity.info')
diff --git a/setup_sl.py b/setup_sl.py
new file mode 100644
index 0000000..ddb23bf
--- /dev/null
+++ b/setup_sl.py
@@ -0,0 +1,26 @@
+#!/usr/bin/python
+
+# Copyright (C) 2006, Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+from sugar.activity import bundlebuilder
+import os
+import shutil
+
+os.rename('activity/activity.info', 'activity/activity_old.info')
+shutil.copyfile('activity/activity_sl.info', 'activity/activity.info')
+bundlebuilder.start('TamTamSynthLab')
+os.rename('activity/activity_old.info', 'activity/activity.info')