Mercurial > hg > svgui
diff layer/Layer.h @ 590:241929c5d57c sonification
Check the scale width in the View (which has access to it); ask the layer to do something when the user clicks in the scale regardless of the edit mode, and continue with normal processing if the layer has nothing interesting to do
author | Chris Cannam |
---|---|
date | Fri, 24 Jun 2011 14:27:32 +0100 |
parents | 7ebd5a21d74f |
children | a13aa5320221 |
line wrap: on
line diff
--- a/layer/Layer.h Wed Jun 22 00:04:21 2011 +0100 +++ b/layer/Layer.h Fri Jun 24 14:27:32 2011 +0100 @@ -247,6 +247,14 @@ */ virtual bool editOpen(View *, QMouseEvent *) { return false; } + /** + * A click occurred over the layer's scale area. If the layer has + * a response to this (e.g. play a note corresponding to frequency + * scale), perform it and return true. Return false if this click + * is not meaningful to the layer. + */ + virtual bool scaleClicked(const View *, QMouseEvent *) { return false; } + virtual void moveSelection(Selection, size_t /* newStartFrame */) { } virtual void resizeSelection(Selection, Selection /* newSize */) { } virtual void deleteSelection(Selection) { } @@ -511,11 +519,6 @@ */ virtual RangeMapper *getNewVerticalZoomRangeMapper() const { return 0; } - //function to override in Layer subclasses in order to handle mouse events - //within the layer (e.g. audio feedback when clicking on the piano keyboard notes - //in SpectrogramLayer and SpectrumLayer) - virtual void processMouseEvent(const View *, QMouseEvent *, int) {} - public slots: void showLayer(View *, bool show);