remove old midi-note name API
[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
23 #include "evoral/Event.hpp"
24 #include "evoral/EventSink.hpp"
25 #include "evoral/visibility.h"
26
27 namespace Evoral {
28
29
30 /** A list of events (generic time-stamped binary "blobs").
31  *
32  * Used when we need an unsorted list of Events that is also an EventSink. Absolutely nothing more.
33  */
34 template<typename Time>
35 class /*LIBEVORAL_API*/ EventList : public std::list<Evoral::Event<Time> *>, public Evoral::EventSink<Time> {
36 public:
37         EventList() {}
38
39         uint32_t write(Time  time, EventType  type, uint32_t  size, const uint8_t* buf) {
40                 this->push_back(new Evoral::Event<Time>(
41                                   type, time, size, const_cast<uint8_t*>(buf), true)); // Event copies buffer
42                 return size;
43         }
44 };
45
46
47 } // namespace Evoral
48
49 #endif // EVORAL_EVENT_LIST_HPP