annotate 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
rev   line source
Chris@767 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@767 2
Chris@767 3 /*
Chris@767 4 Sonic Visualiser
Chris@767 5 An audio file viewer and annotation editor.
Chris@767 6 Centre for Digital Music, Queen Mary, University of London.
Chris@767 7
Chris@767 8 This program is free software; you can redistribute it and/or
Chris@767 9 modify it under the terms of the GNU General Public License as
Chris@767 10 published by the Free Software Foundation; either version 2 of the
Chris@767 11 License, or (at your option) any later version. See the file
Chris@767 12 COPYING included with this distribution for more information.
Chris@767 13 */
Chris@767 14
Chris@767 15 #ifndef SV_TRANSFORM_DTW_ALIGNER_H
Chris@767 16 #define SV_TRANSFORM_DTW_ALIGNER_H
Chris@767 17
Chris@767 18 #include "Aligner.h"
Chris@767 19
Chris@767 20 #include "transform/Transform.h"
Chris@767 21
Chris@767 22 class AlignmentModel;
Chris@767 23 class Document;
Chris@767 24
Chris@767 25 class TransformDTWAligner : public Aligner
Chris@767 26 {
Chris@767 27 Q_OBJECT
Chris@767 28
Chris@767 29 public:
Chris@767 30 enum DTWType {
Chris@767 31 Magnitude,
Chris@767 32 RiseFall
Chris@767 33 };
Chris@767 34
Chris@767 35 TransformDTWAligner(Document *doc,
Chris@767 36 ModelId reference,
Chris@767 37 ModelId toAlign,
Chris@767 38 Transform transform,
Chris@767 39 DTWType dtwType);
Chris@767 40
Chris@767 41 // Destroy the aligner, cleanly cancelling any ongoing alignment
Chris@767 42 ~TransformDTWAligner();
Chris@767 43
Chris@767 44 void begin() override;
Chris@767 45
Chris@767 46 static bool isAvailable();
Chris@767 47
Chris@767 48 private slots:
Chris@767 49 void completionChanged(ModelId);
Chris@767 50
Chris@767 51 private:
Chris@767 52 bool performAlignment();
Chris@767 53 bool performAlignmentMagnitude();
Chris@767 54 bool performAlignmentRiseFall();
Chris@767 55
Chris@767 56 Document *m_document;
Chris@767 57 ModelId m_reference;
Chris@767 58 ModelId m_toAlign;
Chris@767 59 ModelId m_referenceOutputModel;
Chris@767 60 ModelId m_toAlignOutputModel;
Chris@767 61 ModelId m_alignmentProgressModel;
Chris@767 62 ModelId m_alignmentModel;
Chris@767 63 bool m_referenceTransformComplete;
Chris@767 64 bool m_toAlignTransformComplete;
Chris@767 65 Transform m_transform;
Chris@767 66 DTWType m_dtwType;
Chris@767 67 bool m_incomplete;
Chris@767 68 };
Chris@767 69
Chris@767 70 #endif