From d9c019c42bf72e722756f89b5dfc6a9e2a1fe3b0 Mon Sep 17 00:00:00 2001 From: amartin Date: Sat, 18 Aug 2007 03:17:21 +0000 Subject: generation preview --- (limited to 'Jam') 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() -- cgit v0.9.1