# HG changeset patch # User Chris Cannam # Date 1193932921 0 # Node ID a8bb5b2aca4c9b392912e8b1f573c3cfb9705eb0 # Parent 73f682a551dca7738377414b03312ba6931b58f2 * Fix availability of alignment button and relative align/solo button state diff -r 73f682a551dc -r a8bb5b2aca4c framework/Document.cpp --- a/framework/Document.cpp Thu Nov 01 10:45:28 2007 +0000 +++ b/framework/Document.cpp Thu Nov 01 16:02:01 2007 +0000 @@ -670,6 +670,14 @@ return models; } +bool +Document::canAlign() const +{ + TransformId id = "vamp:match-vamp-plugin:match:path"; + TransformFactory *factory = TransformFactory::getInstance(); + return factory->haveTransform(id); +} + void Document::alignModel(Model *model) { diff -r 73f682a551dc -r a8bb5b2aca4c framework/Document.h --- a/framework/Document.h Thu Nov 01 10:45:28 2007 +0000 +++ b/framework/Document.h Thu Nov 01 16:02:01 2007 +0000 @@ -190,6 +190,12 @@ void removeLayerFromView(View *, Layer *); /** + * Return true if alignment is supported (i.e. if the necessary + * plugin is found). + */ + bool canAlign() const; + + /** * Specify whether models added via addImportedModel should be * automatically aligned against the main model if appropriate. */