| 124 | |
| 125 | |
| 126 | ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent, |
| 127 | const AutomatableModel * _target_model ) : |
| 128 | QDialog( _parent ), |
| 129 | m_readablePorts( NULL ), |
| 130 | m_midiAutoDetect( false ), |
| 131 | m_controller( NULL ), |
| 132 | m_targetModel( _target_model ), |
| 133 | m_midiController( NULL ) |
| 134 | { |
| 135 | setWindowIcon( embed::getIconPixmap( "setup_audio" ) ); |
| 136 | setWindowTitle( tr( "Connection Settings" ) ); |
| 137 | setModal( true ); |
| 138 | |
| 139 | // Midi stuff |
| 140 | m_midiGroupBox = new GroupBox( tr( "MIDI CONTROLLER" ), this ); |
| 141 | m_midiGroupBox->setGeometry( 8, 10, 240, 80 ); |
| 142 | connect( m_midiGroupBox->model(), SIGNAL( dataChanged() ), |
| 143 | this, SLOT( midiToggled() ) ); |
| 144 | |
| 145 | m_midiChannelSpinBox = new LcdSpinBox( 2, m_midiGroupBox, |
| 146 | tr( "Input channel" ) ); |
| 147 | m_midiChannelSpinBox->addTextForValue( 0, "--" ); |
| 148 | m_midiChannelSpinBox->setLabel( tr( "CHANNEL" ) ); |
| 149 | m_midiChannelSpinBox->move( 8, 24 ); |
| 150 | |
| 151 | m_midiControllerSpinBox = new LcdSpinBox( 3, m_midiGroupBox, |
| 152 | tr( "Input controller" ) ); |
| 153 | m_midiControllerSpinBox->addTextForValue( 0, "---" ); |
| 154 | m_midiControllerSpinBox->setLabel( tr( "CONTROLLER" ) ); |
| 155 | m_midiControllerSpinBox->move( 68, 24 ); |
| 156 | |
| 157 | |
| 158 | m_midiAutoDetectCheckBox = |
| 159 | new LedCheckBox( tr("Auto Detect"), |
| 160 | m_midiGroupBox, tr("Auto Detect") ); |
| 161 | m_midiAutoDetectCheckBox->setModel( &m_midiAutoDetect ); |
| 162 | m_midiAutoDetectCheckBox->move( 8, 60 ); |
| 163 | connect( &m_midiAutoDetect, SIGNAL( dataChanged() ), |
| 164 | this, SLOT( autoDetectToggled() ) ); |
| 165 | |
| 166 | // when using with non-raw-clients we can provide buttons showing |
| 167 | // our port-menus when being clicked |
| 168 | if( !Engine::mixer()->midiClient()->isRaw() ) |
| 169 | { |
| 170 | m_readablePorts = new MidiPortMenu( MidiPort::Input ); |
| 171 | connect( m_readablePorts, SIGNAL( triggered( QAction * ) ), |
| 172 | this, SLOT( enableAutoDetect( QAction * ) ) ); |
| 173 | ToolButton * rp_btn = new ToolButton( m_midiGroupBox ); |
| 174 | rp_btn->setText( tr( "MIDI-devices to receive " |
| 175 | "MIDI-events from" ) ); |
| 176 | rp_btn->setIcon( embed::getIconPixmap( "piano" ) ); |
| 177 | rp_btn->setGeometry( 160, 24, 32, 32 ); |
| 178 | rp_btn->setMenu( m_readablePorts ); |
| 179 | rp_btn->setPopupMode( QToolButton::InstantPopup ); |
| 180 | } |
| 181 | |
| 182 | |
| 183 | // User stuff |
nothing calls this directly
no test coverage detected