Mercurial > hg > svcore
comparison base/ViewManager.h @ 9:73d85d19919f
* Add play-selection and looping modes. Looping seems to work OK, but
the plain play-selection is miscalculating current frame number to
feed back to the GUI.
* Cache selection rectanges wherever possible in View::paintEvent.
author | Chris Cannam |
---|---|
date | Tue, 24 Jan 2006 16:20:58 +0000 |
parents | 214054a0d8b8 |
children | ec6886f0e673 |
comparison
equal
deleted
inserted
replaced
8:214054a0d8b8 | 9:73d85d19919f |
---|---|
61 void setSelection(const Selection &selection); | 61 void setSelection(const Selection &selection); |
62 void addSelection(const Selection &selection); | 62 void addSelection(const Selection &selection); |
63 void removeSelection(const Selection &selection); | 63 void removeSelection(const Selection &selection); |
64 void clearSelections(); | 64 void clearSelections(); |
65 | 65 |
66 /** | |
67 * Return the selection that contains a given frame. | |
68 * If defaultToFollowing is true, and if the frame is not in a | |
69 * selected area, return the next selection after the given frame. | |
70 * Return the empty selection if no appropriate selection is found. | |
71 */ | |
72 Selection getContainingSelection(size_t frame, bool defaultToFollowing); | |
73 | |
66 enum ToolMode { | 74 enum ToolMode { |
67 NavigateMode, | 75 NavigateMode, |
68 SelectMode, | 76 SelectMode, |
69 EditMode, | 77 EditMode, |
70 DrawMode, | 78 DrawMode, |
71 TextMode | 79 TextMode |
72 }; | 80 }; |
73 ToolMode getToolMode() const { return m_toolMode; } | 81 ToolMode getToolMode() const { return m_toolMode; } |
74 void setToolMode(ToolMode mode); | 82 void setToolMode(ToolMode mode); |
83 | |
84 bool getPlayLoopMode() const { return m_playLoopMode; } | |
85 void setPlayLoopMode(bool on); | |
86 | |
87 bool getPlaySelectionMode() const { return m_playSelectionMode; } | |
88 void setPlaySelectionMode(bool on); | |
75 | 89 |
76 signals: | 90 signals: |
77 /** Emitted when a widget pans. The originator identifies the widget. */ | 91 /** Emitted when a widget pans. The originator identifies the widget. */ |
78 void centreFrameChanged(void *originator, unsigned long frame, bool locked); | 92 void centreFrameChanged(void *originator, unsigned long frame, bool locked); |
79 | 93 |
87 void outputLevelsChanged(float left, float right); | 101 void outputLevelsChanged(float left, float right); |
88 | 102 |
89 /** Emitted when the selection has changed. */ | 103 /** Emitted when the selection has changed. */ |
90 void selectionChanged(); | 104 void selectionChanged(); |
91 | 105 |
106 /** Emitted when the in-progress (rubberbanding) selection has changed. */ | |
107 void inProgressSelectionChanged(); | |
108 | |
92 /** Emitted when the tool mode has been changed. */ | 109 /** Emitted when the tool mode has been changed. */ |
93 void toolModeChanged(); | 110 void toolModeChanged(); |
111 | |
112 /** Emitted when the play loop mode has been changed. */ | |
113 void playLoopModeChanged(); | |
114 | |
115 /** Emitted when the play selection mode has been changed. */ | |
116 void playSelectionModeChanged(); | |
94 | 117 |
95 protected slots: | 118 protected slots: |
96 void checkPlayStatus(); | 119 void checkPlayStatus(); |
97 void considerSeek(void *, unsigned long, bool); | 120 void considerSeek(void *, unsigned long, bool); |
98 void considerZoomChange(void *, unsigned long, bool); | 121 void considerZoomChange(void *, unsigned long, bool); |
109 Selection m_inProgressSelection; | 132 Selection m_inProgressSelection; |
110 bool m_inProgressExclusive; | 133 bool m_inProgressExclusive; |
111 | 134 |
112 ToolMode m_toolMode; | 135 ToolMode m_toolMode; |
113 | 136 |
137 bool m_playLoopMode; | |
138 bool m_playSelectionMode; | |
139 | |
114 std::map<const Model *, PlayParameters *> m_playParameters; | 140 std::map<const Model *, PlayParameters *> m_playParameters; |
115 }; | 141 }; |
116 | 142 |
117 #endif | 143 #endif |
118 | 144 |