comparison framework/MainWindowBase.cpp @ 74:864703bf64ac

* Fix #1841095 tapping time instant gives wrong time in aligned track * Fix #1815654 source tidying: Labeller * Fix (I hope) #1849999 Time value graphs one instant out
author Chris Cannam
date Thu, 13 Dec 2007 17:14:33 +0000
parents ef8a3028c711
children d184cd01760c
comparison
equal deleted inserted replaced
73:ef8a3028c711 74:864703bf64ac
685 Pane *pane = m_paneStack->getCurrentPane(); 685 Pane *pane = m_paneStack->getCurrentPane();
686 if (!pane) { 686 if (!pane) {
687 return; 687 return;
688 } 688 }
689 689
690 frame = pane->alignFromReference(frame);
691
690 Layer *layer = dynamic_cast<TimeInstantLayer *> 692 Layer *layer = dynamic_cast<TimeInstantLayer *>
691 (pane->getSelectedLayer()); 693 (pane->getSelectedLayer());
692 694
693 if (!layer) { 695 if (!layer) {
694 for (int i = pane->getLayerCount(); i > 0; --i) { 696 for (int i = pane->getLayerCount(); i > 0; --i) {
721 bool havePrevPoint = false; 723 bool havePrevPoint = false;
722 724
723 SparseOneDimensionalModel::EditCommand *command = 725 SparseOneDimensionalModel::EditCommand *command =
724 new SparseOneDimensionalModel::EditCommand(sodm, tr("Add Point")); 726 new SparseOneDimensionalModel::EditCommand(sodm, tr("Add Point"));
725 727
726 if (m_labeller->actingOnPrevPoint()) { 728 if (m_labeller->requiresPrevPoint()) {
727 729
728 SparseOneDimensionalModel::PointList prevPoints = 730 SparseOneDimensionalModel::PointList prevPoints =
729 sodm->getPreviousPoints(frame); 731 sodm->getPreviousPoints(frame);
730 732
731 if (!prevPoints.empty()) { 733 if (!prevPoints.empty()) {
736 738
737 if (m_labeller) { 739 if (m_labeller) {
738 740
739 m_labeller->setSampleRate(sodm->getSampleRate()); 741 m_labeller->setSampleRate(sodm->getSampleRate());
740 742
741 if (havePrevPoint) { 743 if (m_labeller->actingOnPrevPoint()) {
742 command->deletePoint(prevPoint); 744 command->deletePoint(prevPoint);
743 } 745 }
744 746
745 m_labeller->label<SparseOneDimensionalModel::Point> 747 m_labeller->label<SparseOneDimensionalModel::Point>
746 (point, havePrevPoint ? &prevPoint : 0); 748 (point, havePrevPoint ? &prevPoint : 0);
747 749
748 if (havePrevPoint) { 750 if (m_labeller->actingOnPrevPoint()) {
749 command->addPoint(prevPoint); 751 command->addPoint(prevPoint);
750 } 752 }
751 } 753 }
752 754
753 command->addPoint(point); 755 command->addPoint(point);