annotate 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
rev   line source
Chris@752 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@752 2
Chris@752 3 /*
Chris@752 4 Sonic Visualiser
Chris@752 5 An audio file viewer and annotation editor.
Chris@752 6 Centre for Digital Music, Queen Mary, University of London.
Chris@752 7
Chris@752 8 This program is free software; you can redistribute it and/or
Chris@752 9 modify it under the terms of the GNU General Public License as
Chris@752 10 published by the Free Software Foundation; either version 2 of the
Chris@752 11 License, or (at your option) any later version. See the file
Chris@752 12 COPYING included with this distribution for more information.
Chris@752 13 */
Chris@752 14
Chris@752 15 #ifndef SV_EXTERNAL_PROGRAM_ALIGNER_H
Chris@752 16 #define SV_EXTERNAL_PROGRAM_ALIGNER_H
Chris@752 17
Chris@752 18 #include <QProcess>
Chris@752 19 #include <QString>
Chris@752 20
Chris@752 21 #include "data/model/Model.h"
Chris@752 22
Chris@752 23 class AlignmentModel;
Chris@752 24 class Document;
Chris@752 25
Chris@752 26 class ExternalProgramAligner : public QObject
Chris@752 27 {
Chris@752 28 Q_OBJECT
Chris@752 29
Chris@752 30 public:
Chris@752 31 ExternalProgramAligner(Document *doc,
Chris@752 32 ModelId reference,
Chris@752 33 ModelId toAlign,
Chris@752 34 QString program);
Chris@752 35
Chris@752 36 // Destroy the aligner, cleanly cancelling any ongoing alignment
Chris@752 37 ~ExternalProgramAligner();
Chris@752 38
Chris@752 39 bool begin(QString &error);
Chris@752 40
Chris@752 41 static bool isAvailable(QString program);
Chris@752 42
Chris@752 43 signals:
Chris@752 44 /**
Chris@752 45 * Emitted when alignment is successfully completed. The reference
Chris@752 46 * and toAlign models can be queried from the alignment model.
Chris@752 47 */
Chris@752 48 void complete(ModelId alignmentModel); // an AlignmentModel
Chris@752 49
Chris@752 50 private slots:
Chris@752 51 void programFinished(int, QProcess::ExitStatus);
Chris@752 52
Chris@752 53 private:
Chris@752 54 Document *m_document;
Chris@752 55 ModelId m_reference;
Chris@752 56 ModelId m_toAlign;
Chris@752 57 ModelId m_alignmentModel;
Chris@752 58 QString m_program;
Chris@752 59 QProcess *m_process;
Chris@752 60 };
Chris@752 61
Chris@752 62 #endif