comparison view/Panner.h @ 127:89c625dda204

* Reorganising code base. This revision will not compile.
author Chris Cannam
date Mon, 31 Jul 2006 11:44:37 +0000
parents
children 33929e0c3c6b
comparison
equal deleted inserted replaced
126:0e95c127bb53 127:89c625dda204
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.
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 _PAN_WIDGET_H_
17 #define _PAN_WIDGET_H_
18
19 #include "base/View.h"
20
21 #include <QPoint>
22
23 class QWidget;
24 class QPaintEvent;
25 class Layer;
26 class View;
27
28 #include <map>
29
30 class Panner : public View
31 {
32 Q_OBJECT
33
34 public:
35 Panner(QWidget *parent = 0);
36
37 void registerView(View *widget);
38 void unregisterView(View *widget);
39
40 virtual QString getPropertyContainerIconName() const { return "panner"; }
41
42 public slots:
43 virtual void modelChanged(size_t startFrame, size_t endFrame);
44 virtual void modelReplaced();
45
46 virtual void viewManagerCentreFrameChanged(void *, unsigned long, bool);
47 virtual void viewManagerZoomLevelChanged(void *, unsigned long, bool);
48 virtual void viewManagerPlaybackFrameChanged(unsigned long);
49
50 protected:
51 virtual void paintEvent(QPaintEvent *e);
52 virtual void mousePressEvent(QMouseEvent *e);
53 virtual void mouseReleaseEvent(QMouseEvent *e);
54 virtual void mouseMoveEvent(QMouseEvent *e);
55 virtual bool shouldLabelSelections() const { return false; }
56
57 QPoint m_clickPos;
58 QPoint m_mousePos;
59 bool m_clickedInRange;
60 size_t m_dragCentreFrame;
61
62 typedef std::set<void *> WidgetSet;
63 WidgetSet m_widgets;
64 };
65
66 #endif
67