/[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 969 by capela, Wed Dec 6 19:38:02 2006 UTC revision 1033 by capela, Mon Jan 15 11:27:22 2007 UTC
# Line 2  Line 2 
2  //  //
3  // ui.h extension file, included from the uic-generated form implementation.  // ui.h extension file, included from the uic-generated form implementation.
4  /****************************************************************************  /****************************************************************************
5     Copyright (C) 2004-2006, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved.
6    
7     This program is free software; you can redistribute it and/or     This program is free software; you can redistribute it and/or
8     modify it under the terms of the GNU General Public License     modify it under the terms of the GNU General Public License
# Line 142  void qsamplerMainForm::init (void) Line 142  void qsamplerMainForm::init (void)
142      // Make it an MDI workspace.      // Make it an MDI workspace.
143      m_pWorkspace = new QWorkspace(this);      m_pWorkspace = new QWorkspace(this);
144      m_pWorkspace->setScrollBarsEnabled(true);      m_pWorkspace->setScrollBarsEnabled(true);
145      // Set the activation connection.          // Set the activation connection.
146      QObject::connect(m_pWorkspace, SIGNAL(windowActivated(QWidget *)), this, SLOT(stabilizeForm()));          QObject::connect(m_pWorkspace,
147                    SIGNAL(windowActivated(QWidget *)),
148                    SLOT(stabilizeForm()));
149      // Make it shine :-)      // Make it shine :-)
150      setCentralWidget(m_pWorkspace);      setCentralWidget(m_pWorkspace);
151    
# Line 253  void qsamplerMainForm::setup ( qsamplerO Line 255  void qsamplerMainForm::setup ( qsamplerO
255      updateMessagesLimit();      updateMessagesLimit();
256      updateMessagesCapture();      updateMessagesCapture();
257      // Set the visibility signal.      // Set the visibility signal.
258      QObject::connect(m_pMessages,          QObject::connect(m_pMessages,
259                  SIGNAL(visibilityChanged(bool)),                  SIGNAL(visibilityChanged(bool)),
260                  SLOT(stabilizeForm()));                  SLOT(stabilizeForm()));
261    
# Line 404  void qsamplerMainForm::dropEvent ( QDrop Line 406  void qsamplerMainForm::dropEvent ( QDrop
406                          m_iDirtyCount++;                          m_iDirtyCount++;
407                          stabilizeForm();                          stabilizeForm();
408                  }   // Otherwise, load an usual session file (LSCP script)...                  }   // Otherwise, load an usual session file (LSCP script)...
409                  else if (closeSession(true))                  else if (closeSession(true)) {
410                          loadSessionFile(sPath);                          loadSessionFile(sPath);
411                            break;
412                    }
413                  // Make it look responsive...:)                  // Make it look responsive...:)
414                  QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);                  QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
415          }          }
# Line 636  bool qsamplerMainForm::loadSessionFile ( Line 640  bool qsamplerMainForm::loadSessionFile (
640          return false;          return false;
641      }      }
642    
643            // Tell the world we'll take some time...
644            QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
645    
646      // Read the file.      // Read the file.
647            int iLine = 0;
648      int iErrors = 0;      int iErrors = 0;
649      QTextStream ts(&file);      QTextStream ts(&file);
650      while (!ts.atEnd()) {      while (!ts.atEnd()) {
651          // Read the line.          // Read the line.
652          QString sCommand = ts.readLine().stripWhiteSpace();          QString sCommand = ts.readLine().stripWhiteSpace();
653                    iLine++;
654          // If not empty, nor a comment, call the server...          // If not empty, nor a comment, call the server...
655          if (!sCommand.isEmpty() && sCommand[0] != '#') {          if (!sCommand.isEmpty() && sCommand[0] != '#') {
656              appendMessagesColor(sCommand, "#996633");                          // Remember that, no matter what,
657              // Remember that, no matter what,                          // all LSCP commands are CR/LF terminated.
658              // all LSCP commands are CR/LF terminated.                          sCommand += "\r\n";
659              sCommand += "\r\n";                          if (::lscp_client_query(m_pClient, sCommand.latin1()) != LSCP_OK) {
660              if (::lscp_client_query(m_pClient, sCommand.latin1()) != LSCP_OK) {                                  appendMessagesColor(QString("%1(%2): %3")
661                  appendMessagesClient("lscp_client_query");                                          .arg(QFileInfo(sFilename).fileName()).arg(iLine)
662                  iErrors++;                                          .arg(sCommand.simplifyWhiteSpace()), "#996633");
663              }                                  appendMessagesClient("lscp_client_query");
664                                    iErrors++;
665                            }
666          }          }
667          // Try to make it snappy :)          // Try to make it snappy :)
668          QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);          QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
# Line 663  bool qsamplerMainForm::loadSessionFile ( Line 674  bool qsamplerMainForm::loadSessionFile (
674          // Now we'll try to create (update) the whole GUI session.          // Now we'll try to create (update) the whole GUI session.
675          updateSession();          updateSession();
676    
677            // We're fornerly done.
678            QApplication::restoreOverrideCursor();
679    
680          // Have we any errors?          // Have we any errors?
681          if (iErrors > 0)          if (iErrors > 0)
682                  appendMessagesError(tr("Session loaded with errors\nfrom \"%1\".\n\nSorry.").arg(sFilename));                  appendMessagesError(tr("Session loaded with errors\nfrom \"%1\".\n\nSorry.").arg(sFilename));
# Line 686  bool qsamplerMainForm::loadSessionFile ( Line 700  bool qsamplerMainForm::loadSessionFile (
700  // Save current session to specific file path.  // Save current session to specific file path.
701  bool qsamplerMainForm::saveSessionFile ( const QString& sFilename )  bool qsamplerMainForm::saveSessionFile ( const QString& sFilename )
702  {  {
703            if (m_pClient == NULL)
704                    return false;
705    
706            // Check whether server is apparently OK...
707            if (::lscp_get_channels(m_pClient) < 0) {
708                    appendMessagesClient("lscp_get_channels");
709                    return false;
710            }
711    
712      // Open and write into real file.      // Open and write into real file.
713      QFile file(sFilename);      QFile file(sFilename);
714      if (!file.open(IO_WriteOnly | IO_Truncate)) {      if (!file.open(IO_WriteOnly | IO_Truncate)) {
# Line 693  bool qsamplerMainForm::saveSessionFile ( Line 716  bool qsamplerMainForm::saveSessionFile (
716          return false;          return false;
717      }      }
718    
719            // Tell the world we'll take some time...
720            QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
721    
722      // Write the file.      // Write the file.
723      int  iErrors = 0;      int  iErrors = 0;
724      QTextStream ts(&file);      QTextStream ts(&file);
# Line 709  bool qsamplerMainForm::saveSessionFile ( Line 735  bool qsamplerMainForm::saveSessionFile (
735         << " "  << QTime::currentTime().toString("hh:mm:ss") << endl;         << " "  << QTime::currentTime().toString("hh:mm:ss") << endl;
736      ts << "#"  << endl;      ts << "#"  << endl;
737      ts << endl;      ts << endl;
738    
739          // It is assumed that this new kind of device+session file          // It is assumed that this new kind of device+session file
740          // will be loaded from a complete          // will be loaded from a complete initialized server...
741          int *piDeviceIDs;          int *piDeviceIDs;
742          int  iDevice;          int  iDevice;
743          ts << "RESET" << endl;          ts << "RESET" << endl;
744    
745          // Audio device mapping.          // Audio device mapping.
746          QMap<int, int> audioDeviceMap;          QMap<int, int> audioDeviceMap;
747          piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Audio);          piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Audio);
# Line 751  bool qsamplerMainForm::saveSessionFile ( Line 779  bool qsamplerMainForm::saveSessionFile (
779                  }                  }
780                  // Audio device index/id mapping.                  // Audio device index/id mapping.
781                  audioDeviceMap[device.deviceID()] = iDevice;                  audioDeviceMap[device.deviceID()] = iDevice;
782          // Try to keep it snappy :)                  // Try to keep it snappy :)
783          QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);                  QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
784          }          }
785    
786          // MIDI device mapping.          // MIDI device mapping.
787          QMap<int, int> midiDeviceMap;          QMap<int, int> midiDeviceMap;
788          piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Midi);          piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Midi);
# Line 791  bool qsamplerMainForm::saveSessionFile ( Line 820  bool qsamplerMainForm::saveSessionFile (
820                  }                  }
821                  // MIDI device index/id mapping.                  // MIDI device index/id mapping.
822                  midiDeviceMap[device.deviceID()] = iDevice;                  midiDeviceMap[device.deviceID()] = iDevice;
823          // Try to keep it snappy :)                  // Try to keep it snappy :)
824          QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);                  QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
825          }          }
826          ts << endl;          ts << endl;
827    
828    #ifdef CONFIG_MIDI_INSTRUMENT
829            // MIDI instrument mapping...
830            QMap<int, int> midiInstrumentMap;
831            int *piMaps = ::lscp_list_midi_instrument_maps(m_pClient);
832            for (int iMap = 0; piMaps && piMaps[iMap] >= 0; iMap++) {
833                    int iMidiMap = piMaps[iMap];
834                    const char *pszMapName
835                            = ::lscp_get_midi_instrument_map_name(m_pClient, iMidiMap);
836                    ts << "# " << tr("MIDI instrument map") << " " << iMap;
837                    if (pszMapName)
838                            ts << " - " << pszMapName;
839                    ts << endl;
840                    ts << "ADD MIDI_INSTRUMENT_MAP";
841                    if (pszMapName)
842                            ts << " '" << pszMapName << "'";
843                    ts << endl;
844                    // MIDI instrument mapping...
845                    lscp_midi_instrument_t *pInstrs
846                            = ::lscp_list_midi_instruments(m_pClient, iMidiMap);
847                    for (int iInstr = 0; pInstrs && pInstrs[iInstr].map >= 0; iInstr++) {
848                            lscp_midi_instrument_info_t *pInstrInfo
849                                    = ::lscp_get_midi_instrument_info(m_pClient, &pInstrs[iInstr]);
850                            if (pInstrInfo) {
851                                    ts << "MAP MIDI_INSTRUMENT "
852                                            << iMap                        << " "
853                                            << pInstrs[iInstr].bank        << " "
854                                            << pInstrs[iInstr].prog        << " "
855                                            << pInstrInfo->engine_name     << " '"
856                                            << pInstrInfo->instrument_file << "' "
857                                            << pInstrInfo->instrument_nr   << " "
858                                            << pInstrInfo->volume          << " ";
859                                    switch (pInstrInfo->load_mode) {
860                                            case LSCP_LOAD_PERSISTENT:
861                                                    ts << "PERSISTENT";
862                                                    break;
863                                            case LSCP_LOAD_ON_DEMAND_HOLD:
864                                                    ts << "ON_DEMAND_HOLD";
865                                                    break;
866                                            case LSCP_LOAD_ON_DEMAND:
867                                            case LSCP_LOAD_DEFAULT:
868                                            default:
869                                                    ts << "ON_DEMAND";
870                                                    break;
871                                    }
872                                    if (pInstrInfo->name)
873                                            ts << " '" << pInstrInfo->name << "'";
874                                    ts << endl;
875                            }       // Check for errors...
876                            else if (::lscp_client_get_errno(m_pClient)) {
877                                    appendMessagesClient("lscp_get_midi_instrument_info");
878                                    iErrors++;
879                            }
880                            // Try to keep it snappy :)
881                            QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
882                    }
883                    ts << endl;
884                    // Check for errors...
885                    if (pInstrs == NULL && ::lscp_client_get_errno(m_pClient)) {
886                            appendMessagesClient("lscp_list_midi_instruments");
887                            iErrors++;
888                    }
889                    // MIDI strument index/id mapping.
890                    midiInstrumentMap[iMidiMap] = iMap;
891            }
892            // Check for errors...
893            if (piMaps == NULL && ::lscp_client_get_errno(m_pClient)) {
894                    appendMessagesClient("lscp_list_midi_instrument_maps");
895                    iErrors++;
896            }
897    #endif  // CONFIG_MIDI_INSTRUMENT
898    
899          // Sampler channel mapping.          // Sampler channel mapping.
900      QWidgetList wlist = m_pWorkspace->windowList();      QWidgetList wlist = m_pWorkspace->windowList();
901      for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) {      for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) {
902          qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel);          qsamplerChannelStrip *pChannelStrip
903                            = static_cast<qsamplerChannelStrip *> (wlist.at(iChannel));
904          if (pChannelStrip) {          if (pChannelStrip) {
905              qsamplerChannel *pChannel = pChannelStrip->channel();              qsamplerChannel *pChannel = pChannelStrip->channel();
906              if (pChannel) {              if (pChannel) {
# Line 827  bool qsamplerMainForm::saveSessionFile ( Line 929  bool qsamplerMainForm::saveSessionFile (
929                      ts << pChannel->midiChannel();                      ts << pChannel->midiChannel();
930                  ts << endl;                  ts << endl;
931                  ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannel << endl;                  ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannel << endl;
932                  ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' " << pChannel->instrumentNr() << " " << iChannel << endl;                                  if (pChannel->instrumentStatus() < 100) ts << "# ";
933                                    ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' "
934                                            << pChannel->instrumentNr() << " " << iChannel << endl;
935                                  qsamplerChannelRoutingMap::ConstIterator audioRoute;                                  qsamplerChannelRoutingMap::ConstIterator audioRoute;
936                                  for (audioRoute = pChannel->audioRouting().begin();                                  for (audioRoute = pChannel->audioRouting().begin();
937                                                  audioRoute != pChannel->audioRouting().end();                                                  audioRoute != pChannel->audioRouting().end();
# Line 836  bool qsamplerMainForm::saveSessionFile ( Line 940  bool qsamplerMainForm::saveSessionFile (
940                                                  << " " << audioRoute.key()                                                  << " " << audioRoute.key()
941                                                  << " " << audioRoute.data() << endl;                                                  << " " << audioRoute.data() << endl;
942                                  }                                  }
943                  ts << "SET CHANNEL VOLUME " << iChannel << " " << pChannel->volume() << endl;                                  ts << "SET CHANNEL VOLUME " << iChannel
944                                            << " " << pChannel->volume() << endl;
945                                  if (pChannel->channelMute())                                  if (pChannel->channelMute())
946                                          ts << "SET CHANNEL MUTE " << iChannel << " 1" << endl;                                          ts << "SET CHANNEL MUTE " << iChannel << " 1" << endl;
947                                  if (pChannel->channelSolo())                                  if (pChannel->channelSolo())
948                                          ts << "SET CHANNEL SOLO " << iChannel << " 1" << endl;                                          ts << "SET CHANNEL SOLO " << iChannel << " 1" << endl;
949    #ifdef CONFIG_MIDI_INSTRUMENT
950                                    if (pChannel->midiMap() >= 0) {
951                                            ts << "SET CHANNEL MIDI_INSTRUMENT_MAP " << iChannel
952                                                    << " " << midiInstrumentMap[pChannel->midiMap()] << endl;
953                                    }
954    #endif
955    #ifdef CONFIG_FXSEND
956                                    int iChannelID = pChannel->channelID();
957                                    int *piFxSends = ::lscp_list_fxsends(m_pClient, iChannelID);
958                                    for (int iFxSend = 0;
959                                                    piFxSends && piFxSends[iFxSend] >= 0;
960                                                            iFxSend++) {
961                                            lscp_fxsend_info_t *pFxSendInfo = ::lscp_get_fxsend_info(
962                                                    m_pClient, iChannelID, piFxSends[iFxSend]);
963                                            if (pFxSendInfo) {
964                                                    ts << "CREATE FX_SEND " << iChannel
965                                                            << " " << pFxSendInfo->midi_controller;
966                                                    if (pFxSendInfo->name)
967                                                            ts << " '" << pFxSendInfo->name << "'";
968                                                    ts << endl;
969                                                    int *piRouting = pFxSendInfo->audio_routing;
970                                                    for (int iAudioSrc = 0;
971                                                                    piRouting && piRouting[iAudioSrc] >= 0;
972                                                                            iAudioSrc++) {
973                                                            ts << "SET FX_SEND AUDIO_OUTPUT_CHANNEL "
974                                                                    << iChannel
975                                                                    << " " << iFxSend
976                                                                    << " " << iAudioSrc
977                                                                    << " " << piRouting[iAudioSrc] << endl;
978                                                    }
979    #ifdef CONFIG_FXSEND_LEVEL
980                                                    ts << "SET FX_SEND LEVEL " << iChannel
981                                                            << " " << iFxSend
982                                                            << " " << pFxSendInfo->level << endl;                                                  
983    #endif
984                                            }       // Check for errors...
985                                            else if (::lscp_client_get_errno(m_pClient)) {
986                                                    appendMessagesClient("lscp_get_fxsend_info");
987                                                    iErrors++;
988                                            }
989                                    }
990    #endif
991                  ts << endl;                  ts << endl;
992              }              }
993          }          }
# Line 848  bool qsamplerMainForm::saveSessionFile ( Line 995  bool qsamplerMainForm::saveSessionFile (
995          QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);          QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
996      }      }
997    
 #ifdef CONFIG_MIDI_INSTRUMENT  
         // MIDI instrument mapping...  
         lscp_midi_instrument_t *pInstrs = ::lscp_list_midi_instruments(m_pClient);  
         if (pInstrs)  
                 ts << "# " << tr("MIDI instrument mapping") << endl;  
         for (int iInstr = 0; pInstrs && pInstrs[iInstr].program >= 0; iInstr++) {  
                 lscp_midi_instrument_info_t *pInstrInfo  
                         = ::lscp_get_midi_instrument_info(m_pClient, &pInstrs[iInstr]);  
                 if (pInstrInfo) {  
                         ts << "MAP MIDI_INSTRUMENT "  
                                 << pInstrs[iInstr].bank_msb    << " "  
                                 << pInstrs[iInstr].bank_lsb    << " "  
                                 << pInstrs[iInstr].program     << " "  
                                 << pInstrInfo->engine_name     << " '"  
                                 << pInstrInfo->instrument_file << "' "  
                                 << pInstrInfo->instrument_nr   << " "  
                                 << pInstrInfo->volume          << " ";  
                         switch (pInstrInfo->load_mode) {  
                                 case LSCP_LOAD_PERSISTENT:  
                                         ts << "PERSISTENT";  
                                         break;  
                                 case LSCP_LOAD_ON_DEMAND_HOLD:  
                                         ts << "ON_DEMAND_HOLD";  
                                         break;  
                                 case LSCP_LOAD_ON_DEMAND:  
                                 case LSCP_LOAD_DEFAULT:  
                                 default:  
                                         ts << "ON_DEMAND";  
                                         break;  
                         }  
                         if (pInstrInfo->name)  
                                 ts << " '" << pInstrInfo->name << "'";  
                         ts << endl;  
                 }  
                 // Try to keep it snappy :)  
                 QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);  
         }  
         if (pInstrs)  
                 ts << endl;  
 #endif //  CONFIG_MIDI_INSTRUMENT  
   
998      // Ok. we've wrote it.      // Ok. we've wrote it.
999      file.close();      file.close();
1000    
1001            // We're fornerly done.
1002            QApplication::restoreOverrideCursor();
1003    
1004      // Have we any errors?      // Have we any errors?
1005      if (iErrors > 0)      if (iErrors > 0)
1006          appendMessagesError(tr("Some settings could not be saved\nto \"%1\" session file.\n\nSorry.").arg(sFilename));          appendMessagesError(tr("Some settings could not be saved\nto \"%1\" session file.\n\nSorry.").arg(sFilename));
# Line 983  void qsamplerMainForm::fileReset (void) Line 1092  void qsamplerMainForm::fileReset (void)
1092          tr("Reset"), tr("Cancel")) > 0)          tr("Reset"), tr("Cancel")) > 0)
1093          return;          return;
1094    
1095            // Trye closing the current session, first...
1096            if (!closeSession(true))
1097                    return;
1098    
1099      // Just do the reset, after closing down current session...      // Just do the reset, after closing down current session...
1100      if (closeSession(true) && ::lscp_reset_sampler(m_pClient) != LSCP_OK) {          // Do the actual sampler reset...
1101          appendMessagesClient("lscp_reset_sampler");          if (::lscp_reset_sampler(m_pClient) != LSCP_OK) {
1102          appendMessagesError(tr("Could not reset sampler instance.\n\nSorry."));                  appendMessagesClient("lscp_reset_sampler");
1103          return;                  appendMessagesError(tr("Could not reset sampler instance.\n\nSorry."));
1104      }                  return;
1105            }
1106    
1107      // Log this.      // Log this.
1108      appendMessages(tr("Sampler reset."));      appendMessages(tr("Sampler reset."));
# Line 1422  void qsamplerMainForm::helpAbout (void) Line 1536  void qsamplerMainForm::helpAbout (void)
1536      sText += tr("Sampler channel Mute/Solo support disabled.");      sText += tr("Sampler channel Mute/Solo support disabled.");
1537      sText += "</font></small><br />";      sText += "</font></small><br />";
1538  #endif  #endif
1539    #ifndef CONFIG_AUDIO_ROUTING
1540        sText += "<small><font color=\"red\">";
1541        sText += tr("LSCP (liblscp) audio_routing support disabled.");
1542        sText += "</font></small><br />";
1543    #endif
1544    #ifndef CONFIG_FXSEND
1545        sText += "<small><font color=\"red\">";
1546        sText += tr("Sampler channel Effect Sends support disabled.");
1547        sText += "</font></small><br />";
1548    #endif
1549  #ifndef CONFIG_MIDI_INSTRUMENT  #ifndef CONFIG_MIDI_INSTRUMENT
1550      sText += "<small><font color=\"red\">";      sText += "<small><font color=\"red\">";
1551      sText += tr("MIDI instrument mapping support disabled.");      sText += tr("MIDI instrument mapping support disabled.");
# Line 1538  void qsamplerMainForm::channelStripChang Line 1662  void qsamplerMainForm::channelStripChang
1662  // Grab and restore current sampler channels session.  // Grab and restore current sampler channels session.
1663  void qsamplerMainForm::updateSession (void)  void qsamplerMainForm::updateSession (void)
1664  {  {
1665    #ifdef CONFIG_MIDI_INSTRUMENT
1666            // FIXME: Make some room for default instrument maps...
1667            int iMaps = ::lscp_get_midi_instrument_maps(m_pClient);
1668            if (iMaps < 0)
1669                    appendMessagesClient("lscp_get_midi_instrument_maps");
1670            else if (iMaps < 1) {
1671                    ::lscp_add_midi_instrument_map(m_pClient, tr("Chromatic").latin1());
1672                    ::lscp_add_midi_instrument_map(m_pClient, tr("Drum Kits").latin1());
1673            }
1674    #endif
1675    
1676          // Retrieve the current channel list.          // Retrieve the current channel list.
1677          int *piChannelIDs = ::lscp_list_channels(m_pClient);          int *piChannelIDs = ::lscp_list_channels(m_pClient);
1678          if (piChannelIDs == NULL) {          if (piChannelIDs == NULL) {
# Line 1545  void qsamplerMainForm::updateSession (vo Line 1680  void qsamplerMainForm::updateSession (vo
1680                          appendMessagesClient("lscp_list_channels");                          appendMessagesClient("lscp_list_channels");
1681                          appendMessagesError(tr("Could not get current list of channels.\n\nSorry."));                          appendMessagesError(tr("Could not get current list of channels.\n\nSorry."));
1682                  }                  }
1683                  return;          } else {
1684                    // Try to (re)create each channel.
1685                    m_pWorkspace->setUpdatesEnabled(false);
1686                    for (int iChannel = 0; piChannelIDs[iChannel] >= 0; iChannel++) {
1687                            // Check if theres already a channel strip for this one...
1688                            if (!channelStrip(piChannelIDs[iChannel]))
1689                                    createChannelStrip(new qsamplerChannel(piChannelIDs[iChannel]));
1690                    }
1691                    m_pWorkspace->setUpdatesEnabled(true);
1692          }          }
1693    
1694          // Try to (re)create each channel.      // Do we auto-arrange?
1695          m_pWorkspace->setUpdatesEnabled(false);      if (m_pOptions && m_pOptions->bAutoArrange)
1696          for (int iChannel = 0; piChannelIDs[iChannel] >= 0; iChannel++) {          channelsArrange();
1697                  // Check if theres already a channel strip for this one...  
                 if (!channelStrip(piChannelIDs[iChannel]))  
                         createChannelStrip(new qsamplerChannel(piChannelIDs[iChannel]));  
                 // Make it visibly responsive...  
                 QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);  
         }  
         m_pWorkspace->setUpdatesEnabled(true);  
           
1698          // Remember to refresh devices and instruments...          // Remember to refresh devices and instruments...
1699          if (m_pInstrumentListForm)          if (m_pInstrumentListForm)
1700              m_pInstrumentListForm->refreshInstruments();              m_pInstrumentListForm->refreshInstruments();
# Line 1734  void qsamplerMainForm::appendMessagesErr Line 1870  void qsamplerMainForm::appendMessagesErr
1870    
1871      appendMessagesColor(s.simplifyWhiteSpace(), "#ff0000");      appendMessagesColor(s.simplifyWhiteSpace(), "#ff0000");
1872    
1873            // Make it look responsive...:)
1874            QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
1875    
1876      QMessageBox::critical(this,      QMessageBox::critical(this,
1877                  QSAMPLER_TITLE ": " + tr("Error"), s, tr("Cancel"));                  QSAMPLER_TITLE ": " + tr("Error"), s, tr("Cancel"));
1878  }  }
# Line 1748  void qsamplerMainForm::appendMessagesCli Line 1887  void qsamplerMainForm::appendMessagesCli
1887      appendMessagesColor(s + QString(": %1 (errno=%2)")      appendMessagesColor(s + QString(": %1 (errno=%2)")
1888          .arg(::lscp_client_get_result(m_pClient))          .arg(::lscp_client_get_result(m_pClient))
1889          .arg(::lscp_client_get_errno(m_pClient)), "#996666");          .arg(::lscp_client_get_errno(m_pClient)), "#996666");
1890    
1891            // Make it look responsive...:)
1892            QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
1893  }  }
1894    
1895    
# Line 1822  qsamplerChannelStrip *qsamplerMainForm:: Line 1964  qsamplerChannelStrip *qsamplerMainForm::
1964    
1965      // Actual channel strip setup...      // Actual channel strip setup...
1966      pChannelStrip->setup(pChannel);      pChannelStrip->setup(pChannel);
1967      QObject::connect(pChannelStrip, SIGNAL(channelChanged(qsamplerChannelStrip *)), this, SLOT(channelStripChanged(qsamplerChannelStrip *)));          QObject::connect(pChannelStrip,
1968                    SIGNAL(channelChanged(qsamplerChannelStrip *)),
1969                    SLOT(channelStripChanged(qsamplerChannelStrip *)));
1970      // Set some initial aesthetic options...      // Set some initial aesthetic options...
1971      if (m_pOptions) {      if (m_pOptions) {
1972          // Background display effect...          // Background display effect...
# Line 2029  void qsamplerMainForm::startServer (void Line 2173  void qsamplerMainForm::startServer (void
2173      m_pServer = new QProcess(this);      m_pServer = new QProcess(this);
2174    
2175      // Setup stdout/stderr capture...      // Setup stdout/stderr capture...
2176      //if (m_pOptions->bStdoutCapture) {          //      if (m_pOptions->bStdoutCapture) {
2177          m_pServer->setCommunication(QProcess::Stdout | QProcess::Stderr | QProcess::DupStderr);                  m_pServer->setCommunication(
2178          QObject::connect(m_pServer, SIGNAL(readyReadStdout()), this, SLOT(readServerStdout()));                          QProcess::Stdout | QProcess::Stderr | QProcess::DupStderr);
2179          QObject::connect(m_pServer, SIGNAL(readyReadStderr()), this, SLOT(readServerStdout()));                  QObject::connect(m_pServer,
2180      //}                          SIGNAL(readyReadStdout()),
2181      // The unforgiveable signal communication...                          SLOT(readServerStdout()));
2182      QObject::connect(m_pServer, SIGNAL(processExited()), this, SLOT(processServerExit()));                  QObject::connect(m_pServer,
2183                            SIGNAL(readyReadStderr()),
2184                            SLOT(readServerStdout()));
2185            //      }
2186            // The unforgiveable signal communication...
2187            QObject::connect(m_pServer,
2188                    SIGNAL(processExited()),
2189                    SLOT(processServerExit()));
2190    
2191      // Build process arguments...      // Build process arguments...
2192      m_pServer->setArguments(QStringList::split(' ', m_pOptions->sServerCmdLine));      m_pServer->setArguments(QStringList::split(' ', m_pOptions->sServerCmdLine));

Legend:
Removed from v.969  
changed lines
  Added in v.1033

  ViewVC Help
Powered by ViewVC