Mercurial > hg > svgui
comparison view/ViewManager.h @ 771:a964151832a7
Merge from branch tony_integration
author | Chris Cannam |
---|---|
date | Wed, 14 May 2014 09:54:34 +0100 |
parents | b75c95e7f906 |
children | 4c8ca536b54f |
comparison
equal
deleted
inserted
replaced
768:8b614632568c | 771:a964151832a7 |
---|---|
84 void removeSelection(const Selection &selection); | 84 void removeSelection(const Selection &selection); |
85 void clearSelections(); | 85 void clearSelections(); |
86 size_t constrainFrameToSelection(size_t frame) const; | 86 size_t constrainFrameToSelection(size_t frame) const; |
87 | 87 |
88 /** | 88 /** |
89 * Adding a selection normally emits the selectionChangedByUser | |
90 * signal. Call this to add a selection without emitting that signal. | |
91 * This is used in session file load, for example. | |
92 */ | |
93 void addSelectionQuietly(const Selection &selection); | |
94 | |
95 /** | |
89 * Return the selection that contains a given frame. | 96 * Return the selection that contains a given frame. |
90 * If defaultToFollowing is true, and if the frame is not in a | 97 * If defaultToFollowing is true, and if the frame is not in a |
91 * selected area, return the next selection after the given frame. | 98 * selected area, return the next selection after the given frame. |
92 * Return the empty selection if no appropriate selection is found. | 99 * Return the empty selection if no appropriate selection is found. |
93 */ | 100 */ |
99 NavigateMode, | 106 NavigateMode, |
100 SelectMode, | 107 SelectMode, |
101 EditMode, | 108 EditMode, |
102 DrawMode, | 109 DrawMode, |
103 EraseMode, | 110 EraseMode, |
104 MeasureMode | 111 MeasureMode, |
112 NoteEditMode //GF: Tonioni: this tool mode will be context sensitive. | |
105 }; | 113 }; |
106 ToolMode getToolMode() const { return m_toolMode; } | 114 ToolMode getToolMode() const { return m_toolMode; } |
107 void setToolMode(ToolMode mode); | 115 void setToolMode(ToolMode mode); |
116 | |
117 /// Override the tool mode for a specific view | |
118 void setToolModeFor(const View *v, ToolMode mode); | |
119 /// Return override mode if it exists for this view or global mode otherwise | |
120 ToolMode getToolModeFor(const View *v) const; | |
121 /// Clear all current view-specific overrides | |
122 void clearToolModeOverrides(); | |
108 | 123 |
109 bool getPlayLoopMode() const { return m_playLoopMode; } | 124 bool getPlayLoopMode() const { return m_playLoopMode; } |
110 void setPlayLoopMode(bool on); | 125 void setPlayLoopMode(bool on); |
111 | 126 |
112 bool getPlaySelectionMode() const { return m_playSelectionMode; } | 127 bool getPlaySelectionMode() const { return m_playSelectionMode; } |
145 | 160 |
146 void setMainModelSampleRate(size_t sr) { m_mainModelSampleRate = sr; } | 161 void setMainModelSampleRate(size_t sr) { m_mainModelSampleRate = sr; } |
147 | 162 |
148 enum OverlayMode { | 163 enum OverlayMode { |
149 NoOverlays, | 164 NoOverlays, |
150 MinimalOverlays, | 165 GlobalOverlays, |
166 StandardOverlays, | |
151 AllOverlays | 167 AllOverlays |
152 }; | 168 }; |
153 void setOverlayMode(OverlayMode mode); | 169 void setOverlayMode(OverlayMode mode); |
154 OverlayMode getOverlayMode() const { return m_overlayMode; } | 170 OverlayMode getOverlayMode() const { return m_overlayMode; } |
155 | 171 |
167 } | 183 } |
168 bool shouldShowVerticalColourScale() const { | 184 bool shouldShowVerticalColourScale() const { |
169 return m_overlayMode == AllOverlays; | 185 return m_overlayMode == AllOverlays; |
170 } | 186 } |
171 bool shouldShowSelectionExtents() const { | 187 bool shouldShowSelectionExtents() const { |
172 return m_overlayMode != NoOverlays; | 188 return m_overlayMode != NoOverlays && m_overlayMode != GlobalOverlays; |
173 } | 189 } |
174 bool shouldShowLayerNames() const { | 190 bool shouldShowLayerNames() const { |
175 return m_overlayMode == AllOverlays; | 191 return m_overlayMode == AllOverlays; |
176 } | 192 } |
177 bool shouldShowScaleGuides() const { | 193 bool shouldShowScaleGuides() const { |
180 bool shouldShowWorkTitle() const { | 196 bool shouldShowWorkTitle() const { |
181 return m_showWorkTitle; | 197 return m_showWorkTitle; |
182 } | 198 } |
183 bool shouldIlluminateLocalFeatures() const { | 199 bool shouldIlluminateLocalFeatures() const { |
184 return m_illuminateLocalFeatures; | 200 return m_illuminateLocalFeatures; |
201 } | |
202 bool shouldShowFeatureLabels() const { | |
203 return m_overlayMode != NoOverlays && m_overlayMode != GlobalOverlays; | |
185 } | 204 } |
186 | 205 |
187 void setZoomWheelsEnabled(bool enable); | 206 void setZoomWheelsEnabled(bool enable); |
188 bool getZoomWheelsEnabled() const { return m_zoomWheelsEnabled; } | 207 bool getZoomWheelsEnabled() const { return m_zoomWheelsEnabled; } |
189 | 208 |
204 void playbackFrameChanged(unsigned long frame); | 223 void playbackFrameChanged(unsigned long frame); |
205 | 224 |
206 /** Emitted when the output levels change. Values in range 0.0 -> 1.0. */ | 225 /** Emitted when the output levels change. Values in range 0.0 -> 1.0. */ |
207 void outputLevelsChanged(float left, float right); | 226 void outputLevelsChanged(float left, float right); |
208 | 227 |
209 /** Emitted when the selection has changed. */ | 228 /** Emitted whenever the selection has changed. */ |
210 void selectionChanged(); | 229 void selectionChanged(); |
230 | |
231 /** Emitted when the selection has been changed through an | |
232 * explicit selection-editing action. *Not* emitted when the | |
233 * selection has been changed through undo or redo. */ | |
234 void selectionChangedByUser(); | |
211 | 235 |
212 /** Emitted when the in-progress (rubberbanding) selection has changed. */ | 236 /** Emitted when the in-progress (rubberbanding) selection has changed. */ |
213 void inProgressSelectionChanged(); | 237 void inProgressSelectionChanged(); |
214 | 238 |
215 /** Emitted when the tool mode has been changed. */ | 239 /** Emitted when the tool mode has been changed. */ |
271 bool m_inProgressExclusive; | 295 bool m_inProgressExclusive; |
272 | 296 |
273 Clipboard m_clipboard; | 297 Clipboard m_clipboard; |
274 | 298 |
275 ToolMode m_toolMode; | 299 ToolMode m_toolMode; |
300 std::map<const View *, ToolMode> m_toolModeOverrides; | |
276 | 301 |
277 bool m_playLoopMode; | 302 bool m_playLoopMode; |
278 bool m_playSelectionMode; | 303 bool m_playSelectionMode; |
279 bool m_playSoloMode; | 304 bool m_playSoloMode; |
280 bool m_alignMode; | 305 bool m_alignMode; |
281 | 306 |
282 void setSelections(const MultiSelection &ms); | 307 void setSelections(const MultiSelection &ms, bool quietly = false); |
283 void signalSelectionChange(); | 308 void signalSelectionChange(); |
284 | 309 |
285 class SetSelectionCommand : public Command | 310 class SetSelectionCommand : public Command |
286 { | 311 { |
287 public: | 312 public: |