comparison align/ExternalProgramAligner.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_EXTERNAL_PROGRAM_ALIGNER_H
16 #define SV_EXTERNAL_PROGRAM_ALIGNER_H
17
18 #include <QProcess>
19 #include <QString>
20
21 #include "data/model/Model.h"
22
23 class AlignmentModel;
24 class Document;
25
26 class ExternalProgramAligner : public QObject
27 {
28 Q_OBJECT
29
30 public:
31 ExternalProgramAligner(Document *doc,
32 ModelId reference,
33 ModelId toAlign,
34 QString program);
35
36 // Destroy the aligner, cleanly cancelling any ongoing alignment
37 ~ExternalProgramAligner();
38
39 bool begin(QString &error);
40
41 static bool isAvailable(QString program);
42
43 signals:
44 /**
45 * Emitted when alignment is successfully completed. The reference
46 * and toAlign models can be queried from the alignment model.
47 */
48 void complete(ModelId alignmentModel); // an AlignmentModel
49
50 private slots:
51 void programFinished(int, QProcess::ExitStatus);
52
53 private:
54 Document *m_document;
55 ModelId m_reference;
56 ModelId m_toAlign;
57 ModelId m_alignmentModel;
58 QString m_program;
59 QProcess *m_process;
60 };
61
62 #endif