diff options
Diffstat (limited to 'include/djinterop/performance_data.hpp')
-rw-r--r-- | include/djinterop/performance_data.hpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/include/djinterop/performance_data.hpp b/include/djinterop/performance_data.hpp index 67e22e2..620e676 100644 --- a/include/djinterop/performance_data.hpp +++ b/include/djinterop/performance_data.hpp @@ -35,12 +35,26 @@ struct sampling_info { double sample_rate = 0; // usually 44100.0 or 48000.0 int64_t sample_count = 0; + + friend bool operator==( + const sampling_info& first, const sampling_info& second) noexcept + { + return first.sample_rate == second.sample_rate && + first.sample_count == second.sample_count; + } }; struct beatgrid_marker { int32_t index = 0; double sample_offset = 0; + + friend bool operator==( + const beatgrid_marker& first, const beatgrid_marker& second) noexcept + { + return first.index == second.index && + first.sample_offset == second.sample_offset; + } }; struct hot_cue @@ -48,6 +62,13 @@ struct hot_cue std::string label; double sample_offset = 0; pad_color color; + + friend bool operator==(const hot_cue& first, const hot_cue& second) noexcept + { + return first.label == second.label && + first.sample_offset == second.sample_offset && + first.color == second.color; + } }; struct loop @@ -56,12 +77,26 @@ struct loop double start_sample_offset = 0; double end_sample_offset = 0; pad_color color; + + friend bool operator==(const loop& first, const loop& second) noexcept + { + return first.label == second.label && + first.start_sample_offset == second.start_sample_offset && + first.end_sample_offset == second.end_sample_offset && + first.color == second.color; + } }; struct waveform_point { uint8_t value = 0; uint8_t opacity = 255; + + friend bool operator==( + const waveform_point& first, const waveform_point& second) noexcept + { + return first.value == second.value && first.opacity == second.opacity; + } }; /** @@ -82,6 +117,13 @@ struct waveform_entry waveform_point low; waveform_point mid; waveform_point high; + + friend bool operator==( + const waveform_entry& first, const waveform_entry& second) noexcept + { + return first.low == second.low && first.mid == second.mid && + first.high == second.high; + } }; } // namespace djinterop |