From 1fcc777030bb0ca9d3768edf21bd0de704032c62 Mon Sep 17 00:00:00 2001 From: amartin Date: Tue, 20 Feb 2007 22:43:12 +0000 Subject: sample notes --- (limited to 'Edit/NoteInterface.py') diff --git a/Edit/NoteInterface.py b/Edit/NoteInterface.py index 6b0a8c9..3a90c9f 100644 --- a/Edit/NoteInterface.py +++ b/Edit/NoteInterface.py @@ -168,6 +168,8 @@ class NoteInterface: #self.noteParameters = NoteParametersWindow( self.note, self.getNoteParameters ) return 1 # handled + playSample = False + if event.type == gtk.gdk._2BUTTON_PRESS: # select bar self.potentialDeselect = False start = 0 @@ -185,12 +187,14 @@ class NoteInterface: self.potentialDeselect = True else: emitter.selectNotes( { self.note.track: [ self ] } ) - self.playSampleNote( ) + playSample = True percent = eX/self.width if percent < 0.3: emitter.setCurrentAction( "note-drag-onset", self ) elif percent > 0.7: emitter.setCurrentAction( "note-drag-duration", self ) - else: emitter.setCurrentAction( "note-drag-pitch", self ) + else: + emitter.setCurrentAction( "note-drag-pitch", self ) + if playSample: self.playSampleNote() return 1 @@ -200,8 +204,6 @@ class NoteInterface: self.potentialDeselect = False emitter.deselectNotes( { self.note.track: [ self ] } ) - self.playSampleNote() - emitter.doneCurrentAction() return True @@ -217,7 +219,6 @@ class NoteInterface: if dp != self.lastDragP: self.lastDragP = dp stream += [ self.note.id, self.basePitch + dp ] - self.playSampleNote(False) def noteDragDuration( self, dd, stream ): self.potentialDeselect = False @@ -234,8 +235,6 @@ class NoteInterface: self.lastDragP = 0 self.lastDragD = 0 - self.playSampleNote() - def noteDecOnset( self, step, leftBound, stream ): if self.selected: if leftBound < self.note.cs.onset: -- cgit v0.9.1