Mercurial > hg > svcore
comparison base/ViewManager.h @ 8:214054a0d8b8
* Hook up tool selection buttons to switch the cursor mode
* Implement simple and multi-selection, snapping to the resolution
of the current layer. You can't actually do anything with a selection yet
author | Chris Cannam |
---|---|
date | Mon, 23 Jan 2006 17:02:57 +0000 |
parents | d86891498eef |
children | 73d85d19919f |
comparison
equal
deleted
inserted
replaced
7:49a95b174050 | 8:214054a0d8b8 |
---|---|
12 | 12 |
13 #include <QObject> | 13 #include <QObject> |
14 #include <QTimer> | 14 #include <QTimer> |
15 | 15 |
16 #include <map> | 16 #include <map> |
17 #include <set> | |
18 | |
19 #include "Selection.h" | |
17 | 20 |
18 class AudioPlaySource; | 21 class AudioPlaySource; |
19 class PlayParameters; | 22 class PlayParameters; |
20 class Model; | 23 class Model; |
21 | 24 |
40 | 43 |
41 //!!! No way to remove a model! | 44 //!!! No way to remove a model! |
42 PlayParameters *getPlayParameters(const Model *model); | 45 PlayParameters *getPlayParameters(const Model *model); |
43 void clearPlayParameters(); | 46 void clearPlayParameters(); |
44 | 47 |
48 bool isPlaying() const; | |
49 | |
45 unsigned long getGlobalCentreFrame() const; | 50 unsigned long getGlobalCentreFrame() const; |
46 unsigned long getGlobalZoom() const; | 51 unsigned long getGlobalZoom() const; |
52 | |
53 typedef std::set<Selection> SelectionList; | |
54 | |
55 bool haveInProgressSelection() const; | |
56 const Selection &getInProgressSelection(bool &exclusive) const; | |
57 void setInProgressSelection(const Selection &selection, bool exclusive); | |
58 void clearInProgressSelection(); | |
59 | |
60 const SelectionList &getSelections() const; | |
61 void setSelection(const Selection &selection); | |
62 void addSelection(const Selection &selection); | |
63 void removeSelection(const Selection &selection); | |
64 void clearSelections(); | |
65 | |
66 enum ToolMode { | |
67 NavigateMode, | |
68 SelectMode, | |
69 EditMode, | |
70 DrawMode, | |
71 TextMode | |
72 }; | |
73 ToolMode getToolMode() const { return m_toolMode; } | |
74 void setToolMode(ToolMode mode); | |
47 | 75 |
48 signals: | 76 signals: |
49 /** Emitted when a widget pans. The originator identifies the widget. */ | 77 /** Emitted when a widget pans. The originator identifies the widget. */ |
50 void centreFrameChanged(void *originator, unsigned long frame, bool locked); | 78 void centreFrameChanged(void *originator, unsigned long frame, bool locked); |
51 | 79 |
56 void playbackFrameChanged(unsigned long frame); | 84 void playbackFrameChanged(unsigned long frame); |
57 | 85 |
58 /** Emitted when the output levels change. Values in range 0.0 -> 1.0. */ | 86 /** Emitted when the output levels change. Values in range 0.0 -> 1.0. */ |
59 void outputLevelsChanged(float left, float right); | 87 void outputLevelsChanged(float left, float right); |
60 | 88 |
89 /** Emitted when the selection has changed. */ | |
90 void selectionChanged(); | |
91 | |
92 /** Emitted when the tool mode has been changed. */ | |
93 void toolModeChanged(); | |
94 | |
61 protected slots: | 95 protected slots: |
62 void checkPlayStatus(); | 96 void checkPlayStatus(); |
63 void considerSeek(void *, unsigned long, bool); | 97 void considerSeek(void *, unsigned long, bool); |
64 void considerZoomChange(void *, unsigned long, bool); | 98 void considerZoomChange(void *, unsigned long, bool); |
65 | 99 |
69 unsigned long m_globalZoom; | 103 unsigned long m_globalZoom; |
70 | 104 |
71 float m_lastLeft; | 105 float m_lastLeft; |
72 float m_lastRight; | 106 float m_lastRight; |
73 | 107 |
108 SelectionList m_selections; | |
109 Selection m_inProgressSelection; | |
110 bool m_inProgressExclusive; | |
111 | |
112 ToolMode m_toolMode; | |
113 | |
74 std::map<const Model *, PlayParameters *> m_playParameters; | 114 std::map<const Model *, PlayParameters *> m_playParameters; |
75 }; | 115 }; |
76 | 116 |
77 #endif | 117 #endif |
78 | 118 |