--- qsampler/trunk/src/qsamplerMainForm.ui.h 2005/03/15 11:39:12 462 +++ qsampler/trunk/src/qsamplerMainForm.ui.h 2005/03/16 17:56:46 469 @@ -666,16 +666,35 @@ QMap audioDeviceMap; piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Audio); for (iDevice = 0; piDeviceIDs && piDeviceIDs[iDevice] >= 0; iDevice++) { - qsamplerDevice device(m_pClient, qsamplerDevice::Audio, piDeviceIDs[iDevice]); ts << endl; + qsamplerDevice device(m_pClient, qsamplerDevice::Audio, piDeviceIDs[iDevice]); + // Audio device specification... ts << "# " << device.deviceTypeName() << " " << device.driverName() << " " << tr("Device") << " " << iDevice << endl; ts << "CREATE AUDIO_OUTPUT_DEVICE " << device.driverName(); - const qsamplerDeviceParamMap& params = device.params(); - qsamplerDeviceParamMap::ConstIterator iter; - for (iter = params.begin(); iter != params.end(); ++iter) - ts << " " << iter.key() << "='" << iter.data().value << "'"; + qsamplerDeviceParamMap::ConstIterator deviceParam; + for (deviceParam = device.params().begin(); + deviceParam != device.params().end(); + ++deviceParam) { + ts << " " << deviceParam.key() + << "='" << deviceParam.data().value << "'"; + } ts << endl; + // Audio channel parameters... + int iPort = 0; + for (qsamplerDevicePort *pPort = device.ports().first(); + pPort; + pPort = device.ports().next(), ++iPort) { + qsamplerDeviceParamMap::ConstIterator portParam; + for (portParam = pPort->params().begin(); + portParam != pPort->params().end(); + ++portParam) { + ts << "SET AUDIO_OUTPUT_CHANNEL_PARAMETER " << iDevice + << " " << iPort << " " << portParam.key() + << "='" << portParam.data().value << "'" << endl; + } + } + // Audio device index/id mapping. audioDeviceMap[device.deviceID()] = iDevice; // Try to keep it snappy :) QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); @@ -684,16 +703,35 @@ QMap midiDeviceMap; piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Midi); for (iDevice = 0; piDeviceIDs && piDeviceIDs[iDevice] >= 0; iDevice++) { - qsamplerDevice device(m_pClient, qsamplerDevice::Midi, piDeviceIDs[iDevice]); ts << endl; + qsamplerDevice device(m_pClient, qsamplerDevice::Midi, piDeviceIDs[iDevice]); + // MIDI device specification... ts << "# " << device.deviceTypeName() << " " << device.driverName() << " " << tr("Device") << " " << iDevice << endl; ts << "CREATE MIDI_INPUT_DEVICE " << device.driverName(); - const qsamplerDeviceParamMap& params = device.params(); - qsamplerDeviceParamMap::ConstIterator iter; - for (iter = params.begin(); iter != params.end(); ++iter) - ts << " " << iter.key() << "='" << iter.data().value << "'"; + qsamplerDeviceParamMap::ConstIterator deviceParam; + for (deviceParam = device.params().begin(); + deviceParam != device.params().end(); + ++deviceParam) { + ts << " " << deviceParam.key() + << "='" << deviceParam.data().value << "'"; + } ts << endl; + // MIDI port parameters... + int iPort = 0; + for (qsamplerDevicePort *pPort = device.ports().first(); + pPort; + pPort = device.ports().next(), ++iPort) { + qsamplerDeviceParamMap::ConstIterator portParam; + for (portParam = pPort->params().begin(); + portParam != pPort->params().end(); + ++portParam) { + ts << "SET MIDI_INPUT_PORT_PARAMETER " << iDevice + << " " << iPort << " " << portParam.key() + << "='" << portParam.data().value << "'" << endl; + } + } + // MIDI device index/id mapping. midiDeviceMap[device.deviceID()] = iDevice; // Try to keep it snappy :) QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); @@ -1363,6 +1401,10 @@ QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); } m_pWorkspace->setUpdatesEnabled(true); + + // Remember to refresh devices + if (m_pDeviceForm) + m_pDeviceForm->refreshDevices(); }