summaryrefslogtreecommitdiff
path: root/libs/evoral/evoral/PatchChange.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/evoral/evoral/PatchChange.hpp')
-rw-r--r--libs/evoral/evoral/PatchChange.hpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/evoral/evoral/PatchChange.hpp b/libs/evoral/evoral/PatchChange.hpp
index 82e2023941..b1a42c6f2e 100644
--- a/libs/evoral/evoral/PatchChange.hpp
+++ b/libs/evoral/evoral/PatchChange.hpp
@@ -119,7 +119,7 @@ public:
uint8_t channel () const { return _program_change.buffer()[0] & 0xf; }
inline bool operator< (const PatchChange<Time>& o) const {
- if (time() != o.time()) {
+ if (!musical_time_equal (time(), o.time())) {
return time() < o.time();
}
@@ -131,7 +131,7 @@ public:
}
inline bool operator== (const PatchChange<Time>& o) const {
- return (time() == o.time() && program() == o.program() && bank() == o.bank());
+ return (musical_time_equal (time(), o.time()) && program() == o.program() && bank() == o.bank());
}
/** The PatchChange is made up of messages() MIDI messages; this method returns them by index.
@@ -165,4 +165,10 @@ private:
}
+template<typename Time>
+std::ostream& operator<< (std::ostream& o, const Evoral::PatchChange<Time>& p) {
+ o << "Patch Change " << p.id() << " @ " << p.time() << " bank " << (int) p.bank() << " program " << (int) p.program();
+ return o;
+}
+
#endif