move control surface prefs onto their own tab in the user prefs; for Generic MIDI...
[ardour.git] / libs / evoral / evoral / EventList.hpp
1 /* This file is part of Evoral.
2  * Copyright (C) 2009 Paul Davis
3  *
4  * Evoral is free software; you can redistribute it and/or modify it under the
5  * terms of the GNU General Public License as published by the Free Software
6  * Foundation; either version 2 of the License, or (at your option) any later
7  * version.
8  *
9  * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY
10  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program; if not, write to the Free Software Foundation, Inc.,
15  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16  */
17
18 #ifndef EVORAL_EVENT_LIST_HPP
19 #define EVORAL_EVENT_LIST_HPP
20
21 #include <list>
22 #include "evoral/EventSink.hpp"
23 #include "evoral/types.hpp"
24 #include "evoral/Event.hpp"
25
26 namespace Evoral {
27
28
29 /** A list of events (generic time-stamped binary "blobs").
30  *
31  * Used when we need an unsorted list of Events that is also an EventSink. Absolutely nothing more.
32  */
33 template<typename Time>
34 class EventList : public std::list<Evoral::Event<Time> *>, public Evoral::EventSink<Time> {
35 public:
36         EventList() {}
37
38         uint32_t write(Time  time, EventType  type, uint32_t  size, const uint8_t* buf) {
39                 this->push_back(new Evoral::Event<Time>(
40                                   type, time, size, const_cast<uint8_t*>(buf), true)); // Event copies buffer
41                 return size;
42         }
43 };
44
45
46 } // namespace Evoral
47
48 #endif // EVORAL_EVENT_LIST_HPP