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@274: #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@908: virtual void modelChangedWithin(sv_frame_t startFrame, sv_frame_t endFrame); Chris@173: virtual void modelReplaced(); Chris@173: Chris@908: virtual void globalCentreFrameChanged(sv_frame_t); Chris@908: virtual void viewCentreFrameChanged(View *, sv_frame_t); Chris@806: virtual void viewZoomLevelChanged(View *, int, bool); Chris@908: virtual void viewManagerPlaybackFrameChanged(sv_frame_t); 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@871: QColor getFillWithin() const; Chris@871: QColor getFillWithout() const; Chris@871: Chris@173: QPoint m_clickPos; Chris@173: QPoint m_mousePos; Chris@173: bool m_clickedInRange; Chris@908: sv_frame_t m_dragCentreFrame; Chris@274: QTime m_modelTestTime; Chris@173: Chris@211: typedef std::set ViewSet; Chris@211: ViewSet m_views; Chris@173: }; Chris@173: Chris@173: #endif Chris@173: