Chris@58: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@0: Chris@0: /* Chris@59: Sonic Visualiser Chris@59: An audio file viewer and annotation editor. Chris@59: Centre for Digital Music, Queen Mary, University of London. Chris@59: This file copyright 2006 Chris Cannam. Chris@0: Chris@59: This program is free software; you can redistribute it and/or Chris@59: modify it under the terms of the GNU General Public License as Chris@59: published by the Free Software Foundation; either version 2 of the Chris@59: License, or (at your option) any later version. See the file Chris@59: COPYING included with this distribution for more information. Chris@0: */ Chris@0: Chris@0: #ifndef _PAN_WIDGET_H_ Chris@0: #define _PAN_WIDGET_H_ Chris@0: Chris@0: #include "base/View.h" Chris@0: Chris@0: #include Chris@0: Chris@0: class QWidget; Chris@0: class QPaintEvent; Chris@0: class Layer; Chris@0: class View; Chris@0: Chris@0: #include Chris@0: Chris@0: class Panner : public View Chris@0: { Chris@0: Q_OBJECT Chris@0: Chris@0: public: Chris@0: Panner(QWidget *parent = 0); Chris@0: Chris@0: void registerView(View *widget); Chris@0: void unregisterView(View *widget); Chris@0: Chris@0: virtual QString getPropertyContainerIconName() const { return "panner"; } Chris@0: Chris@0: public slots: Chris@0: virtual void modelChanged(size_t startFrame, size_t endFrame); Chris@0: virtual void modelReplaced(); Chris@0: Chris@0: virtual void viewManagerCentreFrameChanged(void *, unsigned long, bool); Chris@0: virtual void viewManagerZoomLevelChanged(void *, unsigned long, bool); Chris@0: virtual void viewManagerPlaybackFrameChanged(unsigned long); Chris@0: Chris@0: protected: Chris@0: virtual void paintEvent(QPaintEvent *e); Chris@0: virtual void mousePressEvent(QMouseEvent *e); Chris@0: virtual void mouseReleaseEvent(QMouseEvent *e); Chris@0: virtual void mouseMoveEvent(QMouseEvent *e); Chris@15: virtual bool shouldLabelSelections() const { return false; } Chris@0: Chris@0: QPoint m_clickPos; Chris@0: QPoint m_mousePos; Chris@0: bool m_clickedInRange; Chris@0: size_t m_dragCentreFrame; Chris@0: Chris@27: typedef std::set WidgetSet; Chris@27: WidgetSet m_widgets; Chris@0: }; Chris@0: Chris@0: #endif Chris@0: