diff options
author | amartin <olpc@xo-05-28-21.localdomain> | 2007-08-27 09:11:28 (GMT) |
---|---|---|
committer | amartin <olpc@xo-05-28-21.localdomain> | 2007-08-27 09:11:28 (GMT) |
commit | 6f57fcb7286d28d3d483c1f8ce7d3ee6f439a52b (patch) | |
tree | 6beb8633f6dc95bdad52f1b41691c83c2e9b99a5 /Jam/Block.py | |
parent | 4cb29f386d4fe7a8873a5d8a917599c9ebb23a1f (diff) |
Jam loops
Diffstat (limited to 'Jam/Block.py')
-rw-r--r-- | Jam/Block.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Jam/Block.py b/Jam/Block.py index c86a53b..adc487a 100644 --- a/Jam/Block.py +++ b/Jam/Block.py @@ -135,6 +135,9 @@ class Block(): self.active = state self.invalidate_rect( not self.dragging ) + if self.child: + self.child.setActive( state ) + def button_press( self, event ): if event.y < self.y or event.y > self.endY: @@ -411,6 +414,17 @@ class Loop(Block): def _doButtonPress( self, event ): # we were hit with a button press pass + def button_release( self, event ): + if not self.dragging: + if self.active: + root = self.getRoot() + self.owner.deactivateLoop( root.child ) + else: + root = self.getRoot() + if root.type == Instrument: # must be attached to an instrument + self.owner.activateLoop( root.child ) + Block.button_release( self, event ) + def _doDraw( self, startX, startY, stopX, stopY, pixmap ): y = max( startY, self.y ) endY = min( stopY, self.endY ) |