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

Method midiToggled

src/gui/ControllerConnectionDialog.cpp:344–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342
343
344void 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

Callers

nothing calls this directly

Calls 9

getSongFunction · 0.85
valueMethod · 0.45
modelMethod · 0.45
setValueMethod · 0.45
readablePortsMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
setModelMethod · 0.45

Tested by

no test coverage detected