comparison view/View.cpp @ 516:e4e0ae491a48

* Attempt to pick more sensible default centre frame for newly created view
author Chris Cannam
date Tue, 03 Mar 2009 16:46:27 +0000
parents 1341e95eeae9
children 86559bf8219e
comparison
equal deleted inserted replaced
515:ff1dc4f302bd 516:e4e0ae491a48
674 PlaybackFollowMode))); 674 PlaybackFollowMode)));
675 675
676 connect(this, SIGNAL(zoomLevelChanged(unsigned long, bool)), 676 connect(this, SIGNAL(zoomLevelChanged(unsigned long, bool)),
677 m_manager, SLOT(viewZoomLevelChanged(unsigned long, bool))); 677 m_manager, SLOT(viewZoomLevelChanged(unsigned long, bool)));
678 678
679 // setCentreFrame(m_manager->getViewInitialCentreFrame());
680
679 if (m_followPlay == PlaybackScrollPage) { 681 if (m_followPlay == PlaybackScrollPage) {
680 std::cerr << "View::setViewManager: setting centre frame to global centre frame: " << m_manager->getGlobalCentreFrame() << std::endl; 682 // std::cerr << "View::setViewManager: setting centre frame to global centre frame: " << m_manager->getGlobalCentreFrame() << std::endl;
681 setCentreFrame(m_manager->getGlobalCentreFrame(), false); 683 setCentreFrame(m_manager->getGlobalCentreFrame(), false);
682 } else if (m_followPlay == PlaybackScrollContinuous) { 684 } else if (m_followPlay == PlaybackScrollContinuous) {
683 std::cerr << "View::setViewManager: setting centre frame to playback frame: " << m_manager->getPlaybackFrame() << std::endl; 685 // std::cerr << "View::setViewManager: setting centre frame to playback frame: " << m_manager->getPlaybackFrame() << std::endl;
684 setCentreFrame(m_manager->getPlaybackFrame(), false); 686 setCentreFrame(m_manager->getPlaybackFrame(), false);
685 } else if (m_followPan) { 687 } else if (m_followPan) {
686 std::cerr << "View::setViewManager: (follow pan) setting centre frame to global centre frame: " << m_manager->getGlobalCentreFrame() << std::endl; 688 // std::cerr << "View::setViewManager: (follow pan) setting centre frame to global centre frame: " << m_manager->getGlobalCentreFrame() << std::endl;
687 setCentreFrame(m_manager->getGlobalCentreFrame(), false); 689 setCentreFrame(m_manager->getGlobalCentreFrame(), false);
688 } 690 }
691
689 if (m_followZoom) setZoomLevel(m_manager->getGlobalZoom()); 692 if (m_followZoom) setZoomLevel(m_manager->getGlobalZoom());
690 693
691 movePlayPointer(getAlignedPlaybackFrame()); 694 movePlayPointer(getAlignedPlaybackFrame());
692 695
693 toolModeChanged(); 696 toolModeChanged();
697 }
698
699 void
700 View::setViewManager(ViewManager *vm, long initialCentreFrame)
701 {
702 setViewManager(vm);
703 setCentreFrame(initialCentreFrame, false);
694 } 704 }
695 705
696 void 706 void
697 View::setFollowGlobalPan(bool f) 707 View::setFollowGlobalPan(bool f)
698 { 708 {