/[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 2387 by capela, Sat Dec 29 00:21:11 2012 UTC revision 2459 by capela, Mon Jul 8 10:06:57 2013 UTC
# Line 1  Line 1 
1  // qsamplerMainForm.cpp  // qsamplerMainForm.cpp
2  //  //
3  /****************************************************************************  /****************************************************************************
4     Copyright (C) 2004-2012, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2004-2013, rncbc aka Rui Nuno Capela. All rights reserved.
5     Copyright (C) 2007, 2008 Christian Schoenebeck     Copyright (C) 2007, 2008 Christian Schoenebeck
6    
7     This program is free software; you can redistribute it and/or     This program is free software; you can redistribute it and/or
# Line 65  Line 65 
65  #if QT_VERSION < 0x040500  #if QT_VERSION < 0x040500
66  namespace Qt {  namespace Qt {
67  const WindowFlags WindowCloseButtonHint = WindowFlags(0x08000000);  const WindowFlags WindowCloseButtonHint = WindowFlags(0x08000000);
 #if QT_VERSION < 0x040200  
 const WindowFlags CustomizeWindowHint   = WindowFlags(0x02000000);  
 #endif  
68  }  }
69  #endif  #endif
70    
# Line 276  MainForm::MainForm ( QWidget *pParent ) Line 273  MainForm::MainForm ( QWidget *pParent )
273    
274          // Make it an MDI workspace.          // Make it an MDI workspace.
275          m_pWorkspace = new QMdiArea(this);          m_pWorkspace = new QMdiArea(this);
276            m_pWorkspace->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
277            m_pWorkspace->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
278          // Set the activation connection.          // Set the activation connection.
279          QObject::connect(m_pWorkspace,          QObject::connect(m_pWorkspace,
280                  SIGNAL(subWindowActivated(QMdiSubWindow *)),                  SIGNAL(subWindowActivated(QMdiSubWindow *)),
# Line 907  bool MainForm::closeSession ( bool bForc Line 906  bool MainForm::closeSession ( bool bForc
906                                          pChannel->removeChannel();                                          pChannel->removeChannel();
907                                  delete pChannelStrip;                                  delete pChannelStrip;
908                          }                          }
909                            if (pMdiSubWindow)
910                                    delete pMdiSubWindow;
911                  }                  }
912                  m_pWorkspace->setUpdatesEnabled(true);                  m_pWorkspace->setUpdatesEnabled(true);
913                  // We're now clean, for sure.                  // We're now clean, for sure.
# Line 1250  bool MainForm::saveSessionFile ( const Q Line 1251  bool MainForm::saveSessionFile ( const Q
1251                                          ts << "SET CHANNEL MUTE " << iChannel << " 1" << endl;                                          ts << "SET CHANNEL MUTE " << iChannel << " 1" << endl;
1252                                  if (pChannel->channelSolo())                                  if (pChannel->channelSolo())
1253                                          ts << "SET CHANNEL SOLO " << iChannel << " 1" << endl;                                          ts << "SET CHANNEL SOLO " << iChannel << " 1" << endl;
1254  #ifdef CONFIG_MIDI_INSTRUMENT                          #ifdef CONFIG_MIDI_INSTRUMENT
1255                                  if (pChannel->midiMap() >= 0) {                                  if (pChannel->midiMap() >= 0) {
1256                                          ts << "SET CHANNEL MIDI_INSTRUMENT_MAP " << iChannel                                          ts << "SET CHANNEL MIDI_INSTRUMENT_MAP " << iChannel
1257                                                  << " " << midiInstrumentMap[pChannel->midiMap()] << endl;                                                  << " " << midiInstrumentMap[pChannel->midiMap()] << endl;
1258                                  }                                  }
1259  #endif                          #endif
1260  #ifdef CONFIG_FXSEND                          #ifdef CONFIG_FXSEND
1261                                  int iChannelID = pChannel->channelID();                                  int iChannelID = pChannel->channelID();
1262                                  int *piFxSends = ::lscp_list_fxsends(m_pClient, iChannelID);                                  int *piFxSends = ::lscp_list_fxsends(m_pClient, iChannelID);
1263                                  for (int iFxSend = 0;                                  for (int iFxSend = 0;
# Line 1280  bool MainForm::saveSessionFile ( const Q Line 1281  bool MainForm::saveSessionFile ( const Q
1281                                                                  << " " << iAudioSrc                                                                  << " " << iAudioSrc
1282                                                                  << " " << piRouting[iAudioSrc] << endl;                                                                  << " " << piRouting[iAudioSrc] << endl;
1283                                                  }                                                  }
1284  #ifdef CONFIG_FXSEND_LEVEL                                          #ifdef CONFIG_FXSEND_LEVEL
1285                                                  ts << "SET FX_SEND LEVEL " << iChannel                                                  ts << "SET FX_SEND LEVEL " << iChannel
1286                                                          << " " << iFxSend                                                          << " " << iFxSend
1287                                                          << " " << pFxSendInfo->level << endl;                                                          << " " << pFxSendInfo->level << endl;
1288  #endif                                          #endif
1289                                          }       // Check for errors...                                          }       // Check for errors...
1290                                          else if (::lscp_client_get_errno(m_pClient)) {                                          else if (::lscp_client_get_errno(m_pClient)) {
1291                                                  appendMessagesClient("lscp_get_fxsend_info");                                                  appendMessagesClient("lscp_get_fxsend_info");
1292                                                  iErrors++;                                                  iErrors++;
1293                                          }                                          }
1294                                  }                                  }
1295  #endif                          #endif
1296                                  ts << endl;                                  ts << endl;
1297                          }                          }
1298                  }                  }
# Line 1541  void MainForm::editRemoveChannel (void) Line 1542  void MainForm::editRemoveChannel (void)
1542          if (!pChannel->removeChannel())          if (!pChannel->removeChannel())
1543                  return;                  return;
1544    
         // Just delete the channel strip.  
         delete pChannelStrip;  
   
         // Do we auto-arrange?  
         if (m_pOptions && m_pOptions->bAutoArrange)  
                 channelsArrange();  
   
1545          // We'll be dirty, for sure...          // We'll be dirty, for sure...
1546          m_iDirtyCount++;          m_iDirtyCount++;
1547          stabilizeForm();  
1548            // Just delete the channel strip.
1549            destroyChannelStrip(pChannelStrip);
1550  }  }
1551    
1552    
# Line 2447  ChannelStrip *MainForm::createChannelStr Line 2443  ChannelStrip *MainForm::createChannelStr
2443          }          }
2444    
2445          // Add it to workspace...          // Add it to workspace...
2446          m_pWorkspace->addSubWindow(pChannelStrip, Qt::FramelessWindowHint);          m_pWorkspace->addSubWindow(pChannelStrip,
2447                    Qt::SubWindow | Qt::FramelessWindowHint);
2448    
2449          // Actual channel strip setup...          // Actual channel strip setup...
2450          pChannelStrip->setup(pChannel);          pChannelStrip->setup(pChannel);
# Line 2469  ChannelStrip *MainForm::createChannelStr Line 2466  ChannelStrip *MainForm::createChannelStr
2466    
2467  void MainForm::destroyChannelStrip ( ChannelStrip *pChannelStrip )  void MainForm::destroyChannelStrip ( ChannelStrip *pChannelStrip )
2468  {  {
2469            QMdiSubWindow *pMdiSubWindow
2470                    = static_cast<QMdiSubWindow *> (pChannelStrip->parentWidget());
2471            if (pMdiSubWindow == NULL)
2472                    return;
2473    
2474          // Just delete the channel strip.          // Just delete the channel strip.
2475          delete pChannelStrip;          delete pChannelStrip;
2476            delete pMdiSubWindow;
2477    
2478          // Do we auto-arrange?          // Do we auto-arrange?
2479          if (m_pOptions && m_pOptions->bAutoArrange)          if (m_pOptions && m_pOptions->bAutoArrange)
# Line 2689  void MainForm::startServer (void) Line 2692  void MainForm::startServer (void)
2692    
2693          // Setup stdout/stderr capture...          // Setup stdout/stderr capture...
2694  //      if (m_pOptions->bStdoutCapture) {  //      if (m_pOptions->bStdoutCapture) {
 #if QT_VERSION >= 0x040200  
2695                  m_pServer->setProcessChannelMode(QProcess::ForwardedChannels);                  m_pServer->setProcessChannelMode(QProcess::ForwardedChannels);
 #endif  
2696                  QObject::connect(m_pServer,                  QObject::connect(m_pServer,
2697                          SIGNAL(readyReadStandardOutput()),                          SIGNAL(readyReadStandardOutput()),
2698                          SLOT(readServerStdout()));                          SLOT(readServerStdout()));
# Line 2756  void MainForm::stopServer (bool bInterac Line 2757  void MainForm::stopServer (bool bInterac
2757          if (m_pServer && bForceServerStop) {          if (m_pServer && bForceServerStop) {
2758                  appendMessages(tr("Server is stopping..."));                  appendMessages(tr("Server is stopping..."));
2759                  if (m_pServer->state() == QProcess::Running) {                  if (m_pServer->state() == QProcess::Running) {
2760  #if defined(WIN32)                  #if defined(WIN32)
2761                          // Try harder...                          // Try harder...
2762                          m_pServer->kill();                          m_pServer->kill();
2763  #else                  #else
2764                          // Try softly...                          // Try softly...
2765                          m_pServer->terminate();                          m_pServer->terminate();
2766  #endif                  #endif
2767                  }                  }
2768          }       // Do final processing anyway.          }       // Do final processing anyway.
2769          else processServerExit();          else processServerExit();

Legend:
Removed from v.2387  
changed lines
  Added in v.2459

  ViewVC Help
Powered by ViewVC