/[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 463 by capela, Tue Mar 15 15:32:29 2005 UTC revision 487 by capela, Thu Mar 31 14:17:19 2005 UTC
# Line 218  void qsamplerMainForm::setup ( qsamplerO Line 218  void qsamplerMainForm::setup ( qsamplerO
218      // Some child forms are to be created right now.      // Some child forms are to be created right now.
219      m_pMessages = new qsamplerMessages(this);      m_pMessages = new qsamplerMessages(this);
220      m_pDeviceForm = new qsamplerDeviceForm(this, 0, wflags);      m_pDeviceForm = new qsamplerDeviceForm(this, 0, wflags);
221        m_pDeviceForm->setMainForm(this); // An important life immutable!
222      // Set message defaults...      // Set message defaults...
223      updateMessagesFont();      updateMessagesFont();
224      updateMessagesLimit();      updateMessagesLimit();
# Line 598  bool qsamplerMainForm::loadSessionFile ( Line 599  bool qsamplerMainForm::loadSessionFile (
599              if (::lscp_client_query(m_pClient, sCommand.latin1()) != LSCP_OK) {              if (::lscp_client_query(m_pClient, sCommand.latin1()) != LSCP_OK) {
600                  appendMessagesClient("lscp_client_query");                  appendMessagesClient("lscp_client_query");
601                  iErrors++;                  iErrors++;
                 break;  
602              }              }
603          }          }
604          // Try to make it snappy :)          // Try to make it snappy :)
# Line 608  bool qsamplerMainForm::loadSessionFile ( Line 608  bool qsamplerMainForm::loadSessionFile (
608      // Ok. we've read it.      // Ok. we've read it.
609      file.close();      file.close();
610    
     // Have we any errors?  
     if (iErrors > 0)  
         appendMessagesError(tr("Session could not be loaded\nfrom \"%1\".\n\nSorry.").arg(sFilename));  
   
611          // Now we'll try to create (update) the whole GUI session.          // Now we'll try to create (update) the whole GUI session.
612          updateSession();          updateSession();
613    
614            // Have we any errors?
615            if (iErrors > 0)
616                    appendMessagesError(tr("Session loaded with errors\nfrom \"%1\".\n\nSorry.").arg(sFilename));
617    
618      // Save as default session directory.      // Save as default session directory.
619      if (m_pOptions)      if (m_pOptions)
620          m_pOptions->sSessionDir = QFileInfo(sFilename).dirPath(true);          m_pOptions->sSessionDir = QFileInfo(sFilename).dirPath(true);
621      // We're not dirty anymore.          // We're not dirty anymore, if loaded without errors,
622      m_iDirtyCount = 0;          m_iDirtyCount = iErrors;
623      // Stabilize form...      // Stabilize form...
624      m_sFilename = sFilename;      m_sFilename = sFilename;
625      updateRecentFiles(sFilename);      updateRecentFiles(sFilename);
# Line 667  bool qsamplerMainForm::saveSessionFile ( Line 667  bool qsamplerMainForm::saveSessionFile (
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++) {
669                  ts << endl;                  ts << endl;
670                  qsamplerDevice device(m_pClient, qsamplerDevice::Audio, piDeviceIDs[iDevice]);                  qsamplerDevice device(this, qsamplerDevice::Audio, piDeviceIDs[iDevice]);
671                  // Audio device specification...                  // 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                  qsamplerDeviceParamMap::ConstIterator deviceParam;                  qsamplerDeviceParamMap::ConstIterator deviceParam;
676                  for (deviceParam = device.params().begin();                  for (deviceParam = device.params().begin();
677                                  deviceParam != device.params().end();                                  deviceParam != device.params().end();
678                                          ++deviceParam) {                                          ++deviceParam) {
679                          ts << " " << deviceParam.key()                          const qsamplerDeviceParam& param = deviceParam.data();
680                             << "='" << deviceParam.data().value << "'";                          if (param.value.isEmpty()) ts << "# ";
681                            ts << " " << deviceParam.key() << "='" << param.value << "'";
682                  }                  }
683                  ts << endl;                  ts << endl;
684                  // Audio channel parameters...                  // Audio channel parameters...
# Line 689  bool qsamplerMainForm::saveSessionFile ( Line 690  bool qsamplerMainForm::saveSessionFile (
690                          for (portParam = pPort->params().begin();                          for (portParam = pPort->params().begin();
691                                          portParam != pPort->params().end();                                          portParam != pPort->params().end();
692                                                  ++portParam) {                                                  ++portParam) {
693                                    const qsamplerDeviceParam& param = portParam.data();
694                                    if (param.fix || param.value.isEmpty()) ts << "# ";
695                                  ts << "SET AUDIO_OUTPUT_CHANNEL_PARAMETER " << iDevice                                  ts << "SET AUDIO_OUTPUT_CHANNEL_PARAMETER " << iDevice
696                                     << " " << iPort << " " << portParam.key()                                     << " " << iPort << " " << portParam.key()
697                                     << "='" << portParam.data().value << "'" << endl;                                     << "='" << param.value << "'" << endl;
698                          }                          }
699                  }                  }
700                  // Set device index/id mapping.                  // Audio device index/id mapping.
701                  audioDeviceMap[device.deviceID()] = iDevice;                  audioDeviceMap[device.deviceID()] = iDevice;
702          // Try to keep it snappy :)          // Try to keep it snappy :)
703          QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);          QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
# Line 704  bool qsamplerMainForm::saveSessionFile ( Line 707  bool qsamplerMainForm::saveSessionFile (
707          piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Midi);          piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Midi);
708          for (iDevice = 0; piDeviceIDs && piDeviceIDs[iDevice] >= 0; iDevice++) {          for (iDevice = 0; piDeviceIDs && piDeviceIDs[iDevice] >= 0; iDevice++) {
709                  ts << endl;                  ts << endl;
710                  qsamplerDevice device(m_pClient, qsamplerDevice::Midi, piDeviceIDs[iDevice]);                  qsamplerDevice device(this, qsamplerDevice::Midi, piDeviceIDs[iDevice]);
711                  // MIDI device specification...                  // MIDI device specification...
712          ts << "# " << device.deviceTypeName() << " " << device.driverName()          ts << "# " << device.deviceTypeName() << " " << device.driverName()
713                     << " " << tr("Device") << " " << iDevice << endl;                     << " " << tr("Device") << " " << iDevice << endl;
# Line 713  bool qsamplerMainForm::saveSessionFile ( Line 716  bool qsamplerMainForm::saveSessionFile (
716                  for (deviceParam = device.params().begin();                  for (deviceParam = device.params().begin();
717                                  deviceParam != device.params().end();                                  deviceParam != device.params().end();
718                                          ++deviceParam) {                                          ++deviceParam) {
719                          ts << " " << deviceParam.key()                          const qsamplerDeviceParam& param = deviceParam.data();
720                             << "='" << deviceParam.data().value << "'";                          if (param.value.isEmpty()) ts << "# ";
721                            ts << " " << deviceParam.key() << "='" << param.value << "'";
722                  }                  }
723                  ts << endl;                  ts << endl;
724                  // MIDI port parameters...                  // MIDI port parameters...
# Line 726  bool qsamplerMainForm::saveSessionFile ( Line 730  bool qsamplerMainForm::saveSessionFile (
730                          for (portParam = pPort->params().begin();                          for (portParam = pPort->params().begin();
731                                          portParam != pPort->params().end();                                          portParam != pPort->params().end();
732                                                  ++portParam) {                                                  ++portParam) {
733                                    const qsamplerDeviceParam& param = portParam.data();
734                                    if (param.fix || param.value.isEmpty()) ts << "# ";
735                                  ts << "SET MIDI_INPUT_PORT_PARAMETER " << iDevice                                  ts << "SET MIDI_INPUT_PORT_PARAMETER " << iDevice
736                                     << " " << iPort << " " << portParam.key()                                     << " " << iPort << " " << portParam.key()
737                                     << "='" << portParam.data().value << "'" << endl;                                     << "='" << param.value << "'" << endl;
738                          }                          }
739                  }                  }
740                    // MIDI device index/id mapping.
741                    midiDeviceMap[device.deviceID()] = iDevice;
742            // Try to keep it snappy :)
743            QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
744          }          }
745          ts << endl;          ts << endl;
746          // Sampler channel mapping.          // Sampler channel mapping.
# Line 1397  void qsamplerMainForm::updateSession (vo Line 1407  void qsamplerMainForm::updateSession (vo
1407                  QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);                  QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
1408          }          }
1409          m_pWorkspace->setUpdatesEnabled(true);          m_pWorkspace->setUpdatesEnabled(true);
1410            
1411            // Remember to refresh devices
1412            if (m_pDeviceForm)
1413                m_pDeviceForm->refreshDevices();
1414  }  }
1415    
1416    

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

  ViewVC Help
Powered by ViewVC