comparison framework/Document.cpp @ 428:b23db4cef02f alignment_view

Emit a signal when alignment completes
author Chris Cannam
date Fri, 21 Nov 2014 13:15:57 +0000
parents f32a64149602
children d9d132c0e240
comparison
equal deleted inserted replaced
427:a67245dce0d4 428:b23db4cef02f
53 m_align(new Align()) 53 m_align(new Align())
54 { 54 {
55 connect(this, SIGNAL(modelAboutToBeDeleted(Model *)), 55 connect(this, SIGNAL(modelAboutToBeDeleted(Model *)),
56 ModelTransformerFactory::getInstance(), 56 ModelTransformerFactory::getInstance(),
57 SLOT(modelAboutToBeDeleted(Model *))); 57 SLOT(modelAboutToBeDeleted(Model *)));
58
59 connect(m_align, SIGNAL(alignmentComplete(AlignmentModel *)),
60 this, SIGNAL(alignmentComplete(AlignmentModel *)));
58 } 61 }
59 62
60 Document::~Document() 63 Document::~Document()
61 { 64 {
62 //!!! Document should really own the command history. atm we 65 //!!! Document should really own the command history. atm we
1031 { 1034 {
1032 if (model == m_mainModel) return true; 1035 if (model == m_mainModel) return true;
1033 return (m_models.find(const_cast<Model *>(model)) != m_models.end()); 1036 return (m_models.find(const_cast<Model *>(model)) != m_models.end());
1034 } 1037 }
1035 1038
1036 TransformId
1037 Document::getAlignmentTransformName()
1038 {
1039 QSettings settings;
1040 settings.beginGroup("Alignment");
1041 TransformId id =
1042 settings.value("transform-id",
1043 "vamp:match-vamp-plugin:match:path").toString();
1044 settings.endGroup();
1045 return id;
1046 }
1047
1048 bool 1039 bool
1049 Document::canAlign() 1040 Document::canAlign()
1050 { 1041 {
1051 TransformId id = getAlignmentTransformName(); 1042 return Align::canAlign();
1052 TransformFactory *factory = TransformFactory::getInstance();
1053 return factory->haveTransform(id);
1054 } 1043 }
1055 1044
1056 void 1045 void
1057 Document::alignModel(Model *model) 1046 Document::alignModel(Model *model)
1058 { 1047 {