summaryrefslogtreecommitdiff
path: root/libs/evoral/evoral/Note.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-11-22 04:05:42 -0500
committerDavid Robillard <d@drobilla.net>2014-11-22 04:05:42 -0500
commitc1cfa12d6e5136d2e3e5501e83ff74c5009a9e60 (patch)
tree56d2811bc8b9d6f2a5accfa8e497ddd5976c7c7a /libs/evoral/evoral/Note.hpp
parentcae74309a583c29dd6cc2081425c2e7b673ea13e (diff)
Wrap MusicalTime in a class.
This lets us get a more explicit handle on time conversions, and is the main step towards using actual beat:tick time and getting away from floating point precision problems.
Diffstat (limited to 'libs/evoral/evoral/Note.hpp')
-rw-r--r--libs/evoral/evoral/Note.hpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/evoral/evoral/Note.hpp b/libs/evoral/evoral/Note.hpp
index 5401271621..87c8a9fe83 100644
--- a/libs/evoral/evoral/Note.hpp
+++ b/libs/evoral/evoral/Note.hpp
@@ -39,16 +39,16 @@ class LIBEVORAL_LOCAL Note {
class LIBEVORAL_TEMPLATE_API Note {
#endif
public:
- Note(uint8_t chan=0, Time time=0, Time len=0, uint8_t note=0, uint8_t vel=0x40);
+ Note(uint8_t chan=0, Time time=Time(), Time len=Time(), uint8_t note=0, uint8_t vel=0x40);
Note(const Note<Time>& copy);
~Note();
const Note<Time>& operator=(const Note<Time>& copy);
inline bool operator==(const Note<Time>& other) {
- return musical_time_equal (time(), other.time()) &&
+ return time() == other.time() &&
note() == other.note() &&
- musical_time_equal (length(), other.length()) &&
+ length() == other.length() &&
velocity() == other.velocity() &&
off_velocity() == other.off_velocity() &&
channel() == other.channel();
@@ -109,8 +109,6 @@ private:
MIDIEvent<Time> _off_event;
};
-} // namespace Evoral
-
template<typename Time>
/*LIBEVORAL_API*/ std::ostream& operator<<(std::ostream& o, const Evoral::Note<Time>& n) {
o << "Note #" << n.id() << ": pitch = " << (int) n.note()
@@ -120,6 +118,8 @@ template<typename Time>
return o;
}
+} // namespace Evoral
+
#ifdef COMPILER_MSVC
#include "../src/Note.impl"
#endif