changeset 1774:f19711ab7074

Optionally record relative pitch
author Chris Cannam
date Thu, 15 Aug 2019 18:18:03 +0100
parents fadd9f8aaa27
children e3db163e3f50
files data/model/AlignmentModel.cpp data/model/AlignmentModel.h
diffstat 2 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/data/model/AlignmentModel.cpp	Wed Aug 14 13:54:23 2019 +0100
+++ b/data/model/AlignmentModel.cpp	Thu Aug 15 18:18:03 2019 +0100
@@ -28,7 +28,8 @@
     m_path(nullptr),
     m_reversePath(nullptr),
     m_pathBegun(false),
-    m_pathComplete(false)
+    m_pathComplete(false),
+    m_relativePitch(0)
 {
     setPathFrom(pathSource);
 
--- a/data/model/AlignmentModel.h	Wed Aug 14 13:54:23 2019 +0100
+++ b/data/model/AlignmentModel.h	Thu Aug 15 18:18:03 2019 +0100
@@ -62,6 +62,17 @@
     void setPathFrom(ModelId pathSource); // a SparseTimeValueModel
     void setPath(const Path &path);
 
+    /**
+     * Set the calculated pitch relative to a reference. This is
+     * purely metadata.
+     */
+    void setRelativePitch(int cents) { m_relativePitch = cents; }
+
+    /**
+     * Get the value set with setRelativePitch.
+     */
+    int getRelativePitch() const { return m_relativePitch; }
+
     void toXml(QTextStream &stream,
                QString indent = "",
                QString extraAttributes = "") const override;
@@ -90,6 +101,7 @@
     bool m_pathBegun;
     bool m_pathComplete;
     QString m_error;
+    int m_relativePitch;
 
     void constructPath() const;
     void constructReversePath() const;