/[svn]/qsampler/trunk/src/qsamplerChannelStrip.ui.h
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerChannelStrip.ui.h

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

revision 265 by capela, Wed Sep 29 16:05:24 2004 UTC revision 297 by capela, Wed Nov 17 12:40:25 2004 UTC
# Line 25  Line 25 
25  #include <qfileinfo.h>  #include <qfileinfo.h>
26  #include <qtooltip.h>  #include <qtooltip.h>
27  #include <qpopupmenu.h>  #include <qpopupmenu.h>
28    #include <qobjectlist.h>
29    
30  #include <math.h>  #include <math.h>
31    
# Line 70  void qsamplerChannelStrip::setup ( qsamp Line 71  void qsamplerChannelStrip::setup ( qsamp
71      // Create a new one...      // Create a new one...
72      m_pChannel = new qsamplerChannel(pMainForm);      m_pChannel = new qsamplerChannel(pMainForm);
73      // And set appropriate settings.      // And set appropriate settings.
74      if (m_pChannel) {      if (m_pChannel && iChannelID >= 0) {
75          m_pChannel->setChannelID(iChannelID);          m_pChannel->setChannelID(iChannelID);
76          m_iDirtyChange = 0;          m_iDirtyChange = 0;
77      }      }
# Line 101  void qsamplerChannelStrip::setDisplayFon Line 102  void qsamplerChannelStrip::setDisplayFon
102  }  }
103    
104    
105  // Channel setup dialog slot.  // Channel display background effect.
106  void qsamplerChannelStrip::channelSetup (void)  void qsamplerChannelStrip::setDisplayEffect ( bool bDisplayEffect )
107    {
108        QPixmap pm;
109        if (bDisplayEffect)
110            pm = QPixmap::fromMimeSource("displaybg1.png");
111        setDisplayBackground(pm);
112    }
113    
114    
115    // Update main display background pixmap.
116    void qsamplerChannelStrip::setDisplayBackground ( const QPixmap& pm )
117  {  {
118      showChannelSetup(false);      // Set the main origin...
119        ChannelInfoFrame->setPaletteBackgroundPixmap(pm);
120    
121        // Iterate for every child text label...
122        QObjectList *pList = ChannelInfoFrame->queryList("QLabel");
123        if (pList) {
124            for (QLabel *pLabel = (QLabel *) pList->first(); pLabel; pLabel = (QLabel *) pList->next())
125                pLabel->setPaletteBackgroundPixmap(pm);
126            delete pList;
127        }
128        
129        // And this standalone too.
130        StreamVoiceCountTextLabel->setPaletteBackgroundPixmap(pm);
131  }  }
132    
133    
134  // Channel setup dialog.  // Channel setup dialog slot.
135  void qsamplerChannelStrip::showChannelSetup ( bool bNew )  bool qsamplerChannelStrip::channelSetup (void)
136  {  {
137        bool bResult = false;
138    
139      qsamplerChannelForm *pChannelForm = new qsamplerChannelForm(this);      qsamplerChannelForm *pChannelForm = new qsamplerChannelForm(this);
140      if (pChannelForm) {      if (pChannelForm) {
141          pChannelForm->setup(m_pChannel, bNew);          pChannelForm->setup(m_pChannel);
142          if (pChannelForm->exec()) {          bResult = pChannelForm->exec();
             updateChannelInfo();  
             emit channelChanged(this);  
         }  
143          delete pChannelForm;          delete pChannelForm;
144      }      }
145    
146        if (bResult)
147            emit channelChanged(this);
148    
149        return bResult;
150  }  }
151    
152    
153  // Update whole channel info state.  // Update whole channel info state.
154  void qsamplerChannelStrip::updateChannelInfo (void)  bool qsamplerChannelStrip::updateChannelInfo (void)
155  {  {
156      if (m_pChannel == NULL)      if (m_pChannel == NULL)
157          return;          return false;
158                    
159      // Update strip caption.      // Update strip caption.
160      QString sText = tr("Channel %1").arg(m_pChannel->channelID());      QString sText = m_pChannel->channelName();
161      setCaption(sText);      setCaption(sText);
162      ChannelSetupPushButton->setText(sText);      ChannelSetupPushButton->setText(sText);
163    
164      // Check if we're up and connected.      // Check if we're up and connected.
165      if (m_pChannel->client() == NULL)      if (m_pChannel->client() == NULL)
166          return;          return false;
167    
168      // Read actual channel information.      // Read actual channel information.
169      m_pChannel->updateChannelInfo();      m_pChannel->updateChannelInfo();
# Line 168  void qsamplerChannelStrip::updateChannel Line 195  void qsamplerChannelStrip::updateChannel
195      }      }
196    
197      // MIDI Port/Channel...      // MIDI Port/Channel...
198      if (m_pChannel->midiChannel() > 0)      if (m_pChannel->midiChannel() == LSCP_MIDI_CHANNEL_ALL)
         MidiPortChannelTextLabel->setText(QString("%1 / %2").arg(m_pChannel->midiPort()).arg(m_pChannel->midiChannel()));  
     else  
199          MidiPortChannelTextLabel->setText(QString("%1 / *").arg(m_pChannel->midiPort()));          MidiPortChannelTextLabel->setText(QString("%1 / *").arg(m_pChannel->midiPort()));
200        else
201            MidiPortChannelTextLabel->setText(QString("%1 / %2").arg(m_pChannel->midiPort()).arg(m_pChannel->midiChannel() + 1));
202    
203      // And update the both GUI volume elements.      // And update the both GUI volume elements.
204      updateChannelVolume();      return updateChannelVolume();
205  }  }
206    
207    
208  // Do the dirty volume change.  // Do the dirty volume change.
209  void qsamplerChannelStrip::updateChannelVolume (void)  bool qsamplerChannelStrip::updateChannelVolume (void)
210  {  {
211      if (m_pChannel == NULL)      if (m_pChannel == NULL)
212          return;          return false;
213    
214      // Convert...      // Convert...
215  #ifdef CONFIG_ROUND  #ifdef CONFIG_ROUND
# Line 207  void qsamplerChannelStrip::updateChannel Line 234  void qsamplerChannelStrip::updateChannel
234      VolumeSlider->setValue(iVolume);      VolumeSlider->setValue(iVolume);
235      VolumeSpinBox->setValue(iVolume);      VolumeSpinBox->setValue(iVolume);
236      m_iDirtyChange--;      m_iDirtyChange--;
237        
238        return true;
239  }  }
240    
241    
242  // Update whole channel usage state.  // Update whole channel usage state.
243  void qsamplerChannelStrip::updateChannelUsage (void)  bool qsamplerChannelStrip::updateChannelUsage (void)
244  {  {
245      if (m_pChannel == NULL)      if (m_pChannel == NULL)
246          return;          return false;
247      if (m_pChannel->client() == NULL)      if (m_pChannel->client() == NULL)
248          return;          return false;
249    
250      // Conditionally update whole channel status info.      // Conditionally update whole channel status info.
251      if (m_pChannel->instrumentStatus() >= 0 && m_pChannel->instrumentStatus() < 100) {      if (m_pChannel->instrumentStatus() >= 0 && m_pChannel->instrumentStatus() < 100) {
# Line 227  void qsamplerChannelStrip::updateChannel Line 256  void qsamplerChannelStrip::updateChannel
256      }      }
257      // Leave, if we still have an erroneus or incomplete instrument load.      // Leave, if we still have an erroneus or incomplete instrument load.
258      if (m_pChannel->instrumentStatus() < 100)      if (m_pChannel->instrumentStatus() < 100)
259          return;          return false;
260    
261      // Get current channel voice count.      // Get current channel voice count.
262      int iVoiceCount  = ::lscp_get_channel_voice_count(m_pChannel->client(), m_pChannel->channelID());      int iVoiceCount  = ::lscp_get_channel_voice_count(m_pChannel->client(), m_pChannel->channelID());
# Line 241  void qsamplerChannelStrip::updateChannel Line 270  void qsamplerChannelStrip::updateChannel
270      // Update the GUI elements...      // Update the GUI elements...
271      StreamUsageProgressBar->setProgress(iStreamUsage);      StreamUsageProgressBar->setProgress(iStreamUsage);
272      StreamVoiceCountTextLabel->setText(QString("%1 / %2").arg(iStreamCount).arg(iVoiceCount));      StreamVoiceCountTextLabel->setText(QString("%1 / %2").arg(iStreamCount).arg(iVoiceCount));
273        
274        // We're clean.
275        return true;
276  }  }
277    
278    

Legend:
Removed from v.265  
changed lines
  Added in v.297

  ViewVC Help
Powered by ViewVC