diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-06-21 21:29:22 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-06-21 21:29:22 +0000 |
commit | be614d0538ddd78b13b236f760afbd94af540202 (patch) | |
tree | f437fc23359b43969d369e867146e67244c72ad7 /libs/evoral | |
parent | 500aaa0deeb386df94fddc4474aa6de43331becb (diff) |
change default overlapping note strategy to "relax" (i.e. do nothing); fix crash when looping with MIDI data; add back note-off resolution at loop point (if it was actually there) so that notes are turned off (but don't forget Ye Olde Sustain Pedal/Controller) when looping; minor other non-functional tweaks
git-svn-id: svn://localhost/ardour2/branches/3.0@9753 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/evoral')
-rw-r--r-- | libs/evoral/evoral/Sequence.hpp | 4 | ||||
-rw-r--r-- | libs/evoral/evoral/midi_util.h | 4 | ||||
-rw-r--r-- | libs/evoral/src/Sequence.cpp | 16 |
3 files changed, 22 insertions, 2 deletions
diff --git a/libs/evoral/evoral/Sequence.hpp b/libs/evoral/evoral/Sequence.hpp index 2b3ba4ace0..922b7594d4 100644 --- a/libs/evoral/evoral/Sequence.hpp +++ b/libs/evoral/evoral/Sequence.hpp @@ -191,6 +191,8 @@ public: inline PatchChanges& patch_changes () { return _patch_changes; } inline const PatchChanges& patch_changes () const { return _patch_changes; } + void dump (std::ostream&) const; + private: typedef std::priority_queue<NotePtr, std::deque<NotePtr>, LaterNoteEndComparator> ActiveNotes; public: @@ -332,5 +334,7 @@ private: } // namespace Evoral +// template<typename Time> std::ostream& operator<<(std::ostream& o, const Evoral::Sequence<Time>& s) { s.dump (o); return o; } + #endif // EVORAL_SEQUENCE_HPP diff --git a/libs/evoral/evoral/midi_util.h b/libs/evoral/evoral/midi_util.h index da7051aefa..e1ae7f4620 100644 --- a/libs/evoral/evoral/midi_util.h +++ b/libs/evoral/evoral/midi_util.h @@ -19,6 +19,8 @@ #ifndef EVORAL_MIDI_UTIL_H #define EVORAL_MIDI_UTIL_H +#include <iostream> + #include <stdint.h> #include <stdbool.h> #include <string> @@ -66,9 +68,11 @@ midi_event_size(uint8_t status) return 1; case MIDI_CMD_COMMON_SYSEX: + std::cerr << "event size called for sysex\n"; return -1; } + std::cerr << "event size called for unknown status byte " << std::hex << (int) status << "\n"; return -1; } diff --git a/libs/evoral/src/Sequence.cpp b/libs/evoral/src/Sequence.cpp index 3c1bda9b96..1d91690a61 100644 --- a/libs/evoral/src/Sequence.cpp +++ b/libs/evoral/src/Sequence.cpp @@ -687,7 +687,7 @@ Sequence<Time>::add_note_unlocked(const NotePtr note, void* arg) _edited = true; - return true; + return true; } template<typename Time> @@ -750,7 +750,7 @@ Sequence<Time>::remove_note_unlocked(const constNotePtr note) } if (!erased) { - cerr << "Unable to find note to erase" << endl; + cerr << "Unable to find note to erase matching " << *note.get() << endl; } } @@ -1214,5 +1214,17 @@ Sequence<Time>::control_list_marked_dirty () template class Sequence<Evoral::MusicalTime>; +template<typename Time> +void +Sequence<Time>::dump (ostream& str) const +{ + Sequence<Time>::const_iterator i; + str << "+++ dump\n"; + for (i = begin(); i != end(); ++i) { + str << *i << endl; + } + str << "--- dump\n"; +} + } // namespace Evoral |