Mercurial > hg > svgui
comparison widgets/Panner.h @ 0:2a4f26e85b4c
initial import
| author | Chris Cannam |
|---|---|
| date | Tue, 10 Jan 2006 16:33:16 +0000 |
| parents | |
| children | 37b110168acf |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:2a4f26e85b4c |
|---|---|
| 1 /* -*- c-basic-offset: 4 -*- vi:set ts=8 sts=4 sw=4: */ | |
| 2 | |
| 3 /* | |
| 4 A waveform viewer and audio annotation editor. | |
| 5 Chris Cannam, Queen Mary University of London, 2005 | |
| 6 | |
| 7 This is experimental software. Not for distribution. | |
| 8 */ | |
| 9 | |
| 10 #ifndef _PAN_WIDGET_H_ | |
| 11 #define _PAN_WIDGET_H_ | |
| 12 | |
| 13 #include "base/View.h" | |
| 14 | |
| 15 #include <QPoint> | |
| 16 | |
| 17 class QWidget; | |
| 18 class QPaintEvent; | |
| 19 class Layer; | |
| 20 class View; | |
| 21 | |
| 22 #include <map> | |
| 23 | |
| 24 class Panner : public View | |
| 25 { | |
| 26 Q_OBJECT | |
| 27 | |
| 28 public: | |
| 29 Panner(QWidget *parent = 0); | |
| 30 | |
| 31 void registerView(View *widget); | |
| 32 void unregisterView(View *widget); | |
| 33 | |
| 34 virtual QString getPropertyContainerIconName() const { return "panner"; } | |
| 35 | |
| 36 public slots: | |
| 37 virtual void modelChanged(size_t startFrame, size_t endFrame); | |
| 38 virtual void modelReplaced(); | |
| 39 | |
| 40 virtual void viewManagerCentreFrameChanged(void *, unsigned long, bool); | |
| 41 virtual void viewManagerZoomLevelChanged(void *, unsigned long, bool); | |
| 42 virtual void viewManagerPlaybackFrameChanged(unsigned long); | |
| 43 | |
| 44 protected: | |
| 45 virtual void paintEvent(QPaintEvent *e); | |
| 46 virtual void mousePressEvent(QMouseEvent *e); | |
| 47 virtual void mouseReleaseEvent(QMouseEvent *e); | |
| 48 virtual void mouseMoveEvent(QMouseEvent *e); | |
| 49 | |
| 50 QPoint m_clickPos; | |
| 51 QPoint m_mousePos; | |
| 52 bool m_clickedInRange; | |
| 53 size_t m_dragCentreFrame; | |
| 54 | |
| 55 typedef std::pair<size_t, int> WidgetRec; // centre, zoom (-1 = invalid) | |
| 56 typedef std::map<void *, WidgetRec> WidgetMap; | |
| 57 WidgetMap m_widgets; | |
| 58 }; | |
| 59 | |
| 60 #endif | |
| 61 |
