comparison 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
comparison
equal deleted inserted replaced
761:6429a164b7e1 767:dd742e566e60
31 Q_OBJECT 31 Q_OBJECT
32 32
33 public: 33 public:
34 Align() { } 34 Align() { }
35 35
36 enum AlignmentType {
37 NoAlignment,
38 LinearAlignment,
39 TrimmedLinearAlignment,
40 MATCHAlignment,
41 MATCHAlignmentWithPitchCompare,
42 SungPitchContourAlignment,
43 TransformDrivenDTWAlignment,
44 ExternalProgramAlignment,
45
46 LastAlignmentType = ExternalProgramAlignment
47 };
48
49 static QString getAlignmentTypeTag(AlignmentType type);
50 static AlignmentType getAlignmentTypeForTag(QString tag);
51
52 static AlignmentType getAlignmentPreference(QString &additionalData);
53 static void setAlignmentPreference(AlignmentType type,
54 QString additionalData = "");
55
36 /** 56 /**
37 * Align the "other" model to the reference, attaching an 57 * Align the "other" model to the reference, attaching an
38 * AlignmentModel to it. Alignment is carried out by the method 58 * AlignmentModel to it. Alignment is carried out by the method
39 * configured in the user preferences (either a plugin transform 59 * configured in the user preferences (either a plugin transform
40 * or an external process) and is done asynchronously. 60 * or an external process) and is done asynchronously.
82 * Return true if the alignment facility is available (relevant 102 * Return true if the alignment facility is available (relevant
83 * plugin installed, etc). 103 * plugin installed, etc).
84 */ 104 */
85 static bool canAlign(); 105 static bool canAlign();
86 106
107 //!!! + check whether specific alignment types are available
108
87 signals: 109 signals:
88 /** 110 /**
89 * Emitted when an alignment is successfully completed. The 111 * Emitted when an alignment is successfully completed. The
90 * reference and other models can be queried from the alignment 112 * reference and other models can be queried from the alignment
91 * model. 113 * model.
109 // although we can calculate alignments with different references, 131 // although we can calculate alignments with different references,
110 // we can only have one alignment on any given toAlign model, so 132 // we can only have one alignment on any given toAlign model, so
111 // we don't key this on the whole (reference, toAlign) pair 133 // we don't key this on the whole (reference, toAlign) pair
112 std::map<ModelId, std::shared_ptr<Aligner>> m_aligners; 134 std::map<ModelId, std::shared_ptr<Aligner>> m_aligners;
113 135
114 void addAligner(Document *doc, ModelId reference, ModelId toAlign); 136 bool addAligner(Document *doc, ModelId reference, ModelId toAlign);
115 void removeAligner(QObject *); 137 void removeAligner(QObject *);
116
117 static void getAlignerPreference(bool &useProgram, QString &program);
118 }; 138 };
119 139
120 #endif 140 #endif
121 141