diff align/Align.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 6429a164b7e1
children 1d6cca5a5621
line wrap: on
line diff
--- a/align/Align.h	Wed May 06 11:45:27 2020 +0100
+++ b/align/Align.h	Thu May 21 16:21:57 2020 +0100
@@ -33,6 +33,26 @@
 public:
     Align() { }
 
+    enum AlignmentType {
+        NoAlignment,
+        LinearAlignment,
+        TrimmedLinearAlignment,
+        MATCHAlignment,
+        MATCHAlignmentWithPitchCompare,
+        SungPitchContourAlignment,
+        TransformDrivenDTWAlignment,
+        ExternalProgramAlignment,
+
+        LastAlignmentType = ExternalProgramAlignment
+    };
+
+    static QString getAlignmentTypeTag(AlignmentType type);
+    static AlignmentType getAlignmentTypeForTag(QString tag);
+
+    static AlignmentType getAlignmentPreference(QString &additionalData);
+    static void setAlignmentPreference(AlignmentType type,
+                                       QString additionalData = "");
+    
     /**
      * Align the "other" model to the reference, attaching an
      * AlignmentModel to it. Alignment is carried out by the method
@@ -84,6 +104,8 @@
      */
     static bool canAlign();
 
+    //!!! + check whether specific alignment types are available
+
 signals:
     /**
      * Emitted when an alignment is successfully completed. The
@@ -111,10 +133,8 @@
     // we don't key this on the whole (reference, toAlign) pair
     std::map<ModelId, std::shared_ptr<Aligner>> m_aligners;
 
-    void addAligner(Document *doc, ModelId reference, ModelId toAlign);
+    bool addAligner(Document *doc, ModelId reference, ModelId toAlign);
     void removeAligner(QObject *);
-
-    static void getAlignerPreference(bool &useProgram, QString &program);
 };
 
 #endif