2 * Copyright (C) 2008-2016 David Robillard <d@drobilla.net>
3 * Copyright (C) 2009 Hans Baier <hansfbaier@googlemail.com>
4 * Copyright (C) 2013 Paul Davis <paul@linuxaudiosystems.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #ifndef __ardour_event_type_map_h__
22 #define __ardour_event_type_map_h__
27 #include "evoral/TypeMap.h"
28 #include "evoral/ControlList.h"
29 #include "evoral/ParameterDescriptor.h"
31 #include "ardour/libardour_visibility.h"
37 /** This is the interface Ardour provides to Evoral about what
38 * parameter and event types/ranges/names etc. to use.
40 class LIBARDOUR_API EventTypeMap : public Evoral::TypeMap {
42 static EventTypeMap& instance();
44 bool type_is_midi(uint32_t type) const;
45 uint8_t parameter_midi_type(const Evoral::Parameter& param) const;
47 Evoral::ParameterType midi_parameter_type(const uint8_t* buf, uint32_t len) const;
49 Evoral::ControlList::InterpolationStyle interpolation_of(const Evoral::Parameter& param);
51 Evoral::Parameter from_symbol(const std::string& str) const;
52 std::string to_symbol(const Evoral::Parameter& param) const;
54 Evoral::ParameterDescriptor descriptor(const Evoral::Parameter& param) const;
56 void set_descriptor(const Evoral::Parameter& param,
57 const Evoral::ParameterDescriptor& desc);
60 typedef std::map<Evoral::Parameter, Evoral::ParameterDescriptor> Descriptors;
62 EventTypeMap(URIMap* uri_map) : _uri_map(uri_map) {}
65 Descriptors _descriptors;
67 static EventTypeMap* event_type_map;
72 #endif /* __ardour_event_type_map_h__ */