/[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 400 by capela, Mon Feb 21 15:02:58 2005 UTC revision 418 by capela, Wed Mar 2 16:23:10 2005 UTC
# Line 173  void qsamplerMainForm::destroy (void) Line 173  void qsamplerMainForm::destroy (void)
173  {  {
174      // Do final processing anyway.      // Do final processing anyway.
175      processServerExit();      processServerExit();
176        
177      // Delete recentfiles menu.  #if defined(WIN32)
178      if (m_pRecentFilesMenu)      WSACleanup();
179          delete m_pRecentFilesMenu;  #endif
180    
181        // Finally drop any widgets around...
182        if (m_pMessages)
183            delete m_pMessages;
184        if (m_pWorkspace)
185            delete m_pWorkspace;
186    
187      // Delete status item labels one by one.      // Delete status item labels one by one.
188      if (m_status[QSAMPLER_STATUS_CLIENT])      if (m_status[QSAMPLER_STATUS_CLIENT])
189          delete m_status[QSAMPLER_STATUS_CLIENT];          delete m_status[QSAMPLER_STATUS_CLIENT];
# Line 187  void qsamplerMainForm::destroy (void) Line 194  void qsamplerMainForm::destroy (void)
194      if (m_status[QSAMPLER_STATUS_SESSION])      if (m_status[QSAMPLER_STATUS_SESSION])
195          delete m_status[QSAMPLER_STATUS_SESSION];          delete m_status[QSAMPLER_STATUS_SESSION];
196    
197      // Finally drop any widgets around...      // Delete recentfiles menu.
198      if (m_pMessages)      if (m_pRecentFilesMenu)
199          delete m_pMessages;          delete m_pRecentFilesMenu;
     if (m_pWorkspace)  
         delete m_pWorkspace;  
   
 #if defined(WIN32)  
     WSACleanup();  
 #endif  
200  }  }
201    
202    
# Line 305  bool qsamplerMainForm::decodeDragFiles ( Line 306  bool qsamplerMainForm::decodeDragFiles (
306          if (bDecode) {          if (bDecode) {
307              files = QStringList::split('\n', sText);              files = QStringList::split('\n', sText);
308              for (QStringList::Iterator iter = files.begin(); iter != files.end(); iter++)              for (QStringList::Iterator iter = files.begin(); iter != files.end(); iter++)
309                  *iter = (*iter).stripWhiteSpace().replace(QRegExp("^file:"), QString::null);                  *iter = QUrl((*iter).stripWhiteSpace().replace(QRegExp("^file:"), QString::null)).path();
310          }          }
311      }      }
312    
# Line 329  void qsamplerMainForm::dropEvent ( QDrop Line 330  void qsamplerMainForm::dropEvent ( QDrop
330          return;          return;
331    
332      for (QStringList::Iterator iter = files.begin(); iter != files.end(); iter++) {      for (QStringList::Iterator iter = files.begin(); iter != files.end(); iter++) {
333                  const QString& sPath = QUrl(*iter).path();                  const QString& sPath = *iter;
334                  if (qsamplerChannel::isInstrumentFile(sPath)) {                  if (qsamplerChannel::isInstrumentFile(sPath)) {
335                          // Try to create a new channel from instrument file...                          // Try to create a new channel from instrument file...
336                      qsamplerChannel *pChannel = new qsamplerChannel(this);                      qsamplerChannel *pChannel = new qsamplerChannel(this);
# Line 647  bool qsamplerMainForm::saveSessionFile ( Line 648  bool qsamplerMainForm::saveSessionFile (
648          if (pChannelStrip) {          if (pChannelStrip) {
649              qsamplerChannel *pChannel = pChannelStrip->channel();              qsamplerChannel *pChannel = pChannelStrip->channel();
650              if (pChannel) {              if (pChannel) {
651                  int iChannelID = pChannel->channelID();                  ts << "# Channel " << iChannel << endl;
                 ts << "# " << pChannelStrip->caption() << endl;  
652                  ts << "ADD CHANNEL" << endl;                  ts << "ADD CHANNEL" << endl;
653                  ts << "SET CHANNEL AUDIO_OUTPUT_TYPE " << iChannelID << " " << pChannel->audioDriver() << endl;                  ts << "SET CHANNEL AUDIO_OUTPUT_TYPE " << iChannel << " " << pChannel->audioDriver() << endl;
654                  ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannelID << " " << pChannel->midiDriver() << endl;                  ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannel << " " << pChannel->midiDriver() << endl;
655                  ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannelID << " " << pChannel->midiPort() << endl;              //  ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannel << " " << pChannel->midiPort() << endl;
656                  ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannelID << " ";                  ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannel << " ";
657                  if (pChannel->midiChannel() == LSCP_MIDI_CHANNEL_ALL)                  if (pChannel->midiChannel() == LSCP_MIDI_CHANNEL_ALL)
658                      ts << "ALL";                      ts << "ALL";
659                  else                  else
660                      ts << pChannel->midiChannel();                      ts << pChannel->midiChannel();
661                  ts << endl;                  ts << endl;
662                  ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannelID << endl;                  ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannel << endl;
663                  ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' " << pChannel->instrumentNr() << " " << iChannelID << endl;                  ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' " << pChannel->instrumentNr() << " " << iChannel << endl;
664                  ts << "SET CHANNEL VOLUME " << iChannelID << " " << pChannel->volume() << endl;                  ts << "SET CHANNEL VOLUME " << iChannel << " " << pChannel->volume() << endl;
665                  ts << endl;                  ts << endl;
666              }              }
667          }          }
# Line 910  void qsamplerMainForm::editResetChannel Line 910  void qsamplerMainForm::editResetChannel
910  }  }
911    
912    
913    // Reset all sampler channels.
914    void qsamplerMainForm::editResetAllChannels (void)
915    {
916        if (m_pClient == NULL)
917            return;
918    
919        // Invoque the channel strip procedure,
920            // for all channels out there...
921        m_pWorkspace->setUpdatesEnabled(false);
922        QWidgetList wlist = m_pWorkspace->windowList();
923        for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) {
924            qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel);
925            if (pChannelStrip)
926                    pChannelStrip->channelReset();
927        }
928        m_pWorkspace->setUpdatesEnabled(true);
929    }
930    
931    
932  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
933  // qsamplerMainForm -- View Action slots.  // qsamplerMainForm -- View Action slots.
934    
# Line 1150  void qsamplerMainForm::helpAbout (void) Line 1169  void qsamplerMainForm::helpAbout (void)
1169  void qsamplerMainForm::stabilizeForm (void)  void qsamplerMainForm::stabilizeForm (void)
1170  {  {
1171      // Update the main application caption...      // Update the main application caption...
1172      QString sSessioName = sessionName(m_sFilename);      QString sSessionName = sessionName(m_sFilename);
1173      if (m_iDirtyCount > 0)      if (m_iDirtyCount > 0)
1174          sSessioName += '*';          sSessionName += '*';
1175      setCaption(tr(QSAMPLER_TITLE " - [%1]").arg(sSessioName));      setCaption(tr(QSAMPLER_TITLE " - [%1]").arg(sSessionName));
1176    
1177      // Update the main menu state...      // Update the main menu state...
1178      qsamplerChannelStrip *pChannelStrip = activeChannelStrip();      qsamplerChannelStrip *pChannelStrip = activeChannelStrip();
# Line 1169  void qsamplerMainForm::stabilizeForm (vo Line 1188  void qsamplerMainForm::stabilizeForm (vo
1188      editRemoveChannelAction->setEnabled(bHasChannel);      editRemoveChannelAction->setEnabled(bHasChannel);
1189      editSetupChannelAction->setEnabled(bHasChannel);      editSetupChannelAction->setEnabled(bHasChannel);
1190      editResetChannelAction->setEnabled(bHasChannel);      editResetChannelAction->setEnabled(bHasChannel);
1191        editResetAllChannelsAction->setEnabled(bHasChannel);
1192      channelsArrangeAction->setEnabled(bHasChannel);      channelsArrangeAction->setEnabled(bHasChannel);
1193      viewMessagesAction->setOn(m_pMessages && m_pMessages->isVisible());      viewMessagesAction->setOn(m_pMessages && m_pMessages->isVisible());
1194    

Legend:
Removed from v.400  
changed lines
  Added in v.418

  ViewVC Help
Powered by ViewVC