summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/automation_control.h1
-rw-r--r--libs/ardour/ardour/automation_list.h5
-rw-r--r--libs/ardour/ardour/beats_frames_converter.h28
-rw-r--r--libs/ardour/ardour/midi_model.h23
-rw-r--r--libs/ardour/ardour/midi_region.h2
-rw-r--r--libs/ardour/ardour/midi_source.h12
-rw-r--r--libs/ardour/ardour/smf_source.h7
7 files changed, 49 insertions, 29 deletions
diff --git a/libs/ardour/ardour/automation_control.h b/libs/ardour/ardour/automation_control.h
index 639c5b5287..d73b2fc822 100644
--- a/libs/ardour/ardour/automation_control.h
+++ b/libs/ardour/ardour/automation_control.h
@@ -24,6 +24,7 @@
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
+#include "evoral/types.hpp"
#include "pbd/controllable.h"
#include "evoral/Control.hpp"
diff --git a/libs/ardour/ardour/automation_list.h b/libs/ardour/ardour/automation_list.h
index 72c26420c0..28f9be3fd4 100644
--- a/libs/ardour/ardour/automation_list.h
+++ b/libs/ardour/ardour/automation_list.h
@@ -27,6 +27,9 @@
#include <glibmm/threads.h>
+#include "evoral/ControlList.hpp"
+#include "evoral/Parameter.hpp"
+
#include "pbd/undo.h"
#include "pbd/xml++.h"
#include "pbd/statefuldestructible.h"
@@ -34,8 +37,6 @@
#include "ardour/ardour.h"
-#include "evoral/ControlList.hpp"
-
namespace ARDOUR {
class AutomationList;
diff --git a/libs/ardour/ardour/beats_frames_converter.h b/libs/ardour/ardour/beats_frames_converter.h
index 2e170d278a..ada09b1179 100644
--- a/libs/ardour/ardour/beats_frames_converter.h
+++ b/libs/ardour/ardour/beats_frames_converter.h
@@ -20,6 +20,8 @@
*/
#include "evoral/TimeConverter.hpp"
+#include "evoral/types.hpp"
+
#include "ardour/libardour_visibility.h"
#include "ardour/types.h"
@@ -34,15 +36,35 @@ class TempoMap;
* from some origin (supplied to the constructor in frames), and converts
* them to the opposite unit, taking tempo changes into account.
*/
-class LIBARDOUR_API BeatsFramesConverter : public Evoral::TimeConverter<double,framepos_t> {
+class LIBARDOUR_API BeatsFramesConverter
+ : public Evoral::TimeConverter<Evoral::MusicalTime,framepos_t> {
public:
BeatsFramesConverter (TempoMap& tempo_map, framepos_t origin)
+ : Evoral::TimeConverter<Evoral::MusicalTime, framepos_t> (origin)
+ , _tempo_map(tempo_map)
+ {}
+
+ framepos_t to (Evoral::MusicalTime beats) const;
+ Evoral::MusicalTime from (framepos_t frames) const;
+
+private:
+ TempoMap& _tempo_map;
+};
+
+/** Converter between beats and frames. Takes distances in beats or frames
+ * from some origin (supplied to the constructor in frames), and converts
+ * them to the opposite unit, taking tempo changes into account.
+ */
+class LIBARDOUR_API DoubleBeatsFramesConverter
+ : public Evoral::TimeConverter<double,framepos_t> {
+public:
+ DoubleBeatsFramesConverter (TempoMap& tempo_map, framepos_t origin)
: Evoral::TimeConverter<double, framepos_t> (origin)
, _tempo_map(tempo_map)
{}
- framepos_t to (double beats) const;
- double from (framepos_t frames) const;
+ framepos_t to (double beats) const;
+ double from (framepos_t frames) const;
private:
TempoMap& _tempo_map;
diff --git a/libs/ardour/ardour/midi_model.h b/libs/ardour/ardour/midi_model.h
index dc1c7af0e9..31df5ef040 100644
--- a/libs/ardour/ardour/midi_model.h
+++ b/libs/ardour/ardour/midi_model.h
@@ -116,16 +116,11 @@ public:
struct NoteChange {
NoteDiffCommand::Property property;
NotePtr note;
- uint32_t note_id;
-
- union {
- uint8_t old_value;
- TimeType old_time;
- };
- union {
- uint8_t new_value;
- TimeType new_time;
- };
+ uint32_t note_id;
+ uint8_t old_value; // or...
+ TimeType old_time; // this
+ uint8_t new_value; // or...
+ TimeType new_time; // this
};
typedef std::list<NoteChange> ChangeList;
@@ -209,16 +204,16 @@ public:
struct Change {
PatchChangePtr patch;
Property property;
- gint patch_id;
+ gint patch_id;
+ TimeType old_time;
union {
- TimeType old_time;
uint8_t old_channel;
int old_bank;
uint8_t old_program;
};
+ TimeType new_time;
union {
uint8_t new_channel;
- TimeType new_time;
uint8_t new_program;
int new_bank;
};
@@ -311,7 +306,5 @@ private:
} /* namespace ARDOUR */
-/* This is a very long comment and stuff oh my god it's so long what are we going to do oh no oh no*/
-
#endif /* __ardour_midi_model_h__ */
diff --git a/libs/ardour/ardour/midi_region.h b/libs/ardour/ardour/midi_region.h
index 38229b998b..2a4e3a6190 100644
--- a/libs/ardour/ardour/midi_region.h
+++ b/libs/ardour/ardour/midi_region.h
@@ -23,6 +23,8 @@
#include <vector>
+#include "evoral/types.hpp"
+
#include "ardour/ardour.h"
#include "ardour/region.h"
diff --git a/libs/ardour/ardour/midi_source.h b/libs/ardour/ardour/midi_source.h
index 65e382c4b7..2ce92ba3cf 100644
--- a/libs/ardour/ardour/midi_source.h
+++ b/libs/ardour/ardour/midi_source.h
@@ -43,7 +43,7 @@ template<typename T> class MidiRingBuffer;
class LIBARDOUR_API MidiSource : virtual public Source, public boost::enable_shared_from_this<MidiSource>
{
public:
- typedef double TimeType;
+ typedef Evoral::MusicalTime TimeType;
MidiSource (Session& session, std::string name, Source::Flag flags = Source::Flag(0));
MidiSource (Session& session, const XMLNode&);
@@ -120,7 +120,7 @@ class LIBARDOUR_API MidiSource : virtual public Source, public boost::enable_sha
*/
virtual void mark_midi_streaming_write_completed (
Evoral::Sequence<Evoral::MusicalTime>::StuckNoteOption stuck_option,
- Evoral::MusicalTime when = 0);
+ Evoral::MusicalTime when = Evoral::MusicalTime());
virtual void session_saved();
@@ -134,8 +134,8 @@ class LIBARDOUR_API MidiSource : virtual public Source, public boost::enable_sha
bool length_mutable() const { return true; }
- void set_length_beats(double l) { _length_beats = l; }
- double length_beats() const { return _length_beats; }
+ void set_length_beats(TimeType l) { _length_beats = l; }
+ TimeType length_beats() const { return _length_beats; }
virtual void load_model(bool lock=true, bool force_reload=false) = 0;
virtual void destroy_model() = 0;
@@ -194,8 +194,8 @@ class LIBARDOUR_API MidiSource : virtual public Source, public boost::enable_sha
mutable Evoral::Sequence<Evoral::MusicalTime>::const_iterator _model_iter;
mutable bool _model_iter_valid;
- mutable double _length_beats;
- mutable framepos_t _last_read_end;
+ mutable Evoral::MusicalTime _length_beats;
+ mutable framepos_t _last_read_end;
/** The total duration of the current capture. */
framepos_t _capture_length;
diff --git a/libs/ardour/ardour/smf_source.h b/libs/ardour/ardour/smf_source.h
index 84c45f9b3c..1c1f2bbcba 100644
--- a/libs/ardour/ardour/smf_source.h
+++ b/libs/ardour/ardour/smf_source.h
@@ -56,7 +56,8 @@ public:
void mark_streaming_midi_write_started (NoteMode mode);
void mark_streaming_write_completed ();
- void mark_midi_streaming_write_completed (Evoral::Sequence<Evoral::MusicalTime>::StuckNoteOption, Evoral::MusicalTime when = 0);
+ void mark_midi_streaming_write_completed (Evoral::Sequence<Evoral::MusicalTime>::StuckNoteOption,
+ Evoral::MusicalTime when = Evoral::MusicalTime());
XMLNode& get_state ();
int set_state (const XMLNode&, int version);
@@ -88,8 +89,8 @@ public:
framepos_t position,
framecnt_t cnt);
- double _last_ev_time_beats;
- framepos_t _last_ev_time_frames;
+ Evoral::MusicalTime _last_ev_time_beats;
+ framepos_t _last_ev_time_frames;
/** end time (start + duration) of last call to read_unlocked */
mutable framepos_t _smf_last_read_end;
/** time (in SMF ticks, 1 tick per _ppqn) of the last event read by read_unlocked */