2 Copyright (C) 2002 Paul Davis
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.
21 #ifndef __ardour_types_h__
22 #define __ardour_types_h__
24 #ifndef __STDC_FORMAT_MACROS
25 #define __STDC_FORMAT_MACROS /* PRI<foo>; C++ requires explicit requesting of these */
29 #include <jack/types.h>
41 typedef jack_default_audio_sample_t Sample;
44 typedef uint32_t layer_t;
45 typedef uint64_t id_t;
46 typedef const std::string & stringcr_t;
50 ConfigurationChanged = 0x1,
51 ConnectionsChanged = 0x2
55 OverlapNone, // no overlap
56 OverlapInternal, // the overlap is 100% with the object
57 OverlapStart, // overlap covers start, but ends within
58 OverlapEnd, // overlap begins within and covers end
59 OverlapExternal // overlap extends to (at least) begin+end
62 OverlapType coverage (jack_nframes_t start_a, jack_nframes_t end_a,
63 jack_nframes_t start_b, jack_nframes_t end_b);
68 PluginAutomation = 0x4,
70 MuteAutomation = 0x10,
110 long subframes; // mostly not used
134 /* we can't define arithmetic operators for BBT_Time, because
135 the results depend on a TempoMap, but we can define
136 a useful check on the less-than condition.
139 bool operator< (const BBT_Time& other) const {
140 return bars < other.bars ||
141 (bars == other.bars && beats < other.beats) ||
142 (bars == other.bars && beats == other.beats && ticks < other.ticks);
145 bool operator== (const BBT_Time& other) const {
146 return bars == other.bars && beats == other.beats && ticks == other.ticks;
165 jack_nframes_t frames;
171 jack_nframes_t start;
175 AudioRange (jack_nframes_t s, jack_nframes_t e, uint32_t i) : start (s), end (e) , id (i) {}
177 jack_nframes_t length() { return end - start + 1; }
179 bool operator== (const AudioRange& other) const {
180 return start == other.start && end == other.end && id == other.id;
183 bool equal (const AudioRange& other) const {
184 return start == other.start && end == other.end;
187 OverlapType coverage (jack_nframes_t s, jack_nframes_t e) const {
188 return ARDOUR::coverage (start, end, s, e);
197 MusicRange (BBT_Time& s, BBT_Time& e, uint32_t i)
198 : start (s), end (e), id (i) {}
200 bool operator== (const MusicRange& other) const {
201 return start == other.start && end == other.end && id == other.id;
204 bool equal (const MusicRange& other) const {
205 return start == other.start && end == other.end;
230 enum CrossfadeModel {
235 struct InterThreadInfo {
237 volatile bool cancel;
238 volatile float progress;
244 static inline jack_nframes_t
245 session_frame_to_track_frame (jack_nframes_t session_frame, double speed)
247 return (jack_nframes_t)( (double)session_frame * speed );
251 static inline jack_nframes_t
252 track_frame_to_session_frame (jack_nframes_t track_frame, double speed)
254 return (jack_nframes_t)( (double)track_frame / speed );
258 #endif /* __ardour_types_h__ */