| 105 | |
| 106 | |
| 107 | void 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 | |
| 137 | void AutomationPatternView::toggleRecording() |
nothing calls this directly
no test coverage detected