diff options
author | amartin <olpc@localhost.localdomain> | 2007-02-11 19:23:12 (GMT) |
---|---|---|
committer | amartin <olpc@localhost.localdomain> | 2007-02-11 19:23:12 (GMT) |
commit | 39683b9e0d4f29ba071e85c6d8a89bb40b43ca1b (patch) | |
tree | ad9bf48be25544d4e9bc085286413ece8c3eb619 /Edit/HitInterface.py | |
parent | 4ebd04f319ea60f8e593ecd1f1d1e68d68be8c13 (diff) |
note step buttons, redid note drag updates as streams
Diffstat (limited to 'Edit/HitInterface.py')
-rw-r--r-- | Edit/HitInterface.py | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/Edit/HitInterface.py b/Edit/HitInterface.py index f8cf691..1b12b1f 100644 --- a/Edit/HitInterface.py +++ b/Edit/HitInterface.py @@ -111,19 +111,42 @@ class HitInterface( NoteInterface ): return 1 - def noteDrag( self, emitter, do, dp, dd ): + def noteDragPitch( self, dp, stream ): self.potentialDeselect = False - - if do != self.lastDragO: - self.lastDragO = do - self.noteDB.updateNote( self.note.page, self.note.track, self.note.id, PARAMETER.ONSET, self.baseOnset + do ) - self.end = self.note.cs.onset + self.note.cs.duration - if dp != self.lastDragP and not dp%2: self.lastDragP = dp - newPitch = self.basePitch + dp - self.noteDB.updateNote( self.note.page, self.note.track, self.note.id, PARAMETER.PITCH, newPitch ) - self.updateSampleNote( newPitch ) + stream += [ self.note.id, self.basePitch + dp ] + + def noteDragDuration( self, dd, stream ): + return + + def noteDecOnset( self, step, leftBound, stream ): + if self.selected: + if leftBound < self.note.cs.onset: + onset = max( self.note.cs.onset+step, leftBound ) + stream += [ self.note.id, onset ] + return leftBound + + def noteIncOnset( self, step, rightBound, stream ): + if self.selected: + if rightBound > self.end: + onset = min( self.end+step, rightBound ) - self.note.cs.duration + stream += [ self.note.id, onset ] + return rightBound + + def noteDecPitch( self, step, stream ): + if self.note.cs.pitch > Config.MINIMUM_PITCH_DRUM: + stream += [ self.note.id, max( self.note.cs.pitch+2*step, Config.MINIMUM_PITCH_DRUM ) ] + + def noteIncPitch( self, step, stream ): + if self.note.cs.pitch < Config.MAXIMUM_PITCH_DRUM: + stream += [ self.note.id, min( self.note.cs.pitch+2*step, Config.MAXIMUM_PITCH_DRUM ) ] + + def noteDecDuration( self, step, stream ): + return + + def noteIncDuration( self, step, rightBound, stream ): + return # updateTooltip returns: # -1, event occurs before us so don't bother checking any later notes |