/[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 433 by capela, Wed Mar 9 16:44:04 2005 UTC revision 469 by capela, Wed Mar 16 17:56:46 2005 UTC
# Line 211  void qsamplerMainForm::setup ( qsamplerO Line 211  void qsamplerMainForm::setup ( qsamplerO
211      // We got options?      // We got options?
212      m_pOptions = pOptions;      m_pOptions = pOptions;
213    
214        // What style do we create these forms?
215        WFlags wflags = Qt::WType_TopLevel;
216        if (m_pOptions->bKeepOnTop)
217            wflags |= Qt::WStyle_Tool;
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);      m_pDeviceForm = new qsamplerDeviceForm(this, 0, wflags);
221      // Set message defaults...      // Set message defaults...
222      updateMessagesFont();      updateMessagesFont();
223      updateMessagesLimit();      updateMessagesLimit();
# Line 638  bool qsamplerMainForm::saveSessionFile ( Line 642  bool qsamplerMainForm::saveSessionFile (
642      }      }
643    
644      // Write the file.      // Write the file.
645      int iErrors = 0;      int  iErrors = 0;
646      QTextStream ts(&file);      QTextStream ts(&file);
647      ts << "# " << QSAMPLER_TITLE " - " << tr(QSAMPLER_SUBTITLE) << endl;      ts << "# " << QSAMPLER_TITLE " - " << tr(QSAMPLER_SUBTITLE) << endl;
648      ts << "# " << tr("Version")      ts << "# " << tr("Version")
# Line 649  bool qsamplerMainForm::saveSessionFile ( Line 653  bool qsamplerMainForm::saveSessionFile (
653      ts << "# " << tr("File")      ts << "# " << tr("File")
654         << ": " << QFileInfo(sFilename).fileName() << endl;         << ": " << QFileInfo(sFilename).fileName() << endl;
655      ts << "# " << tr("Date")      ts << "# " << tr("Date")
656         << ": " << QDate::currentDate().toString("MMMM dd yyyy")         << ": " << QDate::currentDate().toString("MMM dd yyyy")
657         << " "  << QTime::currentTime().toString("hh:mm:ss") << endl;         << " "  << QTime::currentTime().toString("hh:mm:ss") << endl;
658      ts << "#"  << endl;      ts << "#"  << endl;
659      ts << endl;      ts << endl;
660            // It is assumed that this new kind of device+session file
661            // will be loaded from a complete
662            int *piDeviceIDs;
663            int  iDevice;
664            ts << "RESET" << endl;
665            // Audio device mapping.
666            QMap<int, int> audioDeviceMap;
667            piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Audio);
668            for (iDevice = 0; piDeviceIDs && piDeviceIDs[iDevice] >= 0; iDevice++) {
669                    ts << endl;
670                    qsamplerDevice device(m_pClient, qsamplerDevice::Audio, piDeviceIDs[iDevice]);
671                    // Audio device specification...
672            ts << "# " << device.deviceTypeName() << " " << device.driverName()
673                       << " " << tr("Device") << " " << iDevice << endl;
674                    ts << "CREATE AUDIO_OUTPUT_DEVICE " << device.driverName();
675                    qsamplerDeviceParamMap::ConstIterator deviceParam;
676                    for (deviceParam = device.params().begin();
677                                    deviceParam != device.params().end();
678                                            ++deviceParam) {
679                            ts << " " << deviceParam.key()
680                               << "='" << deviceParam.data().value << "'";
681                    }
682                    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                    // Audio device index/id mapping.
698                    audioDeviceMap[device.deviceID()] = iDevice;
699            // Try to keep it snappy :)
700            QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
701            }
702            // MIDI device mapping.
703            QMap<int, int> midiDeviceMap;
704            piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Midi);
705            for (iDevice = 0; piDeviceIDs && piDeviceIDs[iDevice] >= 0; iDevice++) {
706                    ts << endl;
707                    qsamplerDevice device(m_pClient, qsamplerDevice::Midi, piDeviceIDs[iDevice]);
708                    // MIDI device specification...
709            ts << "# " << device.deviceTypeName() << " " << device.driverName()
710                       << " " << tr("Device") << " " << iDevice << endl;
711                    ts << "CREATE MIDI_INPUT_DEVICE " << device.driverName();
712                    qsamplerDeviceParamMap::ConstIterator deviceParam;
713                    for (deviceParam = device.params().begin();
714                                    deviceParam != device.params().end();
715                                            ++deviceParam) {
716                            ts << " " << deviceParam.key()
717                               << "='" << deviceParam.data().value << "'";
718                    }
719                    ts << endl;
720                    // MIDI port parameters...
721                    int iPort = 0;
722                    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                    // MIDI device index/id mapping.
735                    midiDeviceMap[device.deviceID()] = iDevice;
736            // Try to keep it snappy :)
737            QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
738            }
739            ts << endl;
740            // Sampler channel mapping.
741      QWidgetList wlist = m_pWorkspace->windowList();      QWidgetList wlist = m_pWorkspace->windowList();
742      for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) {      for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) {
743          qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel);          qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel);
744          if (pChannelStrip) {          if (pChannelStrip) {
745              qsamplerChannel *pChannel = pChannelStrip->channel();              qsamplerChannel *pChannel = pChannelStrip->channel();
746              if (pChannel) {              if (pChannel) {
747                  ts << "# Channel " << iChannel << endl;                  ts << "# " << tr("Channel") << " " << iChannel << endl;
748                  ts << "ADD CHANNEL" << endl;                  ts << "ADD CHANNEL" << endl;
749                  ts << "SET CHANNEL AUDIO_OUTPUT_TYPE " << iChannel << " " << pChannel->audioDriver() << endl;                  if (audioDeviceMap.isEmpty()) {
750                  ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannel << " " << pChannel->midiDriver() << endl;                          ts << "SET CHANNEL AUDIO_OUTPUT_TYPE " << iChannel
751              //  ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannel << " " << pChannel->midiPort() << endl;                                              << " " << pChannel->audioDriver() << endl;
752                                } else {
753                            ts << "SET CHANNEL AUDIO_OUTPUT_DEVICE " << iChannel
754                                               << " " << audioDeviceMap[pChannel->audioDevice()] << endl;
755                                    }
756                    if (midiDeviceMap.isEmpty()) {
757                            ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannel
758                                           << " " << pChannel->midiDriver() << endl;
759                                } else {
760                            ts << "SET CHANNEL MIDI_INPUT_DEVICE " << iChannel
761                                               << " " << midiDeviceMap[pChannel->midiDevice()] << endl;
762                                }
763                    ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannel
764                                   << " " << pChannel->midiPort() << endl;
765                  ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannel << " ";                  ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannel << " ";
766                  if (pChannel->midiChannel() == LSCP_MIDI_CHANNEL_ALL)                  if (pChannel->midiChannel() == LSCP_MIDI_CHANNEL_ALL)
767                      ts << "ALL";                      ts << "ALL";
# Line 1042  void qsamplerMainForm::viewOptions (void Line 1140  void qsamplerMainForm::viewOptions (void
1140          bool    bOldDisplayEffect   = m_pOptions->bDisplayEffect;          bool    bOldDisplayEffect   = m_pOptions->bDisplayEffect;
1141          int     iOldMaxVolume       = m_pOptions->iMaxVolume;          int     iOldMaxVolume       = m_pOptions->iMaxVolume;
1142          QString sOldMessagesFont    = m_pOptions->sMessagesFont;          QString sOldMessagesFont    = m_pOptions->sMessagesFont;
1143            bool    bOldKeepOnTop       = m_pOptions->bKeepOnTop;
1144          bool    bOldStdoutCapture   = m_pOptions->bStdoutCapture;          bool    bOldStdoutCapture   = m_pOptions->bStdoutCapture;
1145          int     bOldMessagesLimit   = m_pOptions->bMessagesLimit;          int     bOldMessagesLimit   = m_pOptions->bMessagesLimit;
1146          int     iOldMessagesLimitLines = m_pOptions->iMessagesLimitLines;          int     iOldMessagesLimitLines = m_pOptions->iMessagesLimitLines;
# Line 1054  void qsamplerMainForm::viewOptions (void Line 1153  void qsamplerMainForm::viewOptions (void
1153          if (pOptionsForm->exec()) {          if (pOptionsForm->exec()) {
1154              // Warn if something will be only effective on next run.              // Warn if something will be only effective on next run.
1155              if (( bOldStdoutCapture && !m_pOptions->bStdoutCapture) ||              if (( bOldStdoutCapture && !m_pOptions->bStdoutCapture) ||
1156                  (!bOldStdoutCapture &&  m_pOptions->bStdoutCapture)) {                  (!bOldStdoutCapture &&  m_pOptions->bStdoutCapture) ||
1157                    ( bOldKeepOnTop     && !m_pOptions->bKeepOnTop)     ||
1158                    (!bOldKeepOnTop     &&  m_pOptions->bKeepOnTop)) {
1159                  QMessageBox::information(this, tr("Information"),                  QMessageBox::information(this, tr("Information"),
1160                      tr("Some settings may be only effective\n"                      tr("Some settings may be only effective\n"
1161                         "next time you start this program."), tr("OK"));                         "next time you start this program."), tr("OK"));
# Line 1300  void qsamplerMainForm::updateSession (vo Line 1401  void qsamplerMainForm::updateSession (vo
1401                  QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);                  QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
1402          }          }
1403          m_pWorkspace->setUpdatesEnabled(true);          m_pWorkspace->setUpdatesEnabled(true);
1404            
1405            // Remember to refresh devices
1406            if (m_pDeviceForm)
1407                m_pDeviceForm->refreshDevices();
1408  }  }
1409    
1410    

Legend:
Removed from v.433  
changed lines
  Added in v.469

  ViewVC Help
Powered by ViewVC