comparison align/TransformDTWAligner.h @ 767:dd742e566e60 pitch-align

Make a start on further alignment methods
author Chris Cannam
date Thu, 21 May 2020 16:21:57 +0100
parents
children 1b1960009be6
comparison
equal deleted inserted replaced
761:6429a164b7e1 767:dd742e566e60
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_DTW_ALIGNER_H
16 #define SV_TRANSFORM_DTW_ALIGNER_H
17
18 #include "Aligner.h"
19
20 #include "transform/Transform.h"
21
22 class AlignmentModel;
23 class Document;
24
25 class TransformDTWAligner : public Aligner
26 {
27 Q_OBJECT
28
29 public:
30 enum DTWType {
31 Magnitude,
32 RiseFall
33 };
34
35 TransformDTWAligner(Document *doc,
36 ModelId reference,
37 ModelId toAlign,
38 Transform transform,
39 DTWType dtwType);
40
41 // Destroy the aligner, cleanly cancelling any ongoing alignment
42 ~TransformDTWAligner();
43
44 void begin() override;
45
46 static bool isAvailable();
47
48 private slots:
49 void completionChanged(ModelId);
50
51 private:
52 bool performAlignment();
53 bool performAlignmentMagnitude();
54 bool performAlignmentRiseFall();
55
56 Document *m_document;
57 ModelId m_reference;
58 ModelId m_toAlign;
59 ModelId m_referenceOutputModel;
60 ModelId m_toAlignOutputModel;
61 ModelId m_alignmentProgressModel;
62 ModelId m_alignmentModel;
63 bool m_referenceTransformComplete;
64 bool m_toAlignTransformComplete;
65 Transform m_transform;
66 DTWType m_dtwType;
67 bool m_incomplete;
68 };
69
70 #endif