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