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

Method disconnectObject

src/gui/AutomationPatternView.cpp:107–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105
106
107void AutomationPatternView::disconnectObject( QAction * _a )
108{
109 JournallingObject * j = Engine::projectJournal()->
110 journallingObject( _a->data().toInt() );
111 if( j && dynamic_cast<AutomatableModel *>( j ) )
112 {
113 float oldMin = m_pat->getMin();
114 float oldMax = m_pat->getMax();
115
116 m_pat->m_objects.erase( qFind( m_pat->m_objects.begin(),
117 m_pat->m_objects.end(),
118 dynamic_cast<AutomatableModel *>( j ) ) );
119 update();
120
121 //If automation editor is opened, update its display after disconnection
122 if( gui->automationEditor() )
123 {
124 gui->automationEditor()->m_editor->updateAfterPatternChange();
125 }
126
127 //if there is no more connection connected to the AutomationPattern
128 if( m_pat->m_objects.size() == 0 )
129 {
130 //scale the points to fit the new min. and max. value
131 this->scaleTimemapToFit( oldMin, oldMax );
132 }
133 }
134}
135
136
137void AutomationPatternView::toggleRecording()

Callers

nothing calls this directly

Calls 8

scaleTimemapToFitMethod · 0.95
projectJournalFunction · 0.85
journallingObjectMethod · 0.80
dataMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected