comparison view/ViewManager.cpp @ 663:1a0fdad4af4d tonioni

Merge from the default branch
author Chris Cannam
date Fri, 12 Jul 2013 13:25:22 +0100
parents c8f45afb83d5 77fa3fdbfc7e
children 917039d333bb
comparison
equal deleted inserted replaced
660:8663a831838f 663:1a0fdad4af4d
127 127
128 unsigned long 128 unsigned long
129 ViewManager::getGlobalCentreFrame() const 129 ViewManager::getGlobalCentreFrame() const
130 { 130 {
131 #ifdef DEBUG_VIEW_MANAGER 131 #ifdef DEBUG_VIEW_MANAGER
132 std::cout << "ViewManager::getGlobalCentreFrame: returning " << m_globalCentreFrame << std::endl; 132 std::cerr << "ViewManager::getGlobalCentreFrame: returning " << m_globalCentreFrame << std::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(unsigned long f)
139 { 139 {
140 #ifdef DEBUG_VIEW_MANAGER 140 #ifdef DEBUG_VIEW_MANAGER
141 std::cout << "ViewManager::setGlobalCentreFrame to " << f << std::endl; 141 std::cerr << "ViewManager::setGlobalCentreFrame to " << f << std::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 unsigned long
148 ViewManager::getGlobalZoom() const 148 ViewManager::getGlobalZoom() const
149 { 149 {
150 #ifdef DEBUG_VIEW_MANAGER 150 #ifdef DEBUG_VIEW_MANAGER
151 std::cout << "ViewManager::getGlobalZoom: returning " << m_globalZoom << std::endl; 151 std::cerr << "ViewManager::getGlobalZoom: returning " << m_globalZoom << std::endl;
152 #endif 152 #endif
153 return m_globalZoom; 153 return m_globalZoom;
154 } 154 }
155 155
156 unsigned long 156 unsigned long
472 } 472 }
473 473
474 m_playbackFrame = m_playSource->getCurrentPlayingFrame(); 474 m_playbackFrame = m_playSource->getCurrentPlayingFrame();
475 475
476 #ifdef DEBUG_VIEW_MANAGER 476 #ifdef DEBUG_VIEW_MANAGER
477 std::cout << "ViewManager::checkPlayStatus: Playing, frame " << m_playbackFrame << ", levels " << m_lastLeft << "," << m_lastRight << std::endl; 477 std::cerr << "ViewManager::checkPlayStatus: Playing, frame " << m_playbackFrame << ", levels " << m_lastLeft << "," << m_lastRight << std::endl;
478 #endif 478 #endif
479 479
480 emit playbackFrameChanged(m_playbackFrame); 480 emit playbackFrameChanged(m_playbackFrame);
481 481
482 QTimer::singleShot(20, this, SLOT(checkPlayStatus())); 482 QTimer::singleShot(20, this, SLOT(checkPlayStatus()));
490 m_lastLeft = 0.0; 490 m_lastLeft = 0.0;
491 m_lastRight = 0.0; 491 m_lastRight = 0.0;
492 } 492 }
493 493
494 #ifdef DEBUG_VIEW_MANAGER 494 #ifdef DEBUG_VIEW_MANAGER
495 // std::cout << "ViewManager::checkPlayStatus: Not playing" << std::endl; 495 // std::cerr << "ViewManager::checkPlayStatus: Not playing" << std::endl;
496 #endif 496 #endif
497 } 497 }
498 } 498 }
499 499
500 bool 500 bool
508 PlaybackFollowMode mode) 508 PlaybackFollowMode mode)
509 { 509 {
510 View *v = dynamic_cast<View *>(sender()); 510 View *v = dynamic_cast<View *>(sender());
511 511
512 #ifdef DEBUG_VIEW_MANAGER 512 #ifdef DEBUG_VIEW_MANAGER
513 SVDEBUG << "ViewManager::viewCentreFrameChanged(" << f << ", " << locked << ", " << mode << "), view is " << v << endl; 513 std::cerr << "ViewManager::viewCentreFrameChanged(" << f << ", " << locked << ", " << mode << "), view is " << v << std::endl;
514 #endif 514 #endif
515 515
516 if (locked) { 516 if (locked) {
517 m_globalCentreFrame = f; 517 m_globalCentreFrame = f;
518 emit globalCentreFrameChanged(f); 518 emit globalCentreFrameChanged(f);
537 537
538 void 538 void
539 ViewManager::seek(unsigned long f) 539 ViewManager::seek(unsigned long f)
540 { 540 {
541 #ifdef DEBUG_VIEW_MANAGER 541 #ifdef DEBUG_VIEW_MANAGER
542 std::cout << "ViewManager::seek(" << f << ")" << std::endl; 542 std::cerr << "ViewManager::seek(" << f << ")" << std::endl;
543 #endif 543 #endif
544 544
545 if (m_playSource && m_playSource->isPlaying()) { 545 if (m_playSource && m_playSource->isPlaying()) {
546 unsigned long playFrame = m_playSource->getCurrentPlayingFrame(); 546 unsigned long playFrame = m_playSource->getCurrentPlayingFrame();
547 unsigned long diff = std::max(f, playFrame) - std::min(f, playFrame); 547 unsigned long diff = std::max(f, playFrame) - std::min(f, playFrame);
548 if (diff > 20000) { 548 if (diff > 20000) {
549 m_playbackFrame = f; 549 m_playbackFrame = f;
550 m_playSource->play(f); 550 m_playSource->play(f);
551 #ifdef DEBUG_VIEW_MANAGER 551 #ifdef DEBUG_VIEW_MANAGER
552 std::cout << "ViewManager::considerSeek: reseeking from " << playFrame << " to " << f << std::endl; 552 std::cerr << "ViewManager::considerSeek: reseeking from " << playFrame << " to " << f << std::endl;
553 #endif 553 #endif
554 emit playbackFrameChanged(f); 554 emit playbackFrameChanged(f);
555 } 555 }
556 } else { 556 } else {
557 if (m_playbackFrame != f) { 557 if (m_playbackFrame != f) {
576 if (locked) { 576 if (locked) {
577 m_globalZoom = z; 577 m_globalZoom = z;
578 } 578 }
579 579
580 #ifdef DEBUG_VIEW_MANAGER 580 #ifdef DEBUG_VIEW_MANAGER
581 std::cout << "ViewManager::viewZoomLevelChanged(" << v << ", " << z << ", " << locked << ")" << std::endl; 581 std::cerr << "ViewManager::viewZoomLevelChanged(" << v << ", " << z << ", " << locked << ")" << std::endl;
582 #endif 582 #endif
583 583
584 emit viewZoomLevelChanged(v, z, locked); 584 emit viewZoomLevelChanged(v, z, locked);
585 585
586 if (!dynamic_cast<Overview *>(v)) { 586 if (!dynamic_cast<Overview *>(v)) {