diff options
-rw-r--r-- | src/track/cueinfo.cpp | 10 | ||||
-rw-r--r-- | src/track/cueinfo.h | 23 |
2 files changed, 27 insertions, 6 deletions
diff --git a/src/track/cueinfo.cpp b/src/track/cueinfo.cpp index 0d678ade6a..688ec28b51 100644 --- a/src/track/cueinfo.cpp +++ b/src/track/cueinfo.cpp @@ -9,7 +9,8 @@ CueInfo::CueInfo() m_startPositionMillis(std::nullopt), m_endPositionMillis(std::nullopt), m_hotCueIndex(std::nullopt), - m_color(std::nullopt) { + m_color(std::nullopt), + m_flags(CueFlag::None) { } CueInfo::CueInfo( @@ -18,13 +19,15 @@ CueInfo::CueInfo( std::optional<double> endPositionMillis, std::optional<int> hotCueIndex, const QString& label, - mixxx::RgbColor::optional_t color) + mixxx::RgbColor::optional_t color, + CueFlags flags) : m_type(type), m_startPositionMillis(startPositionMillis), m_endPositionMillis(endPositionMillis), m_hotCueIndex(hotCueIndex), m_label(label), - m_color(color) { + m_color(color), + m_flags(flags) { } CueType CueInfo::getType() const { @@ -129,6 +132,7 @@ QDebug operator<<(QDebug debug, const CueInfo& cueInfo) { << ", index=" << cueInfo.getHotCueIndex() << ", label=" << cueInfo.getLabel() << ", color=" << cueInfo.getColor() + << ", flags=" << cueInfo.flags() << "]"; return debug; } diff --git a/src/track/cueinfo.h b/src/track/cueinfo.h index e027a9e0f5..77097521a1 100644 --- a/src/track/cueinfo.h +++ b/src/track/cueinfo.h @@ -1,6 +1,6 @@ #pragma once -// cueinfo.h -// Created 2020-02-28 by Jan Holthuis + +#include <QFlags> #include "audio/signalinfo.h" #include "util/color/rgbcolor.h" @@ -21,6 +21,14 @@ enum class CueType { // sound; not shown to user }; +enum class CueFlag { + None = 0, + /// Currently only used when importing locked loops from Serato Metadata. + Locked = 1, +}; +Q_DECLARE_FLAGS(CueFlags, CueFlag); +Q_DECLARE_OPERATORS_FOR_FLAGS(CueFlags); + /// Hot cues are sequentially indexed starting with kFirstHotCueIndex (inclusive) static constexpr int kFirstHotCueIndex = 0; @@ -33,7 +41,8 @@ class CueInfo { std::optional<double> endPositionMillis, const std::optional<int> hotCueIndex, const QString& label, - RgbColor::optional_t color); + RgbColor::optional_t color, + CueFlags flags = CueFlag::None); CueType getType() const; void setType(CueType type); @@ -58,6 +67,13 @@ class CueInfo { void setColor( mixxx::RgbColor::optional_t color = std::nullopt); + CueFlags flags() const { + return m_flags; + } + void setFlags(CueFlags flags) { + m_flags = flags; + } + private: CueType m_type; std::optional<double> m_startPositionMillis; @@ -65,6 +81,7 @@ class CueInfo { std::optional<int> m_hotCueIndex; QString m_label; RgbColor::optional_t m_color; + CueFlags m_flags; }; bool operator==( |