# HG changeset patch # User Chris Cannam # Date 1138727985 0 # Node ID 4563a72c1d8b951a202c022b36b60b29fa840646 # Parent 2fb933f88604d57b15ffac56fe8e8f1dfe131707 * Add Zero Crossings output from zc plugin (as well as Zero Crossings Count) * Use brief friendly names for layers instead of full transform descriptions * Clearer command names for editing commands * Some efficiencies in drawing dense points in TimeInstantLayer diff -r 2fb933f88604 -r 4563a72c1d8b base/Layer.h --- a/base/Layer.h Tue Jan 31 15:57:25 2006 +0000 +++ b/base/Layer.h Tue Jan 31 17:19:45 2006 +0000 @@ -138,6 +138,14 @@ virtual bool isLayerOpaque() const { return false; } /** + * This should return true if the layer can be edited by the user. + * If this is the case, the appropriate edit tools may be made + * available by the application and the layer's drawStart/Drag/End + * and editStart/Drag/End methods should be implemented. + */ + virtual bool isLayerEditable() const { return false; } + + /** * Return the proportion of background work complete in drawing * this view, as a percentage -- in most cases this will be the * value returned by pointer from a call to the underlying model's diff -r 2fb933f88604 -r 4563a72c1d8b base/View.cpp --- a/base/View.cpp Tue Jan 31 15:57:25 2006 +0000 +++ b/base/View.cpp Tue Jan 31 17:19:45 2006 +0000 @@ -23,7 +23,7 @@ #include #include -#define DEBUG_VIEW_WIDGET_PAINT 1 +//#define DEBUG_VIEW_WIDGET_PAINT 1 using std::cerr; using std::endl; @@ -512,9 +512,6 @@ if (m_playPointerFrame == f) return; bool visible = (getXForFrame(m_playPointerFrame) != getXForFrame(f)); - std::cerr << "old x = " << getXForFrame(m_playPointerFrame) - << ", new x = " << getXForFrame(f) - << ", visible = " << visible << std::endl; size_t oldPlayPointerFrame = m_playPointerFrame; m_playPointerFrame = f; if (!visible) return; @@ -559,6 +556,10 @@ int xnew = getXForFrame(m_playPointerFrame); +#ifdef DEBUG_VIEW_WIDGET_PAINT + std::cerr << "xnew = " << xnew << ", width = " << width() << std::endl; +#endif + if (xnew < width()/8 || xnew > (width()*7)/8) { if (QApplication::mouseButtons() == Qt::NoButton && QApplication::keyboardModifiers() == Qt::NoModifier) { diff -r 2fb933f88604 -r 4563a72c1d8b base/ViewManager.cpp --- a/base/ViewManager.cpp Tue Jan 31 15:57:25 2006 +0000 +++ b/base/ViewManager.cpp Tue Jan 31 17:19:45 2006 +0000 @@ -14,7 +14,7 @@ #include -#define DEBUG_VIEW_MANAGER 1 +//#define DEBUG_VIEW_MANAGER 1 ViewManager::ViewManager() : m_playSource(0), diff -r 2fb933f88604 -r 4563a72c1d8b transform/TransformFactory.cpp --- a/transform/TransformFactory.cpp Tue Jan 31 15:57:25 2006 +0000 +++ b/transform/TransformFactory.cpp Tue Jan 31 17:19:45 2006 +0000 @@ -99,6 +99,19 @@ } else return ""; } +QString +TransformFactory::getTransformFriendlyName(TransformName name) +{ + QString description = getTransformDescription(name); + + int i = description.indexOf(':'); + if (i >= 0) { + return description.remove(0, i + 2); + } else { + return description; + } +} + Transform * TransformFactory::createTransform(TransformName name, Model *inputModel) { diff -r 2fb933f88604 -r 4563a72c1d8b transform/TransformFactory.h --- a/transform/TransformFactory.h Tue Jan 31 15:57:25 2006 +0000 +++ b/transform/TransformFactory.h Tue Jan 31 17:19:45 2006 +0000 @@ -52,8 +52,17 @@ */ Model *transform(TransformName name, Model *inputModel); + /** + * Full description of a transform, suitable for putting on a menu. + */ QString getTransformDescription(TransformName name); + /** + * Brief but friendly description of a transform, suitable for use + * as the name of the output layer. + */ + QString getTransformFriendlyName(TransformName name); + //!!! Need some way to indicate that the input model has changed / //been deleted so as not to blow up backgrounded transform! -- Or //indeed, if the output model has been deleted -- could equally