Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOli <olivier.belanger@umontreal.ca>2007-09-21 00:18:18 (GMT)
committer Oli <olivier.belanger@umontreal.ca>2007-09-21 00:18:18 (GMT)
commit27ae244d089a93eb2d00631e5f4c17a54a5b41fd (patch)
tree7c64f5ed4d2e77b90caf87993b24af103fedd519
parent72610bcaf281600e9925d65db8f9af89b14e558e (diff)
parent3f04e198e432714701cbdabf7ff244b29a960724 (diff)
Merge branch 'master' of git+ssh://olipet@dev.laptop.org/git/projects/tamtam
Conflicts: TamTamEdit.activity/Edit/MainWindow.py
-rw-r--r--TamTamEdit.activity/Edit/MainWindow.py44
-rw-r--r--TamTamJam.activity/Jam/JamMain.py2
-rw-r--r--common/Config.py3
-rw-r--r--common/Util/LoopSettings.py4
4 files changed, 34 insertions, 19 deletions
diff --git a/TamTamEdit.activity/Edit/MainWindow.py b/TamTamEdit.activity/Edit/MainWindow.py
index 49125a4..3ab06c6 100644
--- a/TamTamEdit.activity/Edit/MainWindow.py
+++ b/TamTamEdit.activity/Edit/MainWindow.py
@@ -177,7 +177,7 @@ class MainWindow( gtk.EventBox ):
self.GUI["2instrument2Box"].pack_start( self.GUI["2instrument2volBox"], False, False, 0 )
self.GUI["2instrument2Button"] = InstrumentButton( self, 1, Config.BG_COLOR )
self.GUI["2instrument2Palette"] = instrumentPalette(_('Track 2 Volume'), self, 1)
- self.GUI["2instrument2Button"].set_palette(self.GUI["2instrument2Palette"])
+ self.GUI["2instrument2Button"].connect('button-release-event',self.GUI["2instrument2Palette"].setBlock)
self.GUI["2instrument2Button"].setPrimary( self.GUI["2instrumentIcons"][self.trackInstrument[1].name] )
self.GUI["2instrument2Box"].pack_start( self.GUI["2instrument2Button"], padding = 3 )
self.GUI["2instrumentPanel"].pack_start( self.GUI["2instrument2Box"] )
@@ -201,7 +201,7 @@ class MainWindow( gtk.EventBox ):
self.GUI["2instrument3Box"].pack_start( self.GUI["2instrument3volBox"], False, False, 0 )
self.GUI["2instrument3Button"] = InstrumentButton( self, 2, Config.BG_COLOR )
self.GUI["2instrument3Palette"] = instrumentPalette(_('Track 3 Volume'), self, 2)
- self.GUI["2instrument3Button"].set_palette(self.GUI["2instrument3Palette"])
+ self.GUI["2instrument3Button"].connect('button-release-event',self.GUI["2instrument3Palette"].setBlock)
self.GUI["2instrument3Button"].setPrimary( self.GUI["2instrumentIcons"][self.trackInstrument[2].name] )
self.GUI["2instrument3Box"].pack_start( self.GUI["2instrument3Button"], padding = 3 )
self.GUI["2instrumentPanel"].pack_start( self.GUI["2instrument3Box"] )
@@ -225,7 +225,7 @@ class MainWindow( gtk.EventBox ):
self.GUI["2instrument4Box"].pack_start( self.GUI["2instrument4volBox"], False, False, 0 )
self.GUI["2instrument4Button"] = InstrumentButton( self, 3, Config.BG_COLOR )
self.GUI["2instrument4Palette"] = instrumentPalette(_('Track 4 Volume'), self, 3)
- self.GUI["2instrument4Button"].set_palette(self.GUI["2instrument4Palette"])
+ self.GUI["2instrument4Button"].connect('button-release-event',self.GUI["2instrument4Palette"].setBlock)
self.GUI["2instrument4Button"].setPrimary( self.GUI["2instrumentIcons"][self.trackInstrument[3].name] )
self.GUI["2instrument4Box"].pack_start( self.GUI["2instrument4Button"], padding = 3 )
self.GUI["2instrumentPanel"].pack_start( self.GUI["2instrument4Box"] )
@@ -880,14 +880,16 @@ class MainWindow( gtk.EventBox ):
self.instrumentPanel.selectFirstCat()
if primary or self.trackInstrument2[num] == None:
self.instrumentPanel.set_activeInstrument( self.trackInstrument[num].name, True )
+ exec 'self.GUI["2instrument%sPalette"].setInstrument(self.trackInstrument[num].name)' % str(num+1)
+ print self.trackInstrument[num].name
else:
self.instrumentPanel.set_activeInstrument( self.trackInstrument2[num].name, True )
- winLoc = self.parent.window.get_position()
- alloc = widget.parent.get_allocation()
- x = alloc.x + alloc.width + winLoc[0]
- y = alloc.y + winLoc[1]
- self.GUI["9instrumentPopup"].move( x, y )
- self.GUI["9instrumentPopup"].show()
+ #winLoc = self.parent.window.get_position()
+ #alloc = widget.parent.get_allocation()
+ #x = alloc.x + alloc.width + winLoc[0]
+ #y = alloc.y + winLoc[1]
+ #self.GUI["9instrumentPopup"].move( x, y )
+ #self.GUI["9instrumentPopup"].show()
def cancelInstrumentSelection( self ):
self.GUI["9instrumentPopup"].hide()
@@ -899,7 +901,7 @@ class MainWindow( gtk.EventBox ):
btn.setPrimary( self.GUI["2instrumentIcons"][instrumentName] )
else:
btn.setSecondary( self.GUI["2instrumentIcons"][instrumentName] )
- self.GUI["9instrumentPopup"].hide()
+ #self.GUI["9instrumentPopup"].hide()
def pickDrum( self, widget , data = None ):
@@ -2152,11 +2154,12 @@ class instrumentPalette( Popup ):
self.volumeSlider.set_size_request(250, -1)
self.volumeSlider.set_inverted(False)
self.volumeSlider.set_draw_value(False)
-
- categories = Config.CATEGORIES
-
+
+ self.categories = Config.CATEGORIES
+ self.instruments = self.getInstruments()
+
self.categoryBox = BigComboBox()
- for category in categories:
+ for category in self.categories:
image = Config.IMAGE_ROOT + category + '.png'
if not os.path.isfile(image):
image = Config.IMAGE_ROOT + 'generic.png'
@@ -2182,13 +2185,24 @@ class instrumentPalette( Popup ):
def handleInstrumentChange(self, widget):
instrument = widget.props.value
self.edit.playInstrumentNote(instrument)
+ self.edit.pickInstrument(widget = None, num = self.trackID)
self.edit.donePickInstrument(instrument)
def handleCategoryChange(self, widget):
category = widget.props.value
instruments = self.getInstruments(category)
self.loadInstrumentMenu(instruments)
-
+<<<<<<< HEAD:TamTamEdit.activity/Edit/MainWindow.py
+
+=======
+
+ def setCategory(self, category):
+ self.categoryBox.set_active(self.categories.index(category))
+
+ def setInstrument(self, instrument):
+ self.instrumentBox1.set_active(self.instruments.index(instrument))
+
+>>>>>>> 3f04e198e432714701cbdabf7ff244b29a960724:TamTamEdit.activity/Edit/MainWindow.py
def loadInstrumentMenu(self, instruments):
self.instrumentBox1.remove_all()
for instrument in instruments:
diff --git a/TamTamJam.activity/Jam/JamMain.py b/TamTamJam.activity/Jam/JamMain.py
index 925d34d..414c759 100644
--- a/TamTamJam.activity/Jam/JamMain.py
+++ b/TamTamJam.activity/Jam/JamMain.py
@@ -779,7 +779,7 @@ class JamMain(gtk.EventBox):
pix = gtk.gdk.pixbuf_new_from_file( img_path )
except:
if Config.DEBUG >= 5: print "JamMain:: file does not exist: " + img_path
- pix = gtk.gdk.pixbuf_new_from_file( Config.IMAGE_ROOT + "/generic.png" )
+ pix = gtk.gdk.pixbuf_new_from_file( Config.IMAGE_ROOT + "generic.png" )
x = (Block.Block.WIDTH-pix.get_width())//2
y = (Block.Block.HEIGHT-pix.get_height())//2
img = gtk.gdk.Pixmap( win, Block.Block.WIDTH, Block.Block.HEIGHT )
diff --git a/common/Config.py b/common/Config.py
index d3b2b03..62bd1f6 100644
--- a/common/Config.py
+++ b/common/Config.py
@@ -26,6 +26,7 @@ print 'INFO: loaded TAMTAM_ROOT=%s' % TAM_TAM_ROOT
#PATHS
SOUNDS_DIR = "/usr/share/tamtam/Sounds"
FILES_DIR = TAM_TAM_ROOT + "/common/Resources"
+LIB_DIR = "/usr/share/tamtam"
TUNE_DIR='/'
SYNTH_DIR='/'
if SugarMode == True:
@@ -105,7 +106,7 @@ INSTRUMENTS = {}
def _addInstrument( name, csoundInstrumentId, instrumentRegister, soundClass, category, loopStart, loopEnd, crossDur, kit = None ):
if not QUICKLOAD or name[0:4] == "drum" or name in ["flute", "kalimba"]: # quick load
INSTRUMENTS[name] = Instrument( name, _nextInstrumentId[0], csoundInstrumentId, instrumentRegister, soundClass, category, loopStart, loopEnd, crossDur, kit )
- instrumentDB.addInstrumentFromArgs( name, name, instrumentRegister, loopStart, loopEnd, crossDur, name, FILES_DIR+"/Images/"+name+".png", [ category ] )
+ instrumentDB.addInstrumentFromArgs( name, name, instrumentRegister, loopStart, loopEnd, crossDur, name, LIB_DIR+"/Images/"+name+".png", [ category ] )
_nextInstrumentId[0] += 1
diff --git a/common/Util/LoopSettings.py b/common/Util/LoopSettings.py
index 977ee61..408b4d0 100644
--- a/common/Util/LoopSettings.py
+++ b/common/Util/LoopSettings.py
@@ -93,7 +93,7 @@ class LoopSettings( gtk.VBox ):
endBox = gtk.VBox()
self.endAdjust = gtk.Adjustment( 0.9, 0, 1, .001, .001, 0)
- self.GUI['endSlider'] = ImageVScale( Config.TAM_TAM_ROOT + "/common/Resources/Images/sliderEditVolume.png", self.endAdjust, 7 )
+ self.GUI['endSlider'] = ImageVScale( Config.IMAGE_ROOT + "sliderEditVolume.png", self.endAdjust, 7 )
self.endAdjust.connect("value-changed", self.handleEnd)
self.GUI['endSlider'].set_inverted(True)
self.GUI['endSlider'].set_size_request(50, 200)
@@ -106,7 +106,7 @@ class LoopSettings( gtk.VBox ):
durBox = gtk.VBox()
self.durAdjust = gtk.Adjustment( 0.01, 0, 0.2, .001, .001, 0)
- self.GUI['durSlider'] = ImageVScale( Config.TAM_TAM_ROOT + "/common/Resources/Images/sliderEditVolume.png", self.durAdjust, 7 )
+ self.GUI['durSlider'] = ImageVScale( Config.IMAGE_ROOT + "sliderEditVolume.png", self.durAdjust, 7 )
self.durAdjust.connect("value-changed", self.handleDur)
self.GUI['durSlider'].set_inverted(True)
self.GUI['durSlider'].set_size_request(50, 200)