changeset 1705:28f9ff7864c6 single-point

Add error field to alignment model
author Chris Cannam
date Wed, 15 May 2019 17:51:43 +0100
parents 452b48b29c2d
children 1e7b7a62d373
files data/model/AlignmentModel.cpp data/model/AlignmentModel.h
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/data/model/AlignmentModel.cpp	Mon May 13 15:43:23 2019 +0100
+++ b/data/model/AlignmentModel.cpp	Wed May 15 17:51:43 2019 +0100
@@ -76,8 +76,9 @@
 bool
 AlignmentModel::isOK() const
 {
+    if (m_error != "") return false;
     if (m_rawPath) return m_rawPath->isOK();
-    else return true;
+    return true;
 }
 
 sv_frame_t
--- a/data/model/AlignmentModel.h	Mon May 13 15:43:23 2019 +0100
+++ b/data/model/AlignmentModel.h	Wed May 15 17:51:43 2019 +0100
@@ -36,6 +36,10 @@
     ~AlignmentModel();
 
     bool isOK() const override;
+
+    void setError(QString error) { m_error = error; }
+    QString getError() const { return m_error; }
+
     sv_frame_t getStartFrame() const override;
     sv_frame_t getEndFrame() const override;
     sv_samplerate_t getSampleRate() const override;
@@ -86,6 +90,7 @@
     mutable PathModel *m_reversePath; // I own this
     bool m_pathBegun;
     bool m_pathComplete;
+    QString m_error;
 
     void constructPath() const;
     void constructReversePath() const;