1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4     Rosegarden
5     A MIDI and audio sequencer and musical notation editor.
6     Copyright 2000-2021 the Rosegarden development team.
7 
8     This program is free software; you can redistribute it and/or
9     modify it under the terms of the GNU General Public License as
10     published by the Free Software Foundation; either version 2 of the
11     License, or (at your option) any later version.  See the file
12     COPYING included with this distribution for more information.
13 */
14 
15 
16 #ifndef RG_MAPPED_EVENT_LIST_H
17 #define RG_MAPPED_EVENT_LIST_H
18 
19 
20 #include "base/Composition.h"
21 #include "MappedEvent.h"
22 #include <set>
23 #include <QDataStream>
24 
25 namespace Rosegarden
26 {
27 
28 /**
29  * MappedEventList is used with MappedEvent to create a sequence
30  * of MIDI ready events ready for playing.
31  *
32  * Note that MappedEventList is a list of MappedEvents, not a mapped
33  * list of events.  Although a MappedEvent is a fixed-size object for
34  * use in contexts like MappedEventBuffer which contain fixed-size sets of
35  * fixed-size objects to be read and written with minimal locking,
36  * MappedEventList is a normal container with nothing fixed about it;
37  * it's just the container that happens to be used in sequencer
38  * threads when a set of MappedEvents is called for.
39  */
MappedEventInserter(MappedEventList & list)40 class MappedEventList : public std::multiset<MappedEvent *,
41                                              MappedEvent::MappedEventCmp>
42 {
43 public:
44     MappedEventList() { }
45     MappedEventList(const MappedEventList &mC);
46 
47     void merge(const MappedEventList &mC);
48 
49     MappedEventList &operator=(const MappedEventList &mC);
50 
51     ~MappedEventList();
52 
53     // Clear out
54     void clear();
55 };
56 
57 typedef std::multiset<MappedEvent *, MappedEvent::MappedEventCmp>::iterator
58     MappedEventListIterator;
59 
60 }
61 
62 #endif
63