From 94107c014ed39c18018936f50119f40ef35fd382 Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Wed, 6 Oct 2021 12:53:15 +0200 Subject: [PATCH 1/4] FramePos: Use QDebugStateSaver to reset debug formatting --- src/audio/frame.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/audio/frame.h b/src/audio/frame.h index 3cefcdd7261..36381edbf32 100644 --- a/src/audio/frame.h +++ b/src/audio/frame.h @@ -210,6 +210,7 @@ inline bool operator!=(FramePos frame1, FramePos frame2) { inline QDebug operator<<(QDebug dbg, FramePos arg) { if (arg.isValid()) { + QDebugStateSaver saver(dbg); dbg.nospace() << "FramePos(" << arg.value() << ")"; } else { dbg << "FramePos()"; From dae102e4c5f8bda0b78c6e98f37353560ae1c05d Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Wed, 6 Oct 2021 12:53:51 +0200 Subject: [PATCH 2/4] Bpm: Use QDebugStateSaver to reset debug formatting --- src/track/bpm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/track/bpm.h b/src/track/bpm.h index 5c4f7698b49..fb6b11f9db8 100644 --- a/src/track/bpm.h +++ b/src/track/bpm.h @@ -198,6 +198,7 @@ inline bool operator>=(Bpm bpm1, Bpm bpm2) { inline QDebug operator<<(QDebug dbg, Bpm arg) { if (arg.isValid()) { + QDebugStateSaver saver(dbg); dbg.nospace() << "Bpm(" << arg.value() << ")"; } else { dbg << "Bpm(Invalid)"; From 0cf6705679ef00a0893317c07c7644afa7e11f0b Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Wed, 6 Oct 2021 16:03:47 +0200 Subject: [PATCH 3/4] FramePos: Move QDebug implementation into cpp file --- CMakeLists.txt | 1 + src/audio/frame.cpp | 17 +++++++++++++++++ src/audio/frame.h | 10 +--------- 3 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 src/audio/frame.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 954165c8bd6..62e7c92a355 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -454,6 +454,7 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL src/analyzer/plugins/analyzersoundtouchbeats.cpp src/analyzer/plugins/buffering_utils.cpp src/analyzer/trackanalysisscheduler.cpp + src/audio/frame.cpp src/audio/types.cpp src/audio/signalinfo.cpp src/audio/streaminfo.cpp diff --git a/src/audio/frame.cpp b/src/audio/frame.cpp new file mode 100644 index 00000000000..6832e1a5b70 --- /dev/null +++ b/src/audio/frame.cpp @@ -0,0 +1,17 @@ +#include "audio/frame.h" + +namespace mixxx { +namespace audio { + +QDebug operator<<(QDebug dbg, FramePos arg) { + if (arg.isValid()) { + QDebugStateSaver saver(dbg); + dbg.nospace() << "FramePos(" << arg.value() << ")"; + } else { + dbg << "FramePos()"; + } + return dbg; +} + +} // namespace audio +} // namespace mixxx diff --git a/src/audio/frame.h b/src/audio/frame.h index 36381edbf32..1e37faeb652 100644 --- a/src/audio/frame.h +++ b/src/audio/frame.h @@ -208,15 +208,7 @@ inline bool operator!=(FramePos frame1, FramePos frame2) { return !(frame1 == frame2); } -inline QDebug operator<<(QDebug dbg, FramePos arg) { - if (arg.isValid()) { - QDebugStateSaver saver(dbg); - dbg.nospace() << "FramePos(" << arg.value() << ")"; - } else { - dbg << "FramePos()"; - } - return dbg; -} +QDebug operator<<(QDebug dbg, FramePos arg); constexpr FramePos kInvalidFramePos = FramePos(FramePos::kInvalidValue); constexpr FramePos kStartFramePos = FramePos(FramePos::kStartValue); From 74dbe93e97811dfa92539c39769a6ba4eb62b851 Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Wed, 6 Oct 2021 16:04:14 +0200 Subject: [PATCH 4/4] Bpm: Move QDebug implementation into cpp file --- src/track/bpm.cpp | 10 ++++++++++ src/track/bpm.h | 10 +--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/track/bpm.cpp b/src/track/bpm.cpp index ba52300ec9f..9bf73e6c376 100644 --- a/src/track/bpm.cpp +++ b/src/track/bpm.cpp @@ -65,4 +65,14 @@ QString Bpm::displayValueText(double value) { return QString("%1").arg(value, 3, 'f', 1); } +QDebug operator<<(QDebug dbg, Bpm arg) { + if (arg.isValid()) { + QDebugStateSaver saver(dbg); + dbg.nospace() << "Bpm(" << arg.value() << ")"; + } else { + dbg << "Bpm(Invalid)"; + } + return dbg; +} + } // namespace mixxx diff --git a/src/track/bpm.h b/src/track/bpm.h index fb6b11f9db8..e75c2f2fd6e 100644 --- a/src/track/bpm.h +++ b/src/track/bpm.h @@ -196,15 +196,7 @@ inline bool operator>=(Bpm bpm1, Bpm bpm2) { return bpm2 <= bpm1; } -inline QDebug operator<<(QDebug dbg, Bpm arg) { - if (arg.isValid()) { - QDebugStateSaver saver(dbg); - dbg.nospace() << "Bpm(" << arg.value() << ")"; - } else { - dbg << "Bpm(Invalid)"; - } - return dbg; -} +QDebug operator<<(QDebug dbg, Bpm arg); } Q_DECLARE_TYPEINFO(mixxx::Bpm, Q_MOVABLE_TYPE);