svgui
1.9
|
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 00002 00003 /* 00004 Sonic Visualiser 00005 An audio file viewer and annotation editor. 00006 Centre for Digital Music, Queen Mary, University of London. 00007 This file copyright 2006 Chris Cannam and QMUL. 00008 00009 This program is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU General Public License as 00011 published by the Free Software Foundation; either version 2 of the 00012 License, or (at your option) any later version. See the file 00013 COPYING included with this distribution for more information. 00014 */ 00015 00016 #ifndef _OVERVIEW_H_ 00017 #define _OVERVIEW_H_ 00018 00019 #include "View.h" 00020 00021 #include <QPoint> 00022 #include <QTime> 00023 00024 class QWidget; 00025 class QPaintEvent; 00026 class Layer; 00027 class View; 00028 00029 #include <map> 00030 00031 class Overview : public View 00032 { 00033 Q_OBJECT 00034 00035 public: 00036 Overview(QWidget *parent = 0); 00037 00038 void registerView(View *view); 00039 void unregisterView(View *view); 00040 00041 virtual QString getPropertyContainerIconName() const { return "panner"; } 00042 00043 public slots: 00044 virtual void modelChangedWithin(int startFrame, int endFrame); 00045 virtual void modelReplaced(); 00046 00047 virtual void globalCentreFrameChanged(int); 00048 virtual void viewCentreFrameChanged(View *, int); 00049 virtual void viewZoomLevelChanged(View *, int, bool); 00050 virtual void viewManagerPlaybackFrameChanged(int); 00051 00052 protected: 00053 virtual void paintEvent(QPaintEvent *e); 00054 virtual void mousePressEvent(QMouseEvent *e); 00055 virtual void mouseReleaseEvent(QMouseEvent *e); 00056 virtual void mouseMoveEvent(QMouseEvent *e); 00057 virtual void mouseDoubleClickEvent(QMouseEvent *e); 00058 virtual void enterEvent(QEvent *); 00059 virtual void leaveEvent(QEvent *); 00060 virtual bool shouldLabelSelections() const { return false; } 00061 00062 QPoint m_clickPos; 00063 QPoint m_mousePos; 00064 bool m_clickedInRange; 00065 int m_dragCentreFrame; 00066 QTime m_modelTestTime; 00067 00068 typedef std::set<View *> ViewSet; 00069 ViewSet m_views; 00070 }; 00071 00072 #endif 00073