comparison data/model/Model.cpp @ 1038:cc27f35aa75c cxx11

Introducing the signed 64-bit frame index type, and fixing build failures from inclusion of -Wconversion with -Werror. Not finished yet.
author Chris Cannam
date Tue, 03 Mar 2015 15:18:24 +0000
parents 4a2c150ecd67
children 368449629a30
comparison
equal deleted inserted replaced
1037:bf0e5944289b 1038:cc27f35aa75c
108 return 0; 108 return 0;
109 } 109 }
110 return m_alignment->getReferenceModel(); 110 return m_alignment->getReferenceModel();
111 } 111 }
112 112
113 int 113 sv_frame_t
114 Model::alignToReference(int frame) const 114 Model::alignToReference(sv_frame_t frame) const
115 { 115 {
116 // cerr << "Model(" << this << ")::alignToReference(" << frame << ")" << endl; 116 // cerr << "Model(" << this << ")::alignToReference(" << frame << ")" << endl;
117 if (!m_alignment) { 117 if (!m_alignment) {
118 if (m_sourceModel) return m_sourceModel->alignToReference(frame); 118 if (m_sourceModel) return m_sourceModel->alignToReference(frame);
119 else return frame; 119 else return frame;
120 } 120 }
121 int refFrame = m_alignment->toReference(frame); 121 sv_frame_t refFrame = m_alignment->toReference(frame);
122 const Model *m = m_alignment->getReferenceModel(); 122 const Model *m = m_alignment->getReferenceModel();
123 if (m && refFrame > m->getEndFrame()) refFrame = m->getEndFrame(); 123 if (m && refFrame > m->getEndFrame()) refFrame = m->getEndFrame();
124 // cerr << "have alignment, aligned is " << refFrame << endl; 124 // cerr << "have alignment, aligned is " << refFrame << endl;
125 return refFrame; 125 return refFrame;
126 } 126 }
127 127
128 int 128 sv_frame_t
129 Model::alignFromReference(int refFrame) const 129 Model::alignFromReference(sv_frame_t refFrame) const
130 { 130 {
131 // cerr << "Model(" << this << ")::alignFromReference(" << refFrame << ")" << endl; 131 // cerr << "Model(" << this << ")::alignFromReference(" << refFrame << ")" << endl;
132 if (!m_alignment) { 132 if (!m_alignment) {
133 if (m_sourceModel) return m_sourceModel->alignFromReference(refFrame); 133 if (m_sourceModel) return m_sourceModel->alignFromReference(refFrame);
134 else return refFrame; 134 else return refFrame;
135 } 135 }
136 int frame = m_alignment->fromReference(refFrame); 136 sv_frame_t frame = m_alignment->fromReference(refFrame);
137 if (frame > getEndFrame()) frame = getEndFrame(); 137 if (frame > getEndFrame()) frame = getEndFrame();
138 // cerr << "have alignment, aligned is " << frame << endl; 138 // cerr << "have alignment, aligned is " << frame << endl;
139 return frame; 139 return frame;
140 } 140 }
141 141