Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TamTamEdit.activity/Edit/MainWindow.py
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 /TamTamEdit.activity/Edit/MainWindow.py
parent72610bcaf281600e9925d65db8f9af89b14e558e (diff)
parent3f04e198e432714701cbdabf7ff244b29a960724 (diff)
Merge branch 'master' of git+ssh://olipet@dev.laptop.org/git/projects/tamtam
Conflicts: TamTamEdit.activity/Edit/MainWindow.py
Diffstat (limited to 'TamTamEdit.activity/Edit/MainWindow.py')
-rw-r--r--TamTamEdit.activity/Edit/MainWindow.py44
1 files changed, 29 insertions, 15 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: