/[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 2978 by capela, Mon Aug 15 19:10:16 2016 UTC revision 2979 by capela, Tue Aug 16 15:34:45 2016 UTC
# Line 123  static void qsampler_sigusr1_handler ( i Line 123  static void qsampler_sigusr1_handler ( i
123    
124    
125  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
126  // qsampler -- namespace  // QSampler -- namespace
127    
128    
129  namespace QSampler {  namespace QSampler {
# Line 143  namespace QSampler { Line 143  namespace QSampler {
143    
144    
145  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
146  // LscpEvent -- specialty for LSCP callback comunication.  // QSampler::LscpEvent -- specialty for LSCP callback comunication.
   
147    
148  class LscpEvent : public QEvent  class LscpEvent : public QEvent
149  {  {
# Line 159  public: Line 158  public:
158          }          }
159    
160          // Accessors.          // Accessors.
161          lscp_event_t event() { return m_event; }          lscp_event_t  event() { return m_event; }
162          QString&     data()  { return m_data;  }          const QString& data() { return m_data;  }
163    
164  private:  private:
165    
# Line 172  private: Line 171  private:
171    
172    
173  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
174  // qsamplerMainForm -- Main window form implementation.  // QSampler::Workspace -- Main window workspace (MDI Area) decl.
175    
176    class Workspace : public QMdiArea
177    {
178    public:
179    
180            Workspace(MainForm *pMainForm) : QMdiArea(pMainForm) {}
181    
182    protected:
183    
184            void resizeEvent(QResizeEvent *)
185            {
186                    MainForm *pMainForm = static_cast<MainForm *> (parentWidget());
187                    if (pMainForm)
188                            pMainForm->channelsArrangeAuto();
189            }
190    };
191    
192    
193    //-------------------------------------------------------------------------
194    // QSampler::MainForm -- Main window form implementation.
195    
196  // Kind of singleton reference.  // Kind of singleton reference.
197  MainForm* MainForm::g_pMainForm = NULL;  MainForm *MainForm::g_pMainForm = NULL;
198    
199  MainForm::MainForm ( QWidget *pParent )  MainForm::MainForm ( QWidget *pParent )
200          : QMainWindow(pParent)          : QMainWindow(pParent)
# Line 270  MainForm::MainForm ( QWidget *pParent ) Line 289  MainForm::MainForm ( QWidget *pParent )
289  #endif  #endif
290    
291          // Make it an MDI workspace.          // Make it an MDI workspace.
292          m_pWorkspace = new QMdiArea(this);          m_pWorkspace = new Workspace(this);
293          m_pWorkspace->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);          m_pWorkspace->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
294          m_pWorkspace->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);          m_pWorkspace->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
295          // Set the activation connection.          // Set the activation connection.
# Line 695  void MainForm::customEvent ( QEvent* pEv Line 714  void MainForm::customEvent ( QEvent* pEv
714  }  }
715    
716    
 // Window resize event handler.  
 void MainForm::resizeEvent ( QResizeEvent * )  
 {  
         if (m_pOptions->bAutoArrange)  
                 channelsArrange();  
 }  
   
   
717  // LADISH Level 1 -- SIGUSR1 signal handler.  // LADISH Level 1 -- SIGUSR1 signal handler.
718  void MainForm::handle_sigusr1 (void)  void MainForm::handle_sigusr1 (void)
719  {  {
# Line 742  void MainForm::contextMenuEvent( QContex Line 753  void MainForm::contextMenuEvent( QContex
753    
754    
755  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
756  // qsamplerMainForm -- Brainless public property accessors.  // QSampler::MainForm -- Brainless public property accessors.
757    
758  // The global options settings property.  // The global options settings property.
759  Options *MainForm::options (void) const  Options *MainForm::options (void) const
# Line 766  MainForm *MainForm::getInstance (void) Line 777  MainForm *MainForm::getInstance (void)
777    
778    
779  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
780  // qsamplerMainForm -- Session file stuff.  // QSampler::MainForm -- Session file stuff.
781    
782  // Format the displayable session filename.  // Format the displayable session filename.
783  QString MainForm::sessionName ( const QString& sFilename )  QString MainForm::sessionName ( const QString& sFilename )
# Line 1360  void MainForm::sessionDirty (void) Line 1371  void MainForm::sessionDirty (void)
1371    
1372    
1373  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
1374  // qsamplerMainForm -- File Action slots.  // QSampler::MainForm -- File Action slots.
1375    
1376  // Create a new sampler session.  // Create a new sampler session.
1377  void MainForm::fileNew (void)  void MainForm::fileNew (void)
# Line 1526  void MainForm::fileExit (void) Line 1537  void MainForm::fileExit (void)
1537    
1538    
1539  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
1540  // qsamplerMainForm -- Edit Action slots.  // QSampler::MainForm -- Edit Action slots.
1541    
1542  // Add a new sampler channel.  // Add a new sampler channel.
1543  void MainForm::editAddChannel (void)  void MainForm::editAddChannel (void)
# Line 1561  void MainForm::addChannelStrip (void) Line 1572  void MainForm::addChannelStrip (void)
1572          }          }
1573    
1574          // Do we auto-arrange?          // Do we auto-arrange?
1575          if (m_pOptions && m_pOptions->bAutoArrange)          channelsArrangeAuto();
                 channelsArrange();  
1576    
1577          // Make that an overall update.          // Make that an overall update.
1578          m_iDirtyCount++;          m_iDirtyCount++;
# Line 1703  void MainForm::editResetAllChannels (voi Line 1713  void MainForm::editResetAllChannels (voi
1713    
1714    
1715  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
1716  // qsamplerMainForm -- View Action slots.  // QSampler::MainForm -- View Action slots.
1717    
1718  // Show/hide the main program window menubar.  // Show/hide the main program window menubar.
1719  void MainForm::viewMenubar ( bool bOn )  void MainForm::viewMenubar ( bool bOn )
# Line 1884  void MainForm::viewOptions (void) Line 1894  void MainForm::viewOptions (void)
1894    
1895    
1896  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
1897  // qsamplerMainForm -- Channels action slots.  // QSampler::MainForm -- Channels action slots.
1898    
1899  // Arrange channel strips.  // Arrange channel strips.
1900  void MainForm::channelsArrange (void)  void MainForm::channelsArrange (void)
# Line 1926  void MainForm::channelsAutoArrange ( boo Line 1936  void MainForm::channelsAutoArrange ( boo
1936          m_pOptions->bAutoArrange = bOn;          m_pOptions->bAutoArrange = bOn;
1937    
1938          // If on, update whole workspace...          // If on, update whole workspace...
1939          if (m_pOptions->bAutoArrange)          channelsArrangeAuto();
1940    }
1941    
1942    
1943    void MainForm::channelsArrangeAuto (void)
1944    {
1945            if (m_pOptions && m_pOptions->bAutoArrange)
1946                  channelsArrange();                  channelsArrange();
1947  }  }
1948    
1949    
1950  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
1951  // qsamplerMainForm -- Help Action slots.  // QSampler::MainForm -- Help Action slots.
1952    
1953  // Show information about the Qt toolkit.  // Show information about the Qt toolkit.
1954  void MainForm::helpAboutQt (void)  void MainForm::helpAboutQt (void)
# Line 2039  void MainForm::helpAbout (void) Line 2055  void MainForm::helpAbout (void)
2055    
2056    
2057  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
2058  // qsamplerMainForm -- Main window stabilization.  // QSampler::MainForm -- Main window stabilization.
2059    
2060  void MainForm::stabilizeForm (void)  void MainForm::stabilizeForm (void)
2061  {  {
# Line 2191  void MainForm::updateSession (void) Line 2207  void MainForm::updateSession (void)
2207          updateAllChannelStrips(false);          updateAllChannelStrips(false);
2208    
2209          // Do we auto-arrange?          // Do we auto-arrange?
2210          if (m_pOptions && m_pOptions->bAutoArrange)          channelsArrangeAuto();
                 channelsArrange();  
2211    
2212          // Remember to refresh devices and instruments...          // Remember to refresh devices and instruments...
2213          if (m_pInstrumentListForm)          if (m_pInstrumentListForm)
# Line 2225  void MainForm::updateAllChannelStrips ( Line 2240  void MainForm::updateAllChannelStrips (
2240                                  createChannelStrip(new Channel(piChannelIDs[iChannel]));                                  createChannelStrip(new Channel(piChannelIDs[iChannel]));
2241                  }                  }
2242                  // Do we auto-arrange?                  // Do we auto-arrange?
2243                  if (m_pOptions && m_pOptions->bAutoArrange)                  channelsArrangeAuto();
                         channelsArrange();  
2244                  // remove dead channel strips                  // remove dead channel strips
2245                  if (bRemoveDeadStrips) {                  if (bRemoveDeadStrips) {
2246                          const QList<QMdiSubWindow *>& wlist                          const QList<QMdiSubWindow *>& wlist
# Line 2418  void MainForm::updateMaxVolume (void) Line 2432  void MainForm::updateMaxVolume (void)
2432    
2433    
2434  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
2435  // qsamplerMainForm -- Messages window form handlers.  // QSampler::MainForm -- Messages window form handlers.
2436    
2437  // Messages output methods.  // Messages output methods.
2438  void MainForm::appendMessages( const QString& s )  void MainForm::appendMessages( const QString& s )
# Line 2530  void MainForm::updateMessagesCapture (vo Line 2544  void MainForm::updateMessagesCapture (vo
2544    
2545    
2546  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
2547  // qsamplerMainForm -- MDI channel strip management.  // QSampler::MainForm -- MDI channel strip management.
2548    
2549  // The channel strip creation executive.  // The channel strip creation executive.
2550  ChannelStrip *MainForm::createChannelStrip ( Channel *pChannel )  ChannelStrip *MainForm::createChannelStrip ( Channel *pChannel )
# Line 2590  void MainForm::destroyChannelStrip ( Cha Line 2604  void MainForm::destroyChannelStrip ( Cha
2604          delete pMdiSubWindow;          delete pMdiSubWindow;
2605    
2606          // Do we auto-arrange?          // Do we auto-arrange?
2607          if (m_pOptions && m_pOptions->bAutoArrange)          channelsArrangeAuto();
                 channelsArrange();  
2608  }  }
2609    
2610    
# Line 2700  void MainForm::channelsMenuActivated (vo Line 2713  void MainForm::channelsMenuActivated (vo
2713    
2714    
2715  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
2716  // qsamplerMainForm -- Timer stuff.  // QSampler::MainForm -- Timer stuff.
2717    
2718  // Set the pseudo-timer delay schedule.  // Set the pseudo-timer delay schedule.
2719  void MainForm::startSchedule ( int iStartDelay )  void MainForm::startSchedule ( int iStartDelay )
# Line 2773  void MainForm::timerSlot (void) Line 2786  void MainForm::timerSlot (void)
2786    
2787    
2788  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
2789  // qsamplerMainForm -- Server stuff.  // QSampler::MainForm -- Server stuff.
2790    
2791  // Start linuxsampler server...  // Start linuxsampler server...
2792  void MainForm::startServer (void)  void MainForm::startServer (void)
# Line 2937  void MainForm::processServerExit (void) Line 2950  void MainForm::processServerExit (void)
2950    
2951    
2952  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
2953  // qsamplerMainForm -- Client stuff.  // QSampler::MainForm -- Client stuff.
2954    
2955  // The LSCP client callback procedure.  // The LSCP client callback procedure.
2956  lscp_status_t qsampler_client_callback ( lscp_client_t */*pClient*/,  lscp_status_t qsampler_client_callback ( lscp_client_t */*pClient*/,

Legend:
Removed from v.2978  
changed lines
  Added in v.2979

  ViewVC Help
Powered by ViewVC