diff options
Diffstat (limited to 'muse2/muse/part.cpp')
-rw-r--r-- | muse2/muse/part.cpp | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/muse2/muse/part.cpp b/muse2/muse/part.cpp index 67cf441e..239d53d5 100644 --- a/muse2/muse/part.cpp +++ b/muse2/muse/part.cpp @@ -4,6 +4,7 @@ // $Id: part.cpp,v 1.12.2.17 2009/06/25 05:13:02 terminator356 Exp $ // // (C) Copyright 1999/2000 Werner Schweer (ws@seh.de) +// Additions, modifications (C) Copyright 2011 Tim E. Real (terminator356 on users DOT sourceforge DOT net) //========================================================= #include <stdio.h> @@ -655,6 +656,7 @@ Part* PartList::find(int idx) Part::Part(Track* t) { + _hiddenEvents = NoEventsHidden; _prevClone = this; _nextClone = this; setSn(newSn()); @@ -673,6 +675,7 @@ Part::Part(Track* t) Part::Part(Track* t, EventList* ev) { + _hiddenEvents = NoEventsHidden; _prevClone = this; _nextClone = this; setSn(newSn()); @@ -849,7 +852,6 @@ void Song::cmdResizePart(Track* track, Part* oPart, unsigned int len, bool doClo Event newEvent = e.clone(); newEvent.setLenFrame(new_partlength - event_startframe); // Do not do port controller values and clone parts. - audio->msgChangeEvent(e, newEvent, nPart, false, false, false); operations.push_back(UndoOp(UndoOp::ModifyEvent, newEvent, e, nPart, false,false)); } } @@ -889,7 +891,6 @@ void Song::cmdResizePart(Track* track, Part* oPart, unsigned int len, bool doClo nPart->setLenFrame(new_partlength); // Do not do port controller values and clone parts. - audio->msgChangePart(oPart, nPart, false, false, false); operations.push_back(UndoOp(UndoOp::ModifyPart, oPart, nPart, false, false)); song->applyOperationGroup(operations); } @@ -1169,15 +1170,38 @@ WavePart* WavePart::clone() const return new WavePart(*this); } +/* +bool Part::hasHiddenNotes() +{ + unsigned lastNote=0; + for (iEvent ev=events()->begin(); ev!=events()->end(); ev++) + if (ev->second.endTick() > lastNote) + lastNote=ev->second.endTick(); + + return lastNote > lenTick(); +} +*/ -bool Part::hasHiddenNotes() +//--------------------------------------------------------- +// hasHiddenEvents +// Returns combination of HiddenEventsType enum. +//--------------------------------------------------------- + +int Part::hasHiddenEvents() { - unsigned lastNote=0; + unsigned len = lenTick(); - for (iEvent ev=events()->begin(); ev!=events()->end(); ev++) - if (ev->second.endTick() > lastNote) - lastNote=ev->second.endTick(); - - return lastNote > lenTick(); + // TODO: For now, we don't support events before the left border, only events past the right border. + for(iEvent ev=events()->begin(); ev!=events()->end(); ev++) + { + if(ev->second.endTick() > len) + { + _hiddenEvents = RightEventsHidden; // Cache the result for later. + return _hiddenEvents; + } + } + _hiddenEvents = NoEventsHidden; // Cache the result for later. + return _hiddenEvents; } + |