diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-10-27 02:24:56 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-10-27 02:24:56 +0000 |
commit | 68a3144344ab0e103539ee27b9f95324f45dcbe7 (patch) | |
tree | e554abed86f8821ddd90c3ca9c905a6c25290785 /libs/ardour/ardour | |
parent | 9ad08bfe973c72f2d73fae2be786d99efdc20a26 (diff) |
new SnapBBT debug option, split out BBT_time and start work on BBT arithmetic framework. this will cause a full recompile, so find something else to do
git-svn-id: svn://localhost/ardour2/branches/3.0@5936 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/debug.h | 3 | ||||
-rw-r--r-- | libs/ardour/ardour/session_configuration_vars.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/tempo.h | 54 | ||||
-rw-r--r-- | libs/ardour/ardour/types.h | 33 |
4 files changed, 34 insertions, 58 deletions
diff --git a/libs/ardour/ardour/debug.h b/libs/ardour/ardour/debug.h index bc0fefb428..a8f826babe 100644 --- a/libs/ardour/ardour/debug.h +++ b/libs/ardour/ardour/debug.h @@ -37,7 +37,8 @@ namespace ARDOUR { enum DebugBits { MidiSourceIO = 0x1, MidiPlaylistIO = 0x2, - MidiDiskstreamIO = 0x4 + MidiDiskstreamIO = 0x4, + SnapBBT = 0x8 }; } diff --git a/libs/ardour/ardour/session_configuration_vars.h b/libs/ardour/ardour/session_configuration_vars.h index 8c1dffc884..fd85993a29 100644 --- a/libs/ardour/ardour/session_configuration_vars.h +++ b/libs/ardour/ardour/session_configuration_vars.h @@ -33,7 +33,7 @@ CONFIG_VARIABLE (bool, auto_input, "auto-input", true) CONFIG_VARIABLE (bool, punch_in, "punch-in", false) CONFIG_VARIABLE (bool, punch_out, "punch-out", false) CONFIG_VARIABLE (uint32_t, subframes_per_frame, "subframes-per-frame", 100) -CONFIG_VARIABLE (SmpteFormat, timecode_format, "timecode-format", timecode_30) +CONFIG_VARIABLE (TimecodeFormat, timecode_format, "timecode-format", timecode_30) CONFIG_VARIABLE_SPECIAL(Glib::ustring, raid_path, "raid-path", "", path_expand) CONFIG_VARIABLE (std::string, bwf_country_code, "bwf-country-code", "US") CONFIG_VARIABLE (std::string, bwf_organization_code, "bwf-organization-code", "US") diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h index 613339ff0b..147c6a64e6 100644 --- a/libs/ardour/ardour/tempo.h +++ b/libs/ardour/ardour/tempo.h @@ -140,6 +140,30 @@ class TempoSection : public MetricSection, public Tempo { typedef std::list<MetricSection*> Metrics; +/** Helper class that we use to be able to keep track of which + meter *AND* tempo are in effect at a given point in time. +*/ +class TempoMetric { + public: + TempoMetric (const Meter& m, const Tempo& t) : _meter (&m), _tempo (&t), _frame (0) {} + + void set_tempo (const Tempo& t) { _tempo = &t; } + void set_meter (const Meter& m) { _meter = &m; } + void set_frame (nframes_t f) { _frame = f; } + void set_start (const BBT_Time& t) { _start = t; } + + const Meter& meter() const { return *_meter; } + const Tempo& tempo() const { return *_tempo; } + nframes_t frame() const { return _frame; } + const BBT_Time& start() const { return _start; } + + private: + const Meter* _meter; + const Tempo* _tempo; + nframes_t _frame; + BBT_Time _start; +}; + class TempoMap : public PBD::StatefulDestructible { public: @@ -217,33 +241,9 @@ class TempoMap : public PBD::StatefulDestructible void dump (std::ostream&) const; void clear (); - /** Helper class that we use to be able to keep track of which - meter *AND* tempo are in effect at a given point in time. - */ - class Metric { - public: - Metric (const Meter& m, const Tempo& t) : _meter (&m), _tempo (&t), _frame (0) {} - - void set_tempo (const Tempo& t) { _tempo = &t; } - void set_meter (const Meter& m) { _meter = &m; } - void set_frame (nframes_t f) { _frame = f; } - void set_start (const BBT_Time& t) { _start = t; } - - const Meter& meter() const { return *_meter; } - const Tempo& tempo() const { return *_tempo; } - nframes_t frame() const { return _frame; } - const BBT_Time& start() const { return _start; } - - private: - const Meter* _meter; - const Tempo* _tempo; - nframes_t _frame; - BBT_Time _start; - }; - - Metric metric_at (BBT_Time bbt) const; - Metric metric_at (nframes_t) const; - void bbt_time_with_metric (nframes_t, BBT_Time&, const Metric&) const; + TempoMetric metric_at (BBT_Time bbt) const; + TempoMetric metric_at (nframes_t) const; + void bbt_time_with_metric (nframes_t, BBT_Time&, const TempoMetric&) const; void change_existing_tempo_at (nframes_t, double bpm, double note_type); void change_initial_tempo (double bpm, double note_type); diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index 1cc619424e..c6fc2419b2 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -34,6 +34,8 @@ #include "control_protocol/timecode.h" #include "pbd/id.h" +#include "ardour/bbt_time.h" + #include <map> #if __GNUC__ < 3 @@ -156,34 +158,7 @@ namespace ARDOUR { TrackColor }; - struct BBT_Time { - uint32_t bars; - uint32_t beats; - uint32_t ticks; - - BBT_Time() { - bars = 1; - beats = 1; - ticks = 0; - } - - /* we can't define arithmetic operators for BBT_Time, because - the results depend on a TempoMap, but we can define - a useful check on the less-than condition. - */ - - bool operator< (const BBT_Time& other) const { - return bars < other.bars || - (bars == other.bars && beats < other.beats) || - (bars == other.bars && beats == other.beats && ticks < other.ticks); - } - - bool operator== (const BBT_Time& other) const { - return bars == other.bars && beats == other.beats && ticks == other.ticks; - } - - }; - enum SmpteFormat { + enum TimecodeFormat { timecode_23976, timecode_24, timecode_24976, @@ -467,7 +442,7 @@ std::istream& operator>>(std::istream& o, ARDOUR::CrossfadeModel& sf); std::istream& operator>>(std::istream& o, ARDOUR::SlaveSource& sf); std::istream& operator>>(std::istream& o, ARDOUR::ShuttleBehaviour& sf); std::istream& operator>>(std::istream& o, ARDOUR::ShuttleUnits& sf); -std::istream& operator>>(std::istream& o, ARDOUR::SmpteFormat& sf); +std::istream& operator>>(std::istream& o, ARDOUR::TimecodeFormat& sf); std::istream& operator>>(std::istream& o, ARDOUR::DenormalModel& sf); std::istream& operator>>(std::istream& o, ARDOUR::WaveformScale& sf); std::istream& operator>>(std::istream& o, ARDOUR::WaveformShape& sf); |