# HG changeset patch # User Chris Cannam # Date 1202302189 0 # Node ID d77e1fa49e26fe4b35a8406e66f09dc3a3910c37 # Parent e73a1a1e8f2433745c7d3f4e94efdba87b81b5c0 * More work on aligning copy/paste between layers. It's a surprisingly complicated business. diff -r e73a1a1e8f24 -r d77e1fa49e26 data/model/AlignmentModel.cpp --- a/data/model/AlignmentModel.cpp Mon Feb 04 16:48:52 2008 +0000 +++ b/data/model/AlignmentModel.cpp Wed Feb 06 12:49:49 2008 +0000 @@ -30,14 +30,17 @@ m_pathBegun(false), m_pathComplete(false) { - connect(m_rawPath, SIGNAL(modelChanged()), - this, SLOT(pathChanged())); + if (m_rawPath) { - connect(m_rawPath, SIGNAL(modelChanged(size_t, size_t)), - this, SLOT(pathChanged(size_t, size_t))); + connect(m_rawPath, SIGNAL(modelChanged()), + this, SLOT(pathChanged())); - connect(m_rawPath, SIGNAL(completionChanged()), - this, SLOT(pathCompletionChanged())); + connect(m_rawPath, SIGNAL(modelChanged(size_t, size_t)), + this, SLOT(pathChanged(size_t, size_t))); + + connect(m_rawPath, SIGNAL(completionChanged()), + this, SLOT(pathCompletionChanged())); + } constructPath(); constructReversePath(); @@ -125,7 +128,10 @@ AlignmentModel::toReference(size_t frame) const { // std::cerr << "AlignmentModel::toReference(" << frame << ")" << std::endl; - if (!m_path) constructPath(); + if (!m_path) { + if (!m_rawPath) return frame; + constructPath(); + } return align(m_path, frame); } @@ -133,7 +139,10 @@ AlignmentModel::fromReference(size_t frame) const { // std::cerr << "AlignmentModel::fromReference(" << frame << ")" << std::endl; - if (!m_reversePath) constructReversePath(); + if (!m_reversePath) { + if (!m_rawPath) return frame; + constructReversePath(); + } return align(m_reversePath, frame); } diff -r e73a1a1e8f24 -r d77e1fa49e26 data/model/Model.cpp --- a/data/model/Model.cpp Mon Feb 04 16:48:52 2008 +0000 +++ b/data/model/Model.cpp Wed Feb 06 12:49:49 2008 +0000 @@ -102,7 +102,7 @@ { if (!m_alignment) { if (m_sourceModel) return m_sourceModel->getAlignmentReference(); - return this; + return 0; } return m_alignment->getReferenceModel(); }