comparison view/View.cpp @ 321:973a0272b712

* Add Align button to main window; use it
author Chris Cannam
date Thu, 25 Oct 2007 15:45:12 +0000
parents 984c1975f1ff
children 90e10a236c44 4f4f38a11cd2
comparison
equal deleted inserted replaced
320:984c1975f1ff 321:973a0272b712
1125 } 1125 }
1126 1126
1127 size_t 1127 size_t
1128 View::alignFromReference(size_t f) const 1128 View::alignFromReference(size_t f) const
1129 { 1129 {
1130 if (!m_manager->getAlignMode()) return f;
1130 Model *aligningModel = getAligningModel(); 1131 Model *aligningModel = getAligningModel();
1131 if (!aligningModel) return f; 1132 if (!aligningModel) return f;
1132 return aligningModel->alignFromReference(f); 1133 return aligningModel->alignFromReference(f);
1133 } 1134 }
1134 1135
1135 size_t 1136 size_t
1136 View::alignToReference(size_t f) const 1137 View::alignToReference(size_t f) const
1137 { 1138 {
1139 if (!m_manager->getAlignMode()) return f;
1138 Model *aligningModel = getAligningModel(); 1140 Model *aligningModel = getAligningModel();
1139 if (!aligningModel) return f; 1141 if (!aligningModel) return f;
1140 return aligningModel->alignToReference(f); 1142 return aligningModel->alignToReference(f);
1141 } 1143 }
1142 1144
1143 int 1145 int
1144 View::getAlignedPlaybackFrame() const 1146 View::getAlignedPlaybackFrame() const
1145 { 1147 {
1148 int pf = m_manager->getPlaybackFrame();
1149 if (!m_manager->getAlignMode()) return pf;
1150
1146 Model *aligningModel = getAligningModel(); 1151 Model *aligningModel = getAligningModel();
1147
1148 int pf = m_manager->getPlaybackFrame();
1149
1150 if (!aligningModel) return pf; 1152 if (!aligningModel) return pf;
1151 1153
1152 Model *pm = m_manager->getPlaybackModel(); 1154 Model *pm = m_manager->getPlaybackModel();
1153 1155
1154 // std::cerr << "View[" << this << "]::getAlignedPlaybackFrame: pf = " << pf; 1156 // std::cerr << "View[" << this << "]::getAlignedPlaybackFrame: pf = " << pf;