/[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 302 by capela, Wed Nov 17 17:17:18 2004 UTC revision 304 by capela, Fri Nov 19 11:55:18 2004 UTC
# Line 544  bool qsamplerMainForm::loadSessionFile ( Line 544  bool qsamplerMainForm::loadSessionFile (
544          appendMessagesError(tr("Some setttings could not be loaded\nfrom \"%1\" session file.\n\nSorry.").arg(sFilename));          appendMessagesError(tr("Some setttings could not be loaded\nfrom \"%1\" session file.\n\nSorry.").arg(sFilename));
545    
546      // Now we'll try to create the whole GUI session.      // Now we'll try to create the whole GUI session.
547      int iChannels = ::lscp_get_channels(m_pClient);      int *piChannelIDs = ::lscp_list_channels(m_pClient);
548      if (iChannels < 0) {      if (piChannelIDs == NULL) {
549          appendMessagesClient("lscp_get_channels");          appendMessagesClient("lscp_list_channels");
550          appendMessagesError(tr("Could not get current number of channels.\n\nSorry."));          appendMessagesError(tr("Could not get current list of channels.\n\nSorry."));
551      }      }
552            
553      // Try to (re)create each channel.      // Try to (re)create each channel.
554      m_pWorkspace->setUpdatesEnabled(false);      m_pWorkspace->setUpdatesEnabled(false);
555      for (int iChannelID = 0; iChannelID < iChannels; iChannelID++) {      for (int iChannel = 0; piChannelIDs[iChannel] >= 0; iChannel++) {
556          createChannelStrip(iChannelID);          createChannelStrip(new qsamplerChannel(this, piChannelIDs[iChannel]));
557          QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);          QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
558      }      }
559      m_pWorkspace->setUpdatesEnabled(true);      m_pWorkspace->setUpdatesEnabled(true);
# Line 614  bool qsamplerMainForm::saveSessionFile ( Line 614  bool qsamplerMainForm::saveSessionFile (
614                  ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannelID << " " << pChannel->midiDriver() << endl;                  ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannelID << " " << pChannel->midiDriver() << endl;
615                  ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannelID << " " << pChannel->midiPort() << endl;                  ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannelID << " " << pChannel->midiPort() << endl;
616                  ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannelID << " ";                  ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannelID << " ";
617                  if (pChannel->midiChannel() > 0)                  if (pChannel->midiChannel() == LSCP_MIDI_CHANNEL_ALL)
                     ts << pChannel->midiChannel();  
                  else  
618                      ts << "ALL";                      ts << "ALL";
619                    else
620                        ts << pChannel->midiChannel();
621                  ts << endl;                  ts << endl;
622                  ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannelID << endl;                  ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannelID << endl;
623                  ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' " << pChannel->instrumentNr() << " " << iChannelID << endl;                  ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' " << pChannel->instrumentNr() << " " << iChannelID << endl;
# Line 771  void qsamplerMainForm::editAddChannel (v Line 771  void qsamplerMainForm::editAddChannel (v
771      if (m_pClient == NULL)      if (m_pClient == NULL)
772          return;          return;
773    
774      // Just create the channel strip,      // Just create the channel instance...
775      // by giving an invalid channel id.      qsamplerChannel *pChannel = new qsamplerChannel(this);
776      createChannelStrip(-1);      if (pChannel == NULL)
777            return;
778    
779        // Before we show it up, may be we'll
780        // better ask for some initial values?
781        if (!pChannel->channelSetup(this)) {
782            delete pChannel;
783            return;
784        }
785        
786        // And give it to the strip (will own the channel instance, if successful).
787        if (!createChannelStrip(pChannel)) {
788            delete pChannel;
789            return;
790        }
791    
792        // Make that an overall update.
793        m_iDirtyCount++;
794        m_iChangeCount++;
795        stabilizeForm();
796  }  }
797    
798    
# Line 1358  void qsamplerMainForm::updateMessagesCap Line 1377  void qsamplerMainForm::updateMessagesCap
1377  // qsamplerMainForm -- MDI channel strip management.  // qsamplerMainForm -- MDI channel strip management.
1378    
1379  // The channel strip creation executive.  // The channel strip creation executive.
1380  qsamplerChannelStrip *qsamplerMainForm::createChannelStrip ( int iChannelID )  qsamplerChannelStrip *qsamplerMainForm::createChannelStrip ( qsamplerChannel *pChannel )
1381  {  {
1382      if (m_pClient == NULL)      if (m_pClient == NULL || pChannel == NULL)
1383          return NULL;          return NULL;
1384    
1385      // Prepare for auto-arrange?      // Prepare for auto-arrange?
# Line 1378  qsamplerChannelStrip *qsamplerMainForm:: Line 1397  qsamplerChannelStrip *qsamplerMainForm::
1397      // Add a new channel itema...      // Add a new channel itema...
1398      WFlags wflags = Qt::WStyle_Customize | Qt::WStyle_Tool | Qt::WStyle_Title | Qt::WStyle_NoBorder;      WFlags wflags = Qt::WStyle_Customize | Qt::WStyle_Tool | Qt::WStyle_Title | Qt::WStyle_NoBorder;
1399      pChannelStrip = new qsamplerChannelStrip(m_pWorkspace, 0, wflags);      pChannelStrip = new qsamplerChannelStrip(m_pWorkspace, 0, wflags);
1400      // Actual channel setup.      if (pChannelStrip == NULL)
     pChannelStrip->setup(this, iChannelID);  
     QObject::connect(pChannelStrip, SIGNAL(channelChanged(qsamplerChannelStrip *)), this, SLOT(channelStripChanged(qsamplerChannelStrip *)));  
     // Before we show it up, may be we'll  
     // better ask for some initial values?  
     if (iChannelID < 0 && !pChannelStrip->channelSetup()) {  
         // No luck, bail out...  
         delete pChannelStrip;  
1401          return NULL;          return NULL;
1402      }          
1403        // Actual channel strip setup...
1404        pChannelStrip->setup(pChannel);
1405        QObject::connect(pChannelStrip, SIGNAL(channelChanged(qsamplerChannelStrip *)), this, SLOT(channelStripChanged(qsamplerChannelStrip *)));
1406      // Set some initial aesthetic options...      // Set some initial aesthetic options...
1407      if (m_pOptions) {      if (m_pOptions) {
1408          // Background display effect...          // Background display effect...

Legend:
Removed from v.302  
changed lines
  Added in v.304

  ViewVC Help
Powered by ViewVC