/[svn]/qsampler/trunk/src/qsamplerMainForm.ui.h
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerMainForm.ui.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 462 by capela, Tue Mar 15 11:39:12 2005 UTC revision 463 by capela, Tue Mar 15 15:32:29 2005 UTC
# Line 666  bool qsamplerMainForm::saveSessionFile ( Line 666  bool qsamplerMainForm::saveSessionFile (
666          QMap<int, int> audioDeviceMap;          QMap<int, int> audioDeviceMap;
667          piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Audio);          piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Audio);
668          for (iDevice = 0; piDeviceIDs && piDeviceIDs[iDevice] >= 0; iDevice++) {          for (iDevice = 0; piDeviceIDs && piDeviceIDs[iDevice] >= 0; iDevice++) {
                 qsamplerDevice device(m_pClient, qsamplerDevice::Audio, piDeviceIDs[iDevice]);  
669                  ts << endl;                  ts << endl;
670                    qsamplerDevice device(m_pClient, qsamplerDevice::Audio, piDeviceIDs[iDevice]);
671                    // Audio device specification...
672          ts << "# " << device.deviceTypeName() << " " << device.driverName()          ts << "# " << device.deviceTypeName() << " " << device.driverName()
673                     << " " << tr("Device") << " " << iDevice << endl;                     << " " << tr("Device") << " " << iDevice << endl;
674                  ts << "CREATE AUDIO_OUTPUT_DEVICE " << device.driverName();                  ts << "CREATE AUDIO_OUTPUT_DEVICE " << device.driverName();
675                  const qsamplerDeviceParamMap& params = device.params();                  qsamplerDeviceParamMap::ConstIterator deviceParam;
676                  qsamplerDeviceParamMap::ConstIterator iter;                  for (deviceParam = device.params().begin();
677                  for (iter = params.begin(); iter != params.end(); ++iter)                                  deviceParam != device.params().end();
678                          ts << " " << iter.key() << "='" << iter.data().value << "'";                                          ++deviceParam) {
679                            ts << " " << deviceParam.key()
680                               << "='" << deviceParam.data().value << "'";
681                    }
682                  ts << endl;                  ts << endl;
683                    // Audio channel parameters...
684                    int iPort = 0;
685                    for (qsamplerDevicePort *pPort = device.ports().first();
686                                    pPort;
687                                            pPort = device.ports().next(), ++iPort) {
688                            qsamplerDeviceParamMap::ConstIterator portParam;
689                            for (portParam = pPort->params().begin();
690                                            portParam != pPort->params().end();
691                                                    ++portParam) {
692                                    ts << "SET AUDIO_OUTPUT_CHANNEL_PARAMETER " << iDevice
693                                       << " " << iPort << " " << portParam.key()
694                                       << "='" << portParam.data().value << "'" << endl;
695                            }
696                    }
697                    // Set device index/id mapping.
698                  audioDeviceMap[device.deviceID()] = iDevice;                  audioDeviceMap[device.deviceID()] = iDevice;
699          // Try to keep it snappy :)          // Try to keep it snappy :)
700          QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);          QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
# Line 684  bool qsamplerMainForm::saveSessionFile ( Line 703  bool qsamplerMainForm::saveSessionFile (
703          QMap<int, int> midiDeviceMap;          QMap<int, int> midiDeviceMap;
704          piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Midi);          piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Midi);
705          for (iDevice = 0; piDeviceIDs && piDeviceIDs[iDevice] >= 0; iDevice++) {          for (iDevice = 0; piDeviceIDs && piDeviceIDs[iDevice] >= 0; iDevice++) {
                 qsamplerDevice device(m_pClient, qsamplerDevice::Midi, piDeviceIDs[iDevice]);  
706                  ts << endl;                  ts << endl;
707                    qsamplerDevice device(m_pClient, qsamplerDevice::Midi, piDeviceIDs[iDevice]);
708                    // MIDI device specification...
709          ts << "# " << device.deviceTypeName() << " " << device.driverName()          ts << "# " << device.deviceTypeName() << " " << device.driverName()
710                     << " " << tr("Device") << " " << iDevice << endl;                     << " " << tr("Device") << " " << iDevice << endl;
711                  ts << "CREATE MIDI_INPUT_DEVICE " << device.driverName();                  ts << "CREATE MIDI_INPUT_DEVICE " << device.driverName();
712                  const qsamplerDeviceParamMap& params = device.params();                  qsamplerDeviceParamMap::ConstIterator deviceParam;
713                  qsamplerDeviceParamMap::ConstIterator iter;                  for (deviceParam = device.params().begin();
714                  for (iter = params.begin(); iter != params.end(); ++iter)                                  deviceParam != device.params().end();
715                          ts << " " << iter.key() << "='" << iter.data().value << "'";                                          ++deviceParam) {
716                            ts << " " << deviceParam.key()
717                               << "='" << deviceParam.data().value << "'";
718                    }
719                  ts << endl;                  ts << endl;
720                  midiDeviceMap[device.deviceID()] = iDevice;                  // MIDI port parameters...
721          // Try to keep it snappy :)                  int iPort = 0;
722          QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);                  for (qsamplerDevicePort *pPort = device.ports().first();
723                                    pPort;
724                                            pPort = device.ports().next(), ++iPort) {
725                            qsamplerDeviceParamMap::ConstIterator portParam;
726                            for (portParam = pPort->params().begin();
727                                            portParam != pPort->params().end();
728                                                    ++portParam) {
729                                    ts << "SET MIDI_INPUT_PORT_PARAMETER " << iDevice
730                                       << " " << iPort << " " << portParam.key()
731                                       << "='" << portParam.data().value << "'" << endl;
732                            }
733                    }
734          }          }
735          ts << endl;          ts << endl;
736          // Sampler channel mapping.          // Sampler channel mapping.

Legend:
Removed from v.462  
changed lines
  Added in v.463

  ViewVC Help
Powered by ViewVC