/[svn]/qsampler/trunk/src/qsamplerMainForm.cpp
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerMainForm.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2440 by capela, Thu Feb 14 14:57:43 2013 UTC revision 2441 by capela, Wed Apr 10 09:11:37 2013 UTC
# Line 276  MainForm::MainForm ( QWidget *pParent ) Line 276  MainForm::MainForm ( QWidget *pParent )
276    
277          // Make it an MDI workspace.          // Make it an MDI workspace.
278          m_pWorkspace = new QMdiArea(this);          m_pWorkspace = new QMdiArea(this);
279            m_pWorkspace->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
280            m_pWorkspace->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
281          // Set the activation connection.          // Set the activation connection.
282          QObject::connect(m_pWorkspace,          QObject::connect(m_pWorkspace,
283                  SIGNAL(subWindowActivated(QMdiSubWindow *)),                  SIGNAL(subWindowActivated(QMdiSubWindow *)),
# Line 907  bool MainForm::closeSession ( bool bForc Line 909  bool MainForm::closeSession ( bool bForc
909                                          pChannel->removeChannel();                                          pChannel->removeChannel();
910                                  delete pChannelStrip;                                  delete pChannelStrip;
911                          }                          }
912                            if (pMdiSubWindow)
913                                    delete pMdiSubWindow;
914                  }                  }
915                  m_pWorkspace->setUpdatesEnabled(true);                  m_pWorkspace->setUpdatesEnabled(true);
916                  // We're now clean, for sure.                  // We're now clean, for sure.
# Line 1250  bool MainForm::saveSessionFile ( const Q Line 1254  bool MainForm::saveSessionFile ( const Q
1254                                          ts << "SET CHANNEL MUTE " << iChannel << " 1" << endl;                                          ts << "SET CHANNEL MUTE " << iChannel << " 1" << endl;
1255                                  if (pChannel->channelSolo())                                  if (pChannel->channelSolo())
1256                                          ts << "SET CHANNEL SOLO " << iChannel << " 1" << endl;                                          ts << "SET CHANNEL SOLO " << iChannel << " 1" << endl;
1257  #ifdef CONFIG_MIDI_INSTRUMENT                          #ifdef CONFIG_MIDI_INSTRUMENT
1258                                  if (pChannel->midiMap() >= 0) {                                  if (pChannel->midiMap() >= 0) {
1259                                          ts << "SET CHANNEL MIDI_INSTRUMENT_MAP " << iChannel                                          ts << "SET CHANNEL MIDI_INSTRUMENT_MAP " << iChannel
1260                                                  << " " << midiInstrumentMap[pChannel->midiMap()] << endl;                                                  << " " << midiInstrumentMap[pChannel->midiMap()] << endl;
1261                                  }                                  }
1262  #endif                          #endif
1263  #ifdef CONFIG_FXSEND                          #ifdef CONFIG_FXSEND
1264                                  int iChannelID = pChannel->channelID();                                  int iChannelID = pChannel->channelID();
1265                                  int *piFxSends = ::lscp_list_fxsends(m_pClient, iChannelID);                                  int *piFxSends = ::lscp_list_fxsends(m_pClient, iChannelID);
1266                                  for (int iFxSend = 0;                                  for (int iFxSend = 0;
# Line 1280  bool MainForm::saveSessionFile ( const Q Line 1284  bool MainForm::saveSessionFile ( const Q
1284                                                                  << " " << iAudioSrc                                                                  << " " << iAudioSrc
1285                                                                  << " " << piRouting[iAudioSrc] << endl;                                                                  << " " << piRouting[iAudioSrc] << endl;
1286                                                  }                                                  }
1287  #ifdef CONFIG_FXSEND_LEVEL                                          #ifdef CONFIG_FXSEND_LEVEL
1288                                                  ts << "SET FX_SEND LEVEL " << iChannel                                                  ts << "SET FX_SEND LEVEL " << iChannel
1289                                                          << " " << iFxSend                                                          << " " << iFxSend
1290                                                          << " " << pFxSendInfo->level << endl;                                                          << " " << pFxSendInfo->level << endl;
1291  #endif                                          #endif
1292                                          }       // Check for errors...                                          }       // Check for errors...
1293                                          else if (::lscp_client_get_errno(m_pClient)) {                                          else if (::lscp_client_get_errno(m_pClient)) {
1294                                                  appendMessagesClient("lscp_get_fxsend_info");                                                  appendMessagesClient("lscp_get_fxsend_info");
1295                                                  iErrors++;                                                  iErrors++;
1296                                          }                                          }
1297                                  }                                  }
1298  #endif                          #endif
1299                                  ts << endl;                                  ts << endl;
1300                          }                          }
1301                  }                  }
# Line 1541  void MainForm::editRemoveChannel (void) Line 1545  void MainForm::editRemoveChannel (void)
1545          if (!pChannel->removeChannel())          if (!pChannel->removeChannel())
1546                  return;                  return;
1547    
         // Just delete the channel strip.  
         delete pChannelStrip;  
   
         // Do we auto-arrange?  
         if (m_pOptions && m_pOptions->bAutoArrange)  
                 channelsArrange();  
   
1548          // We'll be dirty, for sure...          // We'll be dirty, for sure...
1549          m_iDirtyCount++;          m_iDirtyCount++;
1550          stabilizeForm();  
1551            // Just delete the channel strip.
1552            destroyChannelStrip(pChannelStrip);
1553  }  }
1554    
1555    
# Line 2447  ChannelStrip *MainForm::createChannelStr Line 2446  ChannelStrip *MainForm::createChannelStr
2446          }          }
2447    
2448          // Add it to workspace...          // Add it to workspace...
2449          m_pWorkspace->addSubWindow(pChannelStrip, Qt::FramelessWindowHint);          m_pWorkspace->addSubWindow(pChannelStrip,
2450                    Qt::SubWindow | Qt::FramelessWindowHint);
2451    
2452          // Actual channel strip setup...          // Actual channel strip setup...
2453          pChannelStrip->setup(pChannel);          pChannelStrip->setup(pChannel);
# Line 2469  ChannelStrip *MainForm::createChannelStr Line 2469  ChannelStrip *MainForm::createChannelStr
2469    
2470  void MainForm::destroyChannelStrip ( ChannelStrip *pChannelStrip )  void MainForm::destroyChannelStrip ( ChannelStrip *pChannelStrip )
2471  {  {
2472            QMdiSubWindow *pMdiSubWindow
2473                    = static_cast<QMdiSubWindow *> (pChannelStrip->parentWidget());
2474            if (pMdiSubWindow == NULL)
2475                    return;
2476    
2477          // Just delete the channel strip.          // Just delete the channel strip.
2478          delete pChannelStrip;          delete pChannelStrip;
2479            delete pMdiSubWindow;
2480    
2481          // Do we auto-arrange?          // Do we auto-arrange?
2482          if (m_pOptions && m_pOptions->bAutoArrange)          if (m_pOptions && m_pOptions->bAutoArrange)
# Line 2689  void MainForm::startServer (void) Line 2695  void MainForm::startServer (void)
2695    
2696          // Setup stdout/stderr capture...          // Setup stdout/stderr capture...
2697  //      if (m_pOptions->bStdoutCapture) {  //      if (m_pOptions->bStdoutCapture) {
2698  #if QT_VERSION >= 0x040200          #if QT_VERSION >= 0x040200
2699                  m_pServer->setProcessChannelMode(QProcess::ForwardedChannels);                  m_pServer->setProcessChannelMode(QProcess::ForwardedChannels);
2700  #endif          #endif
2701                  QObject::connect(m_pServer,                  QObject::connect(m_pServer,
2702                          SIGNAL(readyReadStandardOutput()),                          SIGNAL(readyReadStandardOutput()),
2703                          SLOT(readServerStdout()));                          SLOT(readServerStdout()));
# Line 2756  void MainForm::stopServer (bool bInterac Line 2762  void MainForm::stopServer (bool bInterac
2762          if (m_pServer && bForceServerStop) {          if (m_pServer && bForceServerStop) {
2763                  appendMessages(tr("Server is stopping..."));                  appendMessages(tr("Server is stopping..."));
2764                  if (m_pServer->state() == QProcess::Running) {                  if (m_pServer->state() == QProcess::Running) {
2765  #if defined(WIN32)                  #if defined(WIN32)
2766                          // Try harder...                          // Try harder...
2767                          m_pServer->kill();                          m_pServer->kill();
2768  #else                  #else
2769                          // Try softly...                          // Try softly...
2770                          m_pServer->terminate();                          m_pServer->terminate();
2771  #endif                  #endif
2772                  }                  }
2773          }       // Do final processing anyway.          }       // Do final processing anyway.
2774          else processServerExit();          else processServerExit();

Legend:
Removed from v.2440  
changed lines
  Added in v.2441

  ViewVC Help
Powered by ViewVC