svgui  1.9
Overview.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  Sonic Visualiser
5  An audio file viewer and annotation editor.
6  Centre for Digital Music, Queen Mary, University of London.
7  This file copyright 2006 Chris Cannam and QMUL.
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of the
12  License, or (at your option) any later version. See the file
13  COPYING included with this distribution for more information.
14 */
15 
16 #ifndef _OVERVIEW_H_
17 #define _OVERVIEW_H_
18 
19 #include "View.h"
20 
21 #include <QPoint>
22 #include <QTime>
23 
24 class QWidget;
25 class QPaintEvent;
26 class Layer;
27 class View;
28 
29 #include <map>
30 
31 class Overview : public View
32 {
33  Q_OBJECT
34 
35 public:
36  Overview(QWidget *parent = 0);
37 
38  void registerView(View *view);
39  void unregisterView(View *view);
40 
41  virtual QString getPropertyContainerIconName() const { return "panner"; }
42 
43 public slots:
44  virtual void modelChangedWithin(int startFrame, int endFrame);
45  virtual void modelReplaced();
46 
47  virtual void globalCentreFrameChanged(int);
48  virtual void viewCentreFrameChanged(View *, int);
49  virtual void viewZoomLevelChanged(View *, int, bool);
50  virtual void viewManagerPlaybackFrameChanged(int);
51 
52 protected:
53  virtual void paintEvent(QPaintEvent *e);
54  virtual void mousePressEvent(QMouseEvent *e);
55  virtual void mouseReleaseEvent(QMouseEvent *e);
56  virtual void mouseMoveEvent(QMouseEvent *e);
57  virtual void mouseDoubleClickEvent(QMouseEvent *e);
58  virtual void enterEvent(QEvent *);
59  virtual void leaveEvent(QEvent *);
60  virtual bool shouldLabelSelections() const { return false; }
61 
62  QPoint m_clickPos;
63  QPoint m_mousePos;
67 
68  typedef std::set<View *> ViewSet;
70 };
71 
72 #endif
73 
The base class for visual representations of the data found in a Model.
Definition: Layer.h:52
virtual void modelReplaced()
Definition: Overview.cpp:73
virtual void viewCentreFrameChanged(View *, int)
Definition: Overview.cpp:107
virtual void mouseMoveEvent(QMouseEvent *e)
Definition: Overview.cpp:263
virtual void viewManagerPlaybackFrameChanged(int)
Definition: Overview.cpp:131
virtual void enterEvent(QEvent *)
Definition: Overview.cpp:313
ViewSet m_views
Definition: Overview.h:69
QPoint m_clickPos
Definition: Overview.h:62
virtual void globalCentreFrameChanged(int)
Definition: Overview.cpp:94
virtual QString getPropertyContainerIconName() const
Definition: Overview.h:41
int m_dragCentreFrame
Definition: Overview.h:65
virtual void paintEvent(QPaintEvent *e)
Definition: Overview.cpp:148
std::set< View * > ViewSet
Definition: Overview.h:68
bool m_clickedInRange
Definition: Overview.h:64
QTime m_modelTestTime
Definition: Overview.h:66
virtual void mouseReleaseEvent(QMouseEvent *e)
Definition: Overview.cpp:254
Overview(QWidget *parent=0)
Definition: Overview.cpp:28
virtual void leaveEvent(QEvent *)
Definition: Overview.cpp:319
void unregisterView(View *view)
Definition: Overview.cpp:87
virtual void modelChangedWithin(int startFrame, int endFrame)
Definition: Overview.cpp:41
View is the base class of widgets that display one or more overlaid views of data against a horizonta...
Definition: View.h:50
virtual void mousePressEvent(QMouseEvent *e)
Definition: Overview.cpp:237
void registerView(View *view)
Definition: Overview.cpp:80
QPoint m_mousePos
Definition: Overview.h:63
virtual bool shouldLabelSelections() const
Definition: Overview.h:60
virtual void mouseDoubleClickEvent(QMouseEvent *e)
Definition: Overview.cpp:300
virtual void viewZoomLevelChanged(View *, int, bool)
Definition: Overview.cpp:122