diff options
author | amartin <olpc@xo-05-28-21.localdomain> | 2007-08-18 03:17:21 (GMT) |
---|---|---|
committer | amartin <olpc@xo-05-28-21.localdomain> | 2007-08-18 03:17:21 (GMT) |
commit | d9c019c42bf72e722756f89b5dfc6a9e2a1fe3b0 (patch) | |
tree | 94e32685afb6c96796989bbb9db0c27c648a62f1 /Jam | |
parent | dcc14c2fec23abe044d7bc1b9ed13426354c6163 (diff) |
generation preview
Diffstat (limited to 'Jam')
-rw-r--r-- | Jam/Desktop.py | 2 | ||||
-rw-r--r-- | Jam/JamMain.py | 3 | ||||
-rw-r--r-- | Jam/Picker.py | 30 |
3 files changed, 31 insertions, 4 deletions
diff --git a/Jam/Desktop.py b/Jam/Desktop.py index d094039..c5eb4ab 100644 --- a/Jam/Desktop.py +++ b/Jam/Desktop.py @@ -20,7 +20,7 @@ class Desktop( gtk.EventBox ): win = gtk.gdk.get_default_root_window() self.gc = gtk.gdk.GC( win ) colormap = self.drawingArea.get_colormap() - self.colors = { "bg": colormap.alloc_color( Config.BG_COLOR, True, True ), \ + self.colors = { "bg": colormap.alloc_color( Config.PANEL_BCK_COLOR, True, True ), \ "Border_Active": colormap.alloc_color( "#FF6000", True, True ), \ "Border_Inactive": colormap.alloc_color( "#5D5D5D", True, True ), \ "Border_Highlight": colormap.alloc_color( "#FFFFFF", True, True ), \ diff --git a/Jam/JamMain.py b/Jam/JamMain.py index e26e7d7..6645b97 100644 --- a/Jam/JamMain.py +++ b/Jam/JamMain.py @@ -153,9 +153,6 @@ class JamMain(SubActivity): self.instrument["id"], self.instrument["reverb"] ) - - - def onKeyRelease( self, widget, event ): key = event.hardware_keycode diff --git a/Jam/Picker.py b/Jam/Picker.py index 975919c..eb3103b 100644 --- a/Jam/Picker.py +++ b/Jam/Picker.py @@ -4,9 +4,12 @@ pygtk.require( '2.0' ) import gtk import random #TEMP +import sets import Config +import Util.ControlStream + import Jam.Block as Block class Picker( gtk.HBox ): @@ -142,6 +145,33 @@ class Loop( Picker ): self.addBlock( {}, "Loop" ) + def _loadFile( self, path ): + try: + oldPages = sets.Set( self.owner.noteDB.getTune() ) + + ifile = open( path, 'r' ) + ttt = ControlStream.TamTamTable ( self.owner.noteDB ) + ttt.parseFile( ifile ) + ifile.close() + + curPages = sets.Set( self.owner.noteDB.getTune() ) + newPages = curPages.difference( oldPages ) + + if len(newPages) != 1: + print "ERROR: bad loop file, contains more than one page (or none)" + return -1 + + return newPages.pop() # new pageId + + except OSError,e: + print 'ERROR: failed to open file %s for reading\n' % ofilename + + + + + def _scanDirectory( self, path ): + pass + def button_press( self, widget, event ): walloc = widget.get_allocation() salloc = self.scrolledWindow.get_allocation() |