From 1befb838a31f5c3541e6c3ae79c0c2f92d56de6d Mon Sep 17 00:00:00 2001 From: hanwen Date: Fri, 29 Jul 2005 11:58:48 +0000 Subject: [PATCH] * notation.py (Notation.change_duration_log): duration logs of all notes. * music.py (ClefEvent.__init__): add (NoteEvent.ly_expression): add (Music.has_children): new method. --- ChangeLog | 3 +++ music.py | 2 ++ notation.py | 10 +++++++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e188fcc520..c4e90c10d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2005-07-29 Han-Wen Nienhuys + * notation.py (Notation.change_duration_log): duration logs of all + notes. + * ikebana.py (NotationApplication.tree_selection_changed): new function. diff --git a/music.py b/music.py index 4db0b8e26a..cd804b3c4a 100644 --- a/music.py +++ b/music.py @@ -258,6 +258,8 @@ class Event(Music): class ArpeggioEvent(Music): def name (self): return 'ArpeggioEvent' + def ly_expression (self): + return '\\arpeggio' class RhythmicEvent(Event): def __init__ (self): diff --git a/notation.py b/notation.py index 457dd14ee9..b06513765a 100644 --- a/notation.py +++ b/notation.py @@ -401,15 +401,19 @@ class Notation: if ( self.music_cursor.name() == 'NoteEvent' or self.music_cursor.name() == 'RestEvent'): + m = self.music_cursor dur = self.music_cursor.duration dl = dur.duration_log dl += dir - if dl <= 6 and dl >= -2: - dur.duration_log = dl + if dl > 6 and dl < -2: + return None + + evs = [x for x in m.parent.elements if x.name() in ('NoteEvent', 'RestEvent')] + for e in evs: + e.duration.duration_log = dl self.touch_document () - def ensure_note (self): if self.music_cursor.name() == 'RestEvent': m = self.music_cursor -- 2.39.5