diff --git a/src/sound/soundbase.cpp b/src/sound/soundbase.cpp index 464b81bd41..10f44e66cc 100644 --- a/src/sound/soundbase.cpp +++ b/src/sound/soundbase.cpp @@ -33,6 +33,7 @@ char const sMidiCtlChar[] = { /* [EMidiCtlType::Solo] = */ 's', /* [EMidiCtlType::Mute] = */ 'm', /* [EMidiCtlType::MuteMyself] = */ 'o', + /* [EMidiCtlType::Device] = */ 'd', /* [EMidiCtlType::None] = */ '\0' }; /* Implementation *************************************************************/ @@ -309,16 +310,24 @@ void CSoundBase::ParseCommandLineArgument ( const QString& strMIDISetup ) continue; EMidiCtlType eTyp = static_cast ( iCtrl ); - const QStringList slP = sParm.mid ( 1 ).split ( '*' ); - int iFirst = slP[0].toUInt(); - int iNum = ( slP.count() > 1 ) ? slP[1].toUInt() : 1; - for ( int iOff = 0; iOff < iNum; iOff++ ) + if ( eTyp == Device ) { - if ( iOff >= MAX_NUM_CHANNELS ) - break; - if ( iFirst + iOff >= 128 ) - break; - aMidiCtls[iFirst + iOff] = { eTyp, iOff }; + // save MIDI device name to select + strMIDIDevice = sParm.mid ( 1 ); + } + else + { + const QStringList slP = sParm.mid ( 1 ).split ( '*' ); + int iFirst = slP[0].toUInt(); + int iNum = ( slP.count() > 1 ) ? slP[1].toUInt() : 1; + for ( int iOff = 0; iOff < iNum; iOff++ ) + { + if ( iOff >= MAX_NUM_CHANNELS ) + break; + if ( iFirst + iOff >= 128 ) + break; + aMidiCtls[iFirst + iOff] = { eTyp, iOff }; + } } } } diff --git a/src/sound/soundbase.h b/src/sound/soundbase.h index 293d6b1b95..4cd94b551f 100644 --- a/src/sound/soundbase.h +++ b/src/sound/soundbase.h @@ -49,6 +49,7 @@ enum EMidiCtlType Solo, Mute, MuteMyself, + Device, None }; @@ -167,6 +168,8 @@ class CSoundBase : public QThread QString strCurDevName; QString strDriverNames[MAX_NUMBER_SOUND_CARDS]; + QString strMIDIDevice; + signals: void ReinitRequest ( int iSndCrdResetType ); void ControllerInFaderLevel ( int iChannelIdx, int iValue );