/[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 1514 by capela, Fri Nov 23 10:51:37 2007 UTC revision 1515 by capela, Fri Nov 23 18:15:33 2007 UTC
# Line 171  MainForm::MainForm ( QWidget *pParent ) Line 171  MainForm::MainForm ( QWidget *pParent )
171          // Volume slider...          // Volume slider...
172          m_ui.channelsToolbar->addSeparator();          m_ui.channelsToolbar->addSeparator();
173          m_pVolumeSlider = new QSlider(Qt::Horizontal, m_ui.channelsToolbar);          m_pVolumeSlider = new QSlider(Qt::Horizontal, m_ui.channelsToolbar);
174          m_pVolumeSlider->setTickPosition(QSlider::TicksBelow);          m_pVolumeSlider->setTickPosition(QSlider::TicksBothSides);
175          m_pVolumeSlider->setTickInterval(10);          m_pVolumeSlider->setTickInterval(10);
176          m_pVolumeSlider->setPageStep(10);          m_pVolumeSlider->setPageStep(10);
177          m_pVolumeSlider->setSingleStep(10);          m_pVolumeSlider->setSingleStep(10);
# Line 189  MainForm::MainForm ( QWidget *pParent ) Line 189  MainForm::MainForm ( QWidget *pParent )
189          // Volume spin-box          // Volume spin-box
190          m_ui.channelsToolbar->addSeparator();          m_ui.channelsToolbar->addSeparator();
191          m_pVolumeSpinBox = new QSpinBox(m_ui.channelsToolbar);          m_pVolumeSpinBox = new QSpinBox(m_ui.channelsToolbar);
192            m_pVolumeSpinBox->setMaximumHeight(24);
193          m_pVolumeSpinBox->setSuffix(" %");          m_pVolumeSpinBox->setSuffix(" %");
194          m_pVolumeSpinBox->setMinimum(0);          m_pVolumeSpinBox->setMinimum(0);
195          m_pVolumeSpinBox->setMaximum(100);          m_pVolumeSpinBox->setMaximum(100);
# Line 1331  void MainForm::editAddChannel (void) Line 1332  void MainForm::editAddChannel (void)
1332                  return;                  return;
1333          }          }
1334    
1335            // Do we auto-arrange?
1336            if (m_pOptions && m_pOptions->bAutoArrange)
1337                    channelsArrange();
1338    
1339          // Make that an overall update.          // Make that an overall update.
1340          m_iDirtyCount++;          m_iDirtyCount++;
1341          stabilizeForm();          stabilizeForm();
# Line 2171  void MainForm::updateMessagesCapture (vo Line 2176  void MainForm::updateMessagesCapture (vo
2176  // qsamplerMainForm -- MDI channel strip management.  // qsamplerMainForm -- MDI channel strip management.
2177    
2178  // The channel strip creation executive.  // The channel strip creation executive.
2179  ChannelStrip* MainForm::createChannelStrip(qsamplerChannel* pChannel)  ChannelStrip* MainForm::createChannelStrip ( qsamplerChannel *pChannel )
2180  {  {
2181          if (m_pClient == NULL || pChannel == NULL)          if (m_pClient == NULL || pChannel == NULL)
2182                  return NULL;                  return NULL;
2183    
         // Prepare for auto-arrange?  
         ChannelStrip* pChannelStrip = NULL;  
         int y = 0;  
         if (m_pOptions && m_pOptions->bAutoArrange) {  
                 QWidgetList wlist = m_pWorkspace->windowList();  
                 for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) {  
                         pChannelStrip = static_cast<ChannelStrip *> (wlist.at(iChannel));  
                         if (pChannelStrip) {  
                         //  y += pChannelStrip->height()  
                         //              + pChannelStrip->parentWidget()->baseSize().height();  
                                 y += pChannelStrip->parentWidget()->frameGeometry().height();  
                         }  
                 }  
         }  
   
2184          // Add a new channel itema...          // Add a new channel itema...
2185          pChannelStrip = new ChannelStrip();          ChannelStrip *pChannelStrip = new ChannelStrip();
2186          if (pChannelStrip == NULL)          if (pChannelStrip == NULL)
2187                  return NULL;                  return NULL;
2188    
2189          m_pWorkspace->addWindow(pChannelStrip, Qt::FramelessWindowHint);          // Set some initial channel strip options...
   
         // Actual channel strip setup...  
         pChannelStrip->setup(pChannel);  
         QObject::connect(pChannelStrip,  
                 SIGNAL(channelChanged(ChannelStrip*)),  
                 SLOT(channelStripChanged(ChannelStrip*)));  
         // Set some initial aesthetic options...  
2190          if (m_pOptions) {          if (m_pOptions) {
2191                  // Background display effect...                  // Background display effect...
2192                  pChannelStrip->setDisplayEffect(m_pOptions->bDisplayEffect);                  pChannelStrip->setDisplayEffect(m_pOptions->bDisplayEffect);
# Line 2215  ChannelStrip* MainForm::createChannelStr Line 2198  ChannelStrip* MainForm::createChannelStr
2198                  pChannelStrip->setMaxVolume(m_pOptions->iMaxVolume);                  pChannelStrip->setMaxVolume(m_pOptions->iMaxVolume);
2199          }          }
2200    
2201            // Add it to workspace...
2202            m_pWorkspace->addWindow(pChannelStrip, Qt::FramelessWindowHint);
2203    
2204            // Actual channel strip setup...
2205            pChannelStrip->setup(pChannel);
2206    
2207            QObject::connect(pChannelStrip,
2208                    SIGNAL(channelChanged(ChannelStrip*)),
2209                    SLOT(channelStripChanged(ChannelStrip*)));
2210    
2211          // Now we show up us to the world.          // Now we show up us to the world.
2212          pChannelStrip->show();          pChannelStrip->show();
         // Only then, we'll auto-arrange...  
         if (m_pOptions && m_pOptions->bAutoArrange) {  
                 int iWidth  = m_pWorkspace->width();  
         //  int iHeight = pChannel->height()  
         //              + pChannel->parentWidget()->baseSize().height();  
                 int iHeight = pChannelStrip->parentWidget()->frameGeometry().height();  
                 pChannelStrip->parentWidget()->setGeometry(0, y, iWidth, iHeight);  
         }  
2213    
2214          // This is pretty new, so we'll watch for it closely.          // This is pretty new, so we'll watch for it closely.
2215          channelStripChanged(pChannelStrip);          channelStripChanged(pChannelStrip);

Legend:
Removed from v.1514  
changed lines
  Added in v.1515

  ViewVC Help
Powered by ViewVC