2 Copyright (C) 2015 Tim Mayberry
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef ARDOUR_TYPES_CONVERT_H
21 #define ARDOUR_TYPES_CONVERT_H
23 #include "pbd/enum_convert.h"
25 #include "ardour/types.h"
26 #include "ardour/data_type.h"
27 #include "ardour/mode.h"
31 DEFINE_ENUM_CONVERT(Timecode::TimecodeFormat)
33 DEFINE_ENUM_CONVERT(ARDOUR::AnyTime::Type)
34 DEFINE_ENUM_CONVERT(ARDOUR::SampleFormat)
35 DEFINE_ENUM_CONVERT(ARDOUR::HeaderFormat)
36 DEFINE_ENUM_CONVERT(ARDOUR::AutoConnectOption)
37 DEFINE_ENUM_CONVERT(ARDOUR::TracksAutoNamingRule)
38 DEFINE_ENUM_CONVERT(ARDOUR::TrackMode)
39 DEFINE_ENUM_CONVERT(ARDOUR::EditMode)
40 DEFINE_ENUM_CONVERT(ARDOUR::MonitorModel)
41 DEFINE_ENUM_CONVERT(ARDOUR::AFLPosition)
42 DEFINE_ENUM_CONVERT(ARDOUR::PFLPosition)
43 DEFINE_ENUM_CONVERT(ARDOUR::ListenPosition)
44 DEFINE_ENUM_CONVERT(ARDOUR::LayerModel)
45 DEFINE_ENUM_CONVERT(ARDOUR::InsertMergePolicy)
46 DEFINE_ENUM_CONVERT(ARDOUR::SyncSource)
47 DEFINE_ENUM_CONVERT(ARDOUR::ShuttleBehaviour)
48 DEFINE_ENUM_CONVERT(ARDOUR::ShuttleUnits)
49 DEFINE_ENUM_CONVERT(ARDOUR::DenormalModel)
50 DEFINE_ENUM_CONVERT(ARDOUR::PositionLockStyle)
51 DEFINE_ENUM_CONVERT(ARDOUR::FadeShape)
52 DEFINE_ENUM_CONVERT(ARDOUR::RegionSelectionAfterSplit)
53 DEFINE_ENUM_CONVERT(ARDOUR::BufferingPreset)
54 DEFINE_ENUM_CONVERT(ARDOUR::AutoReturnTarget)
55 DEFINE_ENUM_CONVERT(ARDOUR::MeterType)
56 DEFINE_ENUM_CONVERT(ARDOUR::MeterPoint)
57 DEFINE_ENUM_CONVERT(ARDOUR::NoteMode)
58 DEFINE_ENUM_CONVERT(ARDOUR::ChannelMode)
59 DEFINE_ENUM_CONVERT(ARDOUR::LocaleMode)
60 DEFINE_ENUM_CONVERT(ARDOUR::MonitorChoice)
62 DEFINE_ENUM_CONVERT(ARDOUR::AlignStyle)
63 DEFINE_ENUM_CONVERT(ARDOUR::AlignChoice)
65 DEFINE_ENUM_CONVERT(ARDOUR::WaveformScale)
66 DEFINE_ENUM_CONVERT(ARDOUR::WaveformShape)
67 DEFINE_ENUM_CONVERT(ARDOUR::VUMeterStandard)
68 DEFINE_ENUM_CONVERT(ARDOUR::MeterLineUp)
70 DEFINE_ENUM_CONVERT(ARDOUR::MidiPortFlags)
72 DEFINE_ENUM_CONVERT(MusicalMode::Type)
75 inline bool to_string (ARDOUR::AutoState val, std::string& str)
77 str = ARDOUR::auto_state_to_string (val);
82 inline bool string_to (const std::string& str, ARDOUR::AutoState& as)
84 as = ARDOUR::string_to_auto_state (str);
89 inline bool to_string (ARDOUR::AutoStyle val, std::string& str)
91 str = ARDOUR::auto_style_to_string (val);
96 inline bool string_to (const std::string& str, ARDOUR::AutoStyle& as)
98 as = ARDOUR::string_to_auto_style (str);
103 inline bool to_string (ARDOUR::DataType val, std::string& str)
105 str = val.to_string();
110 inline bool string_to (const std::string& str, ARDOUR::DataType& dt)
112 dt = ARDOUR::DataType(str);
118 #endif // ARDOUR_TYPES_CONVERT_H