| 291 | |
| 292 | |
| 293 | void ControllerConnectionDialog::selectController() |
| 294 | { |
| 295 | // Midi |
| 296 | if( m_midiGroupBox->model()->value() > 0 ) |
| 297 | { |
| 298 | if( m_midiControllerSpinBox->model()->value() > 0 ) |
| 299 | { |
| 300 | MidiController * mc; |
| 301 | mc = m_midiController->copyToMidiController( Engine::getSong() ); |
| 302 | |
| 303 | /* |
| 304 | if( m_targetModel->getTrack() && |
| 305 | !m_targetModel->getTrack()->displayName().isEmpty() ) |
| 306 | { |
| 307 | mc->m_midiPort.setName( QString( "%1 (%2)" ). |
| 308 | arg( m_targetModel->getTrack()->displayName() ). |
| 309 | arg( m_targetModel->displayName() ) ); |
| 310 | } |
| 311 | else |
| 312 | { |
| 313 | mc->m_midiPort.setName( m_targetModel->displayName() ); |
| 314 | } |
| 315 | */ |
| 316 | mc->m_midiPort.setName( m_targetModel->fullDisplayName() ); |
| 317 | m_controller = mc; |
| 318 | } |
| 319 | } |
| 320 | // User |
| 321 | else |
| 322 | { |
| 323 | if( m_userGroupBox->model()->value() > 0 && |
| 324 | Engine::getSong()->controllers().size() ) |
| 325 | { |
| 326 | m_controller = Engine::getSong()->controllers().at( |
| 327 | m_userController->model()->value() ); |
| 328 | } |
| 329 | |
| 330 | if( m_controller && m_controller->hasModel( m_targetModel ) ) |
| 331 | { |
| 332 | QMessageBox::warning(this, tr("LMMS"), tr("Cycle Detected.")); |
| 333 | return; |
| 334 | } |
| 335 | |
| 336 | } |
| 337 | |
| 338 | accept(); |
| 339 | } |
| 340 | |
| 341 | |
| 342 |
nothing calls this directly
no test coverage detected