comparison align/TransformAligner.h @ 752:32654e402f8b pitch-align

Pull out ExternalProgramAligner and TransformAligner from Align - currently duplicating the code, the pulled-out classes are not yet in use
author Chris Cannam
date Thu, 23 Apr 2020 17:11:26 +0100
parents
children 31289e8592c7
comparison
equal deleted inserted replaced
751:ed5db7d37005 752:32654e402f8b
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 Sonic Visualiser
5 An audio file viewer and annotation editor.
6 Centre for Digital Music, Queen Mary, University of London.
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2 of the
11 License, or (at your option) any later version. See the file
12 COPYING included with this distribution for more information.
13 */
14
15 #ifndef SV_TRANSFORM_ALIGNER_H
16 #define SV_TRANSFORM_ALIGNER_H
17
18 #include <QString>
19
20 #include "data/model/Model.h"
21
22 class AlignmentModel;
23 class Document;
24
25 class TransformAligner : public QObject
26 {
27 Q_OBJECT
28
29 public:
30 TransformAligner(Document *doc,
31 ModelId reference,
32 ModelId toAlign);
33
34 // Destroy the aligner, cleanly cancelling any ongoing alignment
35 ~TransformAligner();
36
37 bool begin(QString &error);
38
39 static bool isAvailable();
40
41 signals:
42 /**
43 * Emitted when alignment is successfully completed. The reference
44 * and toAlign models can be queried from the alignment model.
45 */
46 void complete(ModelId alignmentModel); // an AlignmentModel
47
48 private slots:
49 void alignmentCompletionChanged(ModelId);
50 void tuningDifferenceCompletionChanged(ModelId);
51
52 private:
53 static QString getAlignmentTransformName();
54 static QString getTuningDifferenceTransformName();
55
56 bool beginAlignmentPhase();
57
58 Document *m_document;
59 ModelId m_reference;
60 ModelId m_toAlign;
61 ModelId m_aggregateModel; // an AggregateWaveModel
62 ModelId m_alignmentModel; // an AlignmentModel
63 ModelId m_tuningDiffProgressModel; // SparseTimeValueModel, unreg'd with doc
64 ModelId m_tuningDiffOutputModel; // SparseTimeValueModel, unreg'd with doc
65 ModelId m_pathOutputModel; // SparseTimeValueModel, unreg'd with doc
66 float m_tuningFrequency;
67 bool m_incomplete;
68 };
69
70 #endif