# HG changeset patch # User Chris Cannam # Date 1565889483 -3600 # Node ID f19711ab707488418e353ef74615846414163c52 # Parent fadd9f8aaa278f772d9922f92a00cffe074cfb42 Optionally record relative pitch diff -r fadd9f8aaa27 -r f19711ab7074 data/model/AlignmentModel.cpp --- 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); diff -r fadd9f8aaa27 -r f19711ab7074 data/model/AlignmentModel.h --- 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;