diff options
author | amartin <olpc@xo-00-CE-12.localdomain> | 2007-06-19 20:48:44 (GMT) |
---|---|---|
committer | amartin <olpc@xo-00-CE-12.localdomain> | 2007-06-19 20:48:44 (GMT) |
commit | 309c7356fb5586f41786ea199db6d63da0221e34 (patch) | |
tree | 80c034b4771e4ecb14d257e16ccd3779f282fe0d /Util | |
parent | 85b74eeb06e4f3b605380f582100ad3a99df9497 (diff) | |
parent | e9b064c0abf445c85ac57fd429ee1a597535ebdf (diff) |
Merge branch 'master' of git+ssh://amartin@dev.laptop.org/git/projects/tamtam
Diffstat (limited to 'Util')
-rw-r--r-- | Util/CSoundClient.py | 7 | ||||
-rw-r--r-- | Util/Trackpad.py | 46 |
2 files changed, 31 insertions, 22 deletions
diff --git a/Util/CSoundClient.py b/Util/CSoundClient.py index f4c8d84..1ef6f24 100644 --- a/Util/CSoundClient.py +++ b/Util/CSoundClient.py @@ -256,7 +256,12 @@ class _CSoundClientPlugin: instrument_id_offset = 0 elif instrument.csoundInstrumentId == Config.INST_TIED and not tied and mode == 'mini': instrument_id_offset = 0 - elif instrument.csoundInstrumentId == Config.INST_TIED and mode == 'edit': + elif instrument.csoundInstrumentId == Config.INST_TIED and tied and mode == 'edit' and duration < 0: + duration = -1 + instrument_id_offset = 0 + elif instrument.csoundInstrumentId == Config.INST_TIED and tied and mode == 'edit' and duration > 0: + instrument_id_offset = 0 + elif instrument.csoundInstrumentId == Config.INST_TIED and not tied and mode == 'edit': instrument_id_offset = 100 if instrument.csoundInstrumentId == Config.INST_SIMP and mode == 'mini': diff --git a/Util/Trackpad.py b/Util/Trackpad.py index 8d92b4a..ea2990d 100644 --- a/Util/Trackpad.py +++ b/Util/Trackpad.py @@ -33,8 +33,11 @@ class Trackpad: self.display = self.win.get_display() self.screen = gtk.gdk.Display.get_default_screen(self.display) - - + self.context = None + + def setContext(self, context): + self.context = context + def create_invisible_cursor(self): pix_data = """/* XPM */ static char * invisible_xpm[] = { @@ -46,27 +49,28 @@ class Trackpad: self.invisible_cursor = gtk.gdk.Cursor(pix,pix,color,color,0,0) def handle_motion(self,widget,event): - if event.x < 0: - X = 0 - elif event.x > self.screen.get_width(): - X = self.screen.get_width() - else: - X = event.x + if self.context != 'edit': + if event.x < 0: + X = 0 + elif event.x > self.screen.get_width(): + X = self.screen.get_width() + else: + X = event.x - if event.y < 0: - Y = 0 - elif event.y > self.screen.get_height(): - Y = self.screen.get_height() - else: - Y = event.y + if event.y < 0: + Y = 0 + elif event.y > self.screen.get_height(): + Y = self.screen.get_height() + else: + Y = event.y - self.current_x = X - self.current_y = Y - if self.buttonPressed: - self.final_x = X - self.first_x - self.final_y = Y - self.first_y - self.csnd.setTrackpadX(self.final_x) - self.csnd.setTrackpadY(self.final_y) + self.current_x = X + self.current_y = Y + if self.buttonPressed: + self.final_x = X - self.first_x + self.final_y = Y - self.first_y + self.csnd.setTrackpadX(self.final_x) + self.csnd.setTrackpadY(self.final_y) def handle_keyPress(self,widget,event): if KEY_MAP_PIANO.has_key(event.hardware_keycode) and self.buttonPressed == False: |