comparison view/ViewManager.cpp @ 806:4c8ca536b54f warnfix_no_size_t

Some more unsigned/long removal
author Chris Cannam
date Tue, 17 Jun 2014 15:36:56 +0100
parents b75c95e7f906
children 40c6c9344ff6
comparison
equal deleted inserted replaced
805:1d526ba11a24 806:4c8ca536b54f
123 123
124 ViewManager::~ViewManager() 124 ViewManager::~ViewManager()
125 { 125 {
126 } 126 }
127 127
128 unsigned long 128 int
129 ViewManager::getGlobalCentreFrame() const 129 ViewManager::getGlobalCentreFrame() const
130 { 130 {
131 #ifdef DEBUG_VIEW_MANAGER 131 #ifdef DEBUG_VIEW_MANAGER
132 cerr << "ViewManager::getGlobalCentreFrame: returning " << m_globalCentreFrame << endl; 132 cerr << "ViewManager::getGlobalCentreFrame: returning " << m_globalCentreFrame << endl;
133 #endif 133 #endif
134 return m_globalCentreFrame; 134 return m_globalCentreFrame;
135 } 135 }
136 136
137 void 137 void
138 ViewManager::setGlobalCentreFrame(unsigned long f) 138 ViewManager::setGlobalCentreFrame(int f)
139 { 139 {
140 #ifdef DEBUG_VIEW_MANAGER 140 #ifdef DEBUG_VIEW_MANAGER
141 cerr << "ViewManager::setGlobalCentreFrame to " << f << endl; 141 cerr << "ViewManager::setGlobalCentreFrame to " << f << endl;
142 #endif 142 #endif
143 m_globalCentreFrame = f; 143 m_globalCentreFrame = f;
144 emit globalCentreFrameChanged(f); 144 emit globalCentreFrameChanged(f);
145 } 145 }
146 146
147 unsigned long 147 int
148 ViewManager::getGlobalZoom() const 148 ViewManager::getGlobalZoom() const
149 { 149 {
150 #ifdef DEBUG_VIEW_MANAGER 150 #ifdef DEBUG_VIEW_MANAGER
151 cerr << "ViewManager::getGlobalZoom: returning " << m_globalZoom << endl; 151 cerr << "ViewManager::getGlobalZoom: returning " << m_globalZoom << endl;
152 #endif 152 #endif
153 return m_globalZoom; 153 return m_globalZoom;
154 } 154 }
155 155
156 unsigned long 156 int
157 ViewManager::getPlaybackFrame() const 157 ViewManager::getPlaybackFrame() const
158 { 158 {
159 if (m_playSource && m_playSource->isPlaying()) { 159 if (m_playSource && m_playSource->isPlaying()) {
160 m_playbackFrame = m_playSource->getCurrentPlayingFrame(); 160 m_playbackFrame = m_playSource->getCurrentPlayingFrame();
161 } 161 }
162 return m_playbackFrame; 162 return m_playbackFrame;
163 } 163 }
164 164
165 void 165 void
166 ViewManager::setPlaybackFrame(unsigned long f) 166 ViewManager::setPlaybackFrame(int f)
167 { 167 {
168 if (m_playbackFrame != f) { 168 if (m_playbackFrame != f) {
169 m_playbackFrame = f; 169 m_playbackFrame = f;
170 emit playbackFrameChanged(f); 170 emit playbackFrameChanged(f);
171 if (m_playSource && m_playSource->isPlaying()) { 171 if (m_playSource && m_playSource->isPlaying()) {
184 ViewManager::setPlaybackModel(Model *model) 184 ViewManager::setPlaybackModel(Model *model)
185 { 185 {
186 m_playbackModel = model; 186 m_playbackModel = model;
187 } 187 }
188 188
189 size_t 189 int
190 ViewManager::alignPlaybackFrameToReference(size_t frame) const 190 ViewManager::alignPlaybackFrameToReference(int frame) const
191 { 191 {
192 if (!m_playbackModel) return frame; 192 if (!m_playbackModel) return frame;
193 else return m_playbackModel->alignToReference(frame); 193 else return m_playbackModel->alignToReference(frame);
194 } 194 }
195 195
196 size_t 196 int
197 ViewManager::alignReferenceToPlaybackFrame(size_t frame) const 197 ViewManager::alignReferenceToPlaybackFrame(int frame) const
198 { 198 {
199 if (!m_playbackModel) return frame; 199 if (!m_playbackModel) return frame;
200 else return m_playbackModel->alignFromReference(frame); 200 else return m_playbackModel->alignFromReference(frame);
201 } 201 }
202 202
290 if (!quietly) { 290 if (!quietly) {
291 emit selectionChangedByUser(); 291 emit selectionChangedByUser();
292 } 292 }
293 } 293 }
294 294
295 size_t 295 int
296 ViewManager::constrainFrameToSelection(size_t frame) const 296 ViewManager::constrainFrameToSelection(int frame) const
297 { 297 {
298 MultiSelection::SelectionList sl = getSelections(); 298 MultiSelection::SelectionList sl = getSelections();
299 if (sl.empty()) return frame; 299 if (sl.empty()) return frame;
300 300
301 for (MultiSelection::SelectionList::const_iterator i = sl.begin(); 301 for (MultiSelection::SelectionList::const_iterator i = sl.begin();
350 if (m_newSelection.getSelections().size() > 1) return tr("Select Multiple Regions"); 350 if (m_newSelection.getSelections().size() > 1) return tr("Select Multiple Regions");
351 else return tr("Select Region"); 351 else return tr("Select Region");
352 } 352 }
353 353
354 Selection 354 Selection
355 ViewManager::getContainingSelection(size_t frame, bool defaultToFollowing) const 355 ViewManager::getContainingSelection(int frame, bool defaultToFollowing) const
356 { 356 {
357 return m_selections.getContainingSelection(frame, defaultToFollowing); 357 return m_selections.getContainingSelection(frame, defaultToFollowing);
358 } 358 }
359 359
360 void 360 void
455 if (mode) emit activity(tr("Switch on Alignment mode")); 455 if (mode) emit activity(tr("Switch on Alignment mode"));
456 else emit activity(tr("Switch off Alignment mode")); 456 else emit activity(tr("Switch off Alignment mode"));
457 } 457 }
458 } 458 }
459 459
460 size_t 460 int
461 ViewManager::getPlaybackSampleRate() const 461 ViewManager::getPlaybackSampleRate() const
462 { 462 {
463 if (m_playSource) { 463 if (m_playSource) {
464 return m_playSource->getSourceSampleRate(); 464 return m_playSource->getSourceSampleRate();
465 } 465 }
466 return 0; 466 return 0;
467 } 467 }
468 468
469 size_t 469 int
470 ViewManager::getOutputSampleRate() const 470 ViewManager::getOutputSampleRate() const
471 { 471 {
472 if (m_playSource) { 472 if (m_playSource) {
473 return m_playSource->getTargetSampleRate(); 473 return m_playSource->getTargetSampleRate();
474 } 474 }
536 { 536 {
537 return m_playSource && m_playSource->isPlaying(); 537 return m_playSource && m_playSource->isPlaying();
538 } 538 }
539 539
540 void 540 void
541 ViewManager::viewCentreFrameChanged(unsigned long f, bool locked, 541 ViewManager::viewCentreFrameChanged(int f, bool locked,
542 PlaybackFollowMode mode) 542 PlaybackFollowMode mode)
543 { 543 {
544 View *v = dynamic_cast<View *>(sender()); 544 View *v = dynamic_cast<View *>(sender());
545 545
546 #ifdef DEBUG_VIEW_MANAGER 546 #ifdef DEBUG_VIEW_MANAGER
568 568
569 seek(f); 569 seek(f);
570 } 570 }
571 571
572 void 572 void
573 ViewManager::seek(unsigned long f) 573 ViewManager::seek(int f)
574 { 574 {
575 #ifdef DEBUG_VIEW_MANAGER 575 #ifdef DEBUG_VIEW_MANAGER
576 cerr << "ViewManager::seek(" << f << ")" << endl; 576 cerr << "ViewManager::seek(" << f << ")" << endl;
577 #endif 577 #endif
578 578
579 if (m_playSource && m_playSource->isPlaying()) { 579 if (m_playSource && m_playSource->isPlaying()) {
580 unsigned long playFrame = m_playSource->getCurrentPlayingFrame(); 580 int playFrame = m_playSource->getCurrentPlayingFrame();
581 unsigned long diff = std::max(f, playFrame) - std::min(f, playFrame); 581 int diff = std::max(f, playFrame) - std::min(f, playFrame);
582 if (diff > 20000) { 582 if (diff > 20000) {
583 m_playbackFrame = f; 583 m_playbackFrame = f;
584 m_playSource->play(f); 584 m_playSource->play(f);
585 #ifdef DEBUG_VIEW_MANAGER 585 #ifdef DEBUG_VIEW_MANAGER
586 cerr << "ViewManager::considerSeek: reseeking from " << playFrame << " to " << f << endl; 586 cerr << "ViewManager::considerSeek: reseeking from " << playFrame << " to " << f << endl;
594 } 594 }
595 } 595 }
596 } 596 }
597 597
598 void 598 void
599 ViewManager::viewZoomLevelChanged(unsigned long z, bool locked) 599 ViewManager::viewZoomLevelChanged(int z, bool locked)
600 { 600 {
601 View *v = dynamic_cast<View *>(sender()); 601 View *v = dynamic_cast<View *>(sender());
602 602
603 if (!v) { 603 if (!v) {
604 SVDEBUG << "ViewManager::viewZoomLevelChanged: WARNING: sender is not a view" << endl; 604 SVDEBUG << "ViewManager::viewZoomLevelChanged: WARNING: sender is not a view" << endl;