diff options
author | Florian Jung <flo@windfisch.org> | 2013-09-18 23:54:35 +0200 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2013-09-18 23:54:35 +0200 |
commit | b3fc353a09496ee0aea7099d72e6963f4c2fc774 (patch) | |
tree | 83ab91e988c59076d81ebddc09e8ff274dee8af5 /muse2/muse/event.h | |
parent | 48a93993cfce160fb7d4cf0b67b4b77e22db19e5 (diff) | |
parent | 85a51421d44f3893a1010f77e0418caf6be70235 (diff) |
Merge branch 'audiomsg_overhaul' (nonshared eventlists and more)
This introduces the following changes:
- Clone Parts no more share their eventlist. Instead, all changes
made to one clone are replicated to the other clones' eventlists
- audio/song->msg{Add,Delete,Change}{Part,Event,Track} have been
replaced by the corresponding UndoOp operations.
- Enforcing of const-correctness: No GUI code may ever gain
writable access to audio/midi/song data structures. Access
must *always* go through applyOperationGroup. This is now
enforced.
- Removed a bunch of DELETETHIS or REMOVE or otherwise commented
out code
- Removed dead code
- Removed unused Audio Messages (that should go through applyOpGroup
anyway.)
Diffstat (limited to 'muse2/muse/event.h')
-rw-r--r-- | muse2/muse/event.h | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/muse2/muse/event.h b/muse2/muse/event.h index 8da37d4f..b2f5a50a 100644 --- a/muse2/muse/event.h +++ b/muse2/muse/event.h @@ -64,6 +64,7 @@ class Event { void setType(EventType t); Event& operator=(const Event& e); bool operator==(const Event& e) const; + bool isSimilarTo(const Event& other) const; int getRefCount() const; bool selected() const; @@ -73,8 +74,8 @@ class Event { void read(Xml& xml); void write(int a, Xml& xml, const Pos& offset, bool ForceWavePaths = false) const; void dump(int n = 0) const; - Event clone(); - Event mid(unsigned a, unsigned b); + Event clone() const; + Event mid(unsigned a, unsigned b) const; bool isNote() const; bool isNoteOff() const; @@ -124,7 +125,7 @@ typedef std::multimap <unsigned, Event, std::less<unsigned> > EL; typedef EL::iterator iEvent; typedef EL::reverse_iterator riEvent; typedef EL::const_iterator ciEvent; -typedef std::pair <iEvent, iEvent> EventRange; +typedef std::pair <ciEvent, ciEvent> EventRange; //--------------------------------------------------------- // EventList @@ -132,21 +133,14 @@ typedef std::pair <iEvent, iEvent> EventRange; //--------------------------------------------------------- class EventList : public EL { - int ref; // number of references to this EventList - int aref; // number of active references (exclude undo list) void deselect(); public: - EventList() { ref = 0; aref = 0; } - ~EventList() {} - - void incRef(int n) { ref += n; } - int refCount() const { return ref; } - void incARef(int n) { aref += n; } - int arefCount() const { return aref; } - + ciEvent find(const Event&) const; iEvent find(const Event&); - iEvent add(Event& event); + ciEvent findSimilar(const Event&) const; + iEvent findSimilar(const Event&); + iEvent add(Event event); void move(Event& event, unsigned tick); void dump() const; void read(Xml& xml, const char* name, bool midi); |