comparison view/ViewManager.cpp @ 271:1a49bd0d8375

* Change a number of keyboard shortcuts -- get rid of all the Alt+ shortcuts and introduce a few more Ctrl+ ones instead, as well as a number of plain single keypresses * Add Playback menu * Add time-ruler support for snap to feature, use it in ffwd/rewind (rewind still needs fixing) * restore layer hierarchy window prior to making it work correctly
author Chris Cannam
date Thu, 28 Jun 2007 14:50:58 +0000
parents 28c8e8e3c537
children 24fc90078754
comparison
equal deleted inserted replaced
270:61a704654497 271:1a49bd0d8375
186 if (m_selections.getSelections() == ms.getSelections()) return; 186 if (m_selections.getSelections() == ms.getSelections()) return;
187 SetSelectionCommand *command = new SetSelectionCommand(this, ms); 187 SetSelectionCommand *command = new SetSelectionCommand(this, ms);
188 CommandHistory::getInstance()->addCommand(command); 188 CommandHistory::getInstance()->addCommand(command);
189 } 189 }
190 190
191 size_t
192 ViewManager::constrainFrameToSelection(size_t frame) const
193 {
194 MultiSelection::SelectionList sl = getSelections();
195 if (sl.empty()) return frame;
196
197 size_t selectionStartFrame = sl.begin()->getStartFrame();
198 if (frame < selectionStartFrame) {
199 frame = selectionStartFrame;
200 return frame;
201 }
202
203 MultiSelection::SelectionList::iterator i = sl.end();
204 --i;
205 size_t selectionEndFrame = i->getEndFrame();
206 if (frame > selectionEndFrame) frame = selectionEndFrame;
207
208 return frame;
209 }
210
191 void 211 void
192 ViewManager::signalSelectionChange() 212 ViewManager::signalSelectionChange()
193 { 213 {
194 emit selectionChanged(); 214 emit selectionChanged();
195 } 215 }