comparison 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
comparison
equal deleted inserted replaced
589:7ebd5a21d74f 590:241929c5d57c
245 * double-click). If there is no item or editing is not 245 * double-click). If there is no item or editing is not
246 * supported, return false. 246 * supported, return false.
247 */ 247 */
248 virtual bool editOpen(View *, QMouseEvent *) { return false; } 248 virtual bool editOpen(View *, QMouseEvent *) { return false; }
249 249
250 /**
251 * A click occurred over the layer's scale area. If the layer has
252 * a response to this (e.g. play a note corresponding to frequency
253 * scale), perform it and return true. Return false if this click
254 * is not meaningful to the layer.
255 */
256 virtual bool scaleClicked(const View *, QMouseEvent *) { return false; }
257
250 virtual void moveSelection(Selection, size_t /* newStartFrame */) { } 258 virtual void moveSelection(Selection, size_t /* newStartFrame */) { }
251 virtual void resizeSelection(Selection, Selection /* newSize */) { } 259 virtual void resizeSelection(Selection, Selection /* newSize */) { }
252 virtual void deleteSelection(Selection) { } 260 virtual void deleteSelection(Selection) { }
253 261
254 virtual void copy(View *, Selection, Clipboard & /* to */) { } 262 virtual void copy(View *, Selection, Clipboard & /* to */) { }
509 * returned value is allocated on the heap and will be deleted by 517 * returned value is allocated on the heap and will be deleted by
510 * the caller. 518 * the caller.
511 */ 519 */
512 virtual RangeMapper *getNewVerticalZoomRangeMapper() const { return 0; } 520 virtual RangeMapper *getNewVerticalZoomRangeMapper() const { return 0; }
513 521
514 //function to override in Layer subclasses in order to handle mouse events
515 //within the layer (e.g. audio feedback when clicking on the piano keyboard notes
516 //in SpectrogramLayer and SpectrumLayer)
517 virtual void processMouseEvent(const View *, QMouseEvent *, int) {}
518
519 public slots: 522 public slots:
520 void showLayer(View *, bool show); 523 void showLayer(View *, bool show);
521 524
522 signals: 525 signals:
523 void modelChanged(); 526 void modelChanged();