MCPcopy Create free account
hub / github.com/LMMS/lmms / setValue

Method setValue

src/core/AutomatableModel.cpp:220–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218
219
220void AutomatableModel::setValue( const float value )
221{
222 m_oldValue = m_value;
223 ++m_setValueDepth;
224 const float old_val = m_value;
225
226 m_value = fittedValue( value );
227 if( old_val != m_value )
228 {
229 // add changes to history so user can undo it
230 addJournalCheckPoint();
231
232 // notify linked models
233 for( AutoModelVector::Iterator it = m_linkedModels.begin(); it != m_linkedModels.end(); ++it )
234 {
235 if( (*it)->m_setValueDepth < 1 && (*it)->fittedValue( value ) != (*it)->m_value )
236 {
237 bool journalling = (*it)->testAndSetJournalling( isJournalling() );
238 (*it)->setValue( value );
239 (*it)->setJournalling( journalling );
240 }
241 }
242 m_valueChanged = true;
243 emit dataChanged();
244 }
245 else
246 {
247 emit dataUnchanged();
248 }
249 --m_setValueDepth;
250}
251
252
253

Callers

nothing calls this directly

Calls 5

isJournallingFunction · 0.85
setJournallingMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
fittedValueMethod · 0.45

Tested by

no test coverage detected