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

Method selectController

src/gui/ControllerConnectionDialog.cpp:293–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291
292
293void 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

Callers

nothing calls this directly

Calls 8

getSongFunction · 0.85
copyToMidiControllerMethod · 0.80
hasModelMethod · 0.80
valueMethod · 0.45
modelMethod · 0.45
setNameMethod · 0.45
fullDisplayNameMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected