| 342 | |
| 343 | |
| 344 | void ControllerConnectionDialog::midiToggled() |
| 345 | { |
| 346 | int enabled = m_midiGroupBox->model()->value(); |
| 347 | if( enabled != 0 ) |
| 348 | { |
| 349 | if( m_userGroupBox->model()->value() != 0 ) |
| 350 | { |
| 351 | m_userGroupBox->model()->setValue( 0 ); |
| 352 | } |
| 353 | |
| 354 | if( !m_midiController ) |
| 355 | { |
| 356 | m_midiController = new AutoDetectMidiController( Engine::getSong() ); |
| 357 | |
| 358 | MidiPort::Map map = m_midiController->m_midiPort.readablePorts(); |
| 359 | for( MidiPort::Map::Iterator it = map.begin(); it != map.end(); ++it ) |
| 360 | { |
| 361 | it.value() = true; |
| 362 | } |
| 363 | m_midiController->subscribeReadablePorts( map ); |
| 364 | |
| 365 | m_midiChannelSpinBox->setModel( &m_midiController->m_midiPort.m_inputChannelModel ); |
| 366 | m_midiControllerSpinBox->setModel( &m_midiController->m_midiPort.m_inputControllerModel ); |
| 367 | |
| 368 | if( m_readablePorts ) |
| 369 | { |
| 370 | m_readablePorts->setModel( &m_midiController->m_midiPort ); |
| 371 | } |
| 372 | |
| 373 | connect( m_midiController, SIGNAL( valueChanged() ), this, SLOT( midiValueChanged() ) ); |
| 374 | } |
| 375 | } |
| 376 | m_midiAutoDetect.setValue( enabled ); |
| 377 | |
| 378 | m_midiChannelSpinBox->setEnabled( enabled ); |
| 379 | m_midiControllerSpinBox->setEnabled( enabled ); |
| 380 | m_midiAutoDetectCheckBox->setEnabled( enabled ); |
| 381 | } |
| 382 | |
| 383 | |
| 384 |
nothing calls this directly
no test coverage detected