From db6706429643d80e68a050daa015d17f36d5321b Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 31 May 2010 19:47:15 +0000 Subject: [PATCH] switch Evoral::Sequence debugging to use DEBUG_TRACE(); Sequence uses multiset<...,EarlierNoteComparator> for _write_notes, does FIFO note resolution for overlapping notes in SMF file; implement Sequence::overlaps() ... current use is uncertain; ARDOUR::coverage() uses 64bit framepos_t git-svn-id: svn://localhost/ardour2/branches/3.0@7199 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/types.h | 6 +- libs/ardour/audiofilesource.cc | 2 +- libs/ardour/globals.cc | 9 +- libs/evoral/evoral/Note.hpp | 3 + libs/evoral/evoral/Sequence.hpp | 9 +- libs/evoral/evoral/types.hpp | 9 ++ libs/evoral/src/Sequence.cpp | 164 ++++++++++++++++++++------------ libs/evoral/wscript | 1 + 8 files changed, 130 insertions(+), 73 deletions(-) diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index 2bbb140bb2..e55840cb20 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -82,9 +82,9 @@ namespace ARDOUR { OverlapEnd, // overlap begins within and covers end OverlapExternal // overlap extends to (at least) begin+end }; - - OverlapType coverage (nframes_t start_a, nframes_t end_a, - nframes_t start_b, nframes_t end_b); + + ARDOUR::OverlapType coverage (framepos_t sa, framepos_t ea, + framepos_t sb, framepos_t eb); /** See parameter.h * XXX: I don't think/hope these hex values matter anymore. diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc index 1973678359..c783b47b9b 100644 --- a/libs/ardour/audiofilesource.cc +++ b/libs/ardour/audiofilesource.cc @@ -222,7 +222,7 @@ AudioFileSource::old_peak_path (ustring audio_path) #ifdef __APPLE__ snprintf (buf, sizeof (buf), "%u-%u-%d.peak", stat_mount.st_ino, stat_file.st_ino, _channel); #else - snprintf (buf, sizeof (buf), "%lld-%lld-%d.peak", stat_mount.st_ino, stat_file.st_ino, _channel); + snprintf (buf, sizeof (buf), "%" PRId64 "-%" PRId64 "-%d.peak", (int64_t) stat_mount.st_ino, (int64_t) stat_file.st_ino, _channel); #endif ustring res = peak_dir; diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index b78edc11d2..c9641bfe43 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -535,8 +535,8 @@ ARDOUR::setup_fpu () } ARDOUR::OverlapType -ARDOUR::coverage (nframes_t sa, nframes_t ea, - nframes_t sb, nframes_t eb) +ARDOUR::coverage (framepos_t sa, framepos_t ea, + framepos_t sb, framepos_t eb) { /* OverlapType returned reflects how the second (B) range overlaps the first (A). @@ -563,11 +563,8 @@ ARDOUR::coverage (nframes_t sa, nframes_t ea, "B is internal to A" */ -#ifdef OLD_COVERAGE - if ((sb >= sa) && (eb <= ea)) { -#else + if ((sb > sa) && (eb <= ea)) { -#endif return OverlapInternal; } diff --git a/libs/evoral/evoral/Note.hpp b/libs/evoral/evoral/Note.hpp index 6110ad42fe..1c48634530 100644 --- a/libs/evoral/evoral/Note.hpp +++ b/libs/evoral/evoral/Note.hpp @@ -42,6 +42,7 @@ public: note() == other.note() && musical_time_equal (length(), other.length()) && velocity() == other.velocity() && + off_velocity() == other.off_velocity() && channel() == other.channel(); } @@ -49,6 +50,7 @@ public: inline Time end_time() const { return _off_event.time(); } inline uint8_t note() const { return _on_event.note(); } inline uint8_t velocity() const { return _on_event.velocity(); } + inline uint8_t off_velocity() const { return _off_event.velocity(); } inline Time length() const { return _off_event.time() - _on_event.time(); } inline uint8_t channel() const { assert(_on_event.channel() == _off_event.channel()); @@ -58,6 +60,7 @@ public: inline void set_time(Time t) { _off_event.time() = t + length(); _on_event.time() = t; } inline void set_note(uint8_t n) { _on_event.buffer()[1] = n; _off_event.buffer()[1] = n; } inline void set_velocity(uint8_t n) { _on_event.buffer()[2] = n; } + inline void set_off_velocity(uint8_t n) { _off_event.buffer()[2] = n; } inline void set_length(Time l) { _off_event.time() = _on_event.time() + l; } inline void set_channel(uint8_t c) { _on_event.set_channel(c); _off_event.set_channel(c); } diff --git a/libs/evoral/evoral/Sequence.hpp b/libs/evoral/evoral/Sequence.hpp index 36f4138abd..c76d126904 100644 --- a/libs/evoral/evoral/Sequence.hpp +++ b/libs/evoral/evoral/Sequence.hpp @@ -220,7 +220,9 @@ public: bool edited() const { return _edited; } void set_edited(bool yn) { _edited = yn; } + bool overlaps (const boost::shared_ptr< Note