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

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

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

revision 920 by capela, Sun Sep 24 12:47:51 2006 UTC revision 961 by capela, Sun Dec 3 18:26:13 2006 UTC
# Line 40  Line 40 
40  //  //
41    
42  // Constructor.  // Constructor.
43  qsamplerChannel::qsamplerChannel ( qsamplerMainForm *pMainForm, int iChannelID )  qsamplerChannel::qsamplerChannel ( int iChannelID )
44  {  {
         m_pMainForm  = pMainForm;  
45          m_iChannelID = iChannelID;          m_iChannelID = iChannelID;
46    
47  //  m_sEngineName       = noEngineName();  //  m_sEngineName       = noEngineName();
# Line 67  qsamplerChannel::~qsamplerChannel (void) Line 66  qsamplerChannel::~qsamplerChannel (void)
66  }  }
67    
68    
 // Main application form accessor.  
 qsamplerMainForm *qsamplerChannel::mainForm(void) const  
 {  
         return m_pMainForm;  
 }  
   
   
 // The global options settings delegated property.  
 qsamplerOptions *qsamplerChannel::options (void) const  
 {  
         if (m_pMainForm == NULL)  
                 return NULL;  
   
         return m_pMainForm->options();  
 }  
   
   
 // The client descriptor delegated property.  
 lscp_client_t *qsamplerChannel::client (void) const  
 {  
         if (m_pMainForm == NULL)  
                 return NULL;  
   
         return m_pMainForm->client();  
 }  
   
   
69  // Create a new sampler channel, if not already.  // Create a new sampler channel, if not already.
70  bool qsamplerChannel::addChannel (void)  bool qsamplerChannel::addChannel (void)
71  {  {
72          if (client() == NULL)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
73            if (pMainForm == NULL)
74                    return false;
75            if (pMainForm->client() == NULL)
76                  return false;                  return false;
77    
78          // Are we a new channel?          // Are we a new channel?
79          if (m_iChannelID < 0) {          if (m_iChannelID < 0) {
80                  m_iChannelID = ::lscp_add_channel(client());                  m_iChannelID = ::lscp_add_channel(pMainForm->client());
81                  if (m_iChannelID < 0) {                  if (m_iChannelID < 0) {
82                          appendMessagesClient("lscp_add_channel");                          appendMessagesClient("lscp_add_channel");
83                          appendMessagesError(QObject::tr("Could not add channel.\n\nSorry."));                          appendMessagesError(
84                                    QObject::tr("Could not add channel.\n\nSorry."));
85                  }   // Otherwise it's created...                  }   // Otherwise it's created...
86                  else appendMessages(QObject::tr("added."));                  else appendMessages(QObject::tr("added."));
87          }          }
# Line 118  bool qsamplerChannel::addChannel (void) Line 94  bool qsamplerChannel::addChannel (void)
94  // Remove sampler channel.  // Remove sampler channel.
95  bool qsamplerChannel::removeChannel (void)  bool qsamplerChannel::removeChannel (void)
96  {  {
97          if (client() == NULL)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
98            if (pMainForm == NULL)
99                    return false;
100            if (pMainForm->client() == NULL)
101                  return false;                  return false;
102    
103          // Are we an existing channel?          // Are we an existing channel?
104          if (m_iChannelID >= 0) {          if (m_iChannelID >= 0) {
105                  if (::lscp_remove_channel(client(), m_iChannelID) != LSCP_OK) {                  if (::lscp_remove_channel(pMainForm->client(), m_iChannelID) != LSCP_OK) {
106                          appendMessagesClient("lscp_remove_channel");                          appendMessagesClient("lscp_remove_channel");
107                          appendMessagesError(QObject::tr("Could not remove channel.\n\nSorry."));                          appendMessagesError(QObject::tr("Could not remove channel.\n\nSorry."));
108                  } else {                  } else {
# Line 165  const QString& qsamplerChannel::engineNa Line 144  const QString& qsamplerChannel::engineNa
144    
145  bool qsamplerChannel::loadEngine ( const QString& sEngineName )  bool qsamplerChannel::loadEngine ( const QString& sEngineName )
146  {  {
147          if (client() == NULL || m_iChannelID < 0)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
148            if (pMainForm == NULL)
149                    return false;
150            if (pMainForm->client() == NULL || m_iChannelID < 0)
151                  return false;                  return false;
152          if (m_iInstrumentStatus == 100 && m_sEngineName == sEngineName)          if (m_iInstrumentStatus == 100 && m_sEngineName == sEngineName)
153                  return true;                  return true;
154    
155          if (::lscp_load_engine(client(), sEngineName.latin1(), m_iChannelID) != LSCP_OK) {          if (::lscp_load_engine(pMainForm->client(), sEngineName.latin1(), m_iChannelID) != LSCP_OK) {
156                  appendMessagesClient("lscp_load_engine");                  appendMessagesClient("lscp_load_engine");
157                  return false;                  return false;
158          }          }
159    
160          appendMessages(QObject::tr("Engine: %1.").arg(sEngineName));          appendMessages(QObject::tr("Engine: %1.").arg(sEngineName));
161    
162          m_sEngineName = sEngineName;          m_sEngineName = sEngineName;
# Line 208  int qsamplerChannel::instrumentStatus (v Line 191  int qsamplerChannel::instrumentStatus (v
191  // Instrument file loader.  // Instrument file loader.
192  bool qsamplerChannel::loadInstrument ( const QString& sInstrumentFile, int iInstrumentNr )  bool qsamplerChannel::loadInstrument ( const QString& sInstrumentFile, int iInstrumentNr )
193  {  {
194          if (client() == NULL || m_iChannelID < 0)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
195            if (pMainForm == NULL)
196                    return false;
197            if (pMainForm->client() == NULL || m_iChannelID < 0)
198                  return false;                  return false;
199          if (!isInstrumentFile(sInstrumentFile))          if (!isInstrumentFile(sInstrumentFile))
200                  return false;                  return false;
201          if (m_iInstrumentStatus == 100 && m_sInstrumentFile == sInstrumentFile && m_iInstrumentNr == iInstrumentNr)          if (m_iInstrumentStatus == 100 && m_sInstrumentFile == sInstrumentFile && m_iInstrumentNr == iInstrumentNr)
202                  return true;                  return true;
203    
204          if (::lscp_load_instrument_non_modal(client(), sInstrumentFile.latin1(), iInstrumentNr, m_iChannelID) != LSCP_OK) {          if (::lscp_load_instrument_non_modal(pMainForm->client(), sInstrumentFile.latin1(), iInstrumentNr, m_iChannelID) != LSCP_OK) {
205                  appendMessagesClient("lscp_load_instrument");                  appendMessagesClient("lscp_load_instrument");
206                  return false;                  return false;
207          }          }
# Line 251  const QString& qsamplerChannel::midiDriv Line 237  const QString& qsamplerChannel::midiDriv
237    
238  bool qsamplerChannel::setMidiDriver ( const QString& sMidiDriver )  bool qsamplerChannel::setMidiDriver ( const QString& sMidiDriver )
239  {  {
240          if (client() == NULL || m_iChannelID < 0)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
241            if (pMainForm == NULL)
242                    return false;
243            if (pMainForm->client() == NULL || m_iChannelID < 0)
244                  return false;                  return false;
245          if (m_iInstrumentStatus == 100 && m_sMidiDriver == sMidiDriver)          if (m_iInstrumentStatus == 100 && m_sMidiDriver == sMidiDriver)
246                  return true;                  return true;
247    
248          if (::lscp_set_channel_midi_type(client(), m_iChannelID, sMidiDriver.latin1()) != LSCP_OK) {          if (::lscp_set_channel_midi_type(pMainForm->client(), m_iChannelID, sMidiDriver.latin1()) != LSCP_OK) {
249                  appendMessagesClient("lscp_set_channel_midi_type");                  appendMessagesClient("lscp_set_channel_midi_type");
250                  return false;                  return false;
251          }          }
# Line 276  int qsamplerChannel::midiDevice (void) c Line 265  int qsamplerChannel::midiDevice (void) c
265    
266  bool qsamplerChannel::setMidiDevice ( int iMidiDevice )  bool qsamplerChannel::setMidiDevice ( int iMidiDevice )
267  {  {
268          if (client() == NULL || m_iChannelID < 0)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
269            if (pMainForm == NULL)
270                    return false;
271            if (pMainForm->client() == NULL || m_iChannelID < 0)
272                  return false;                  return false;
273          if (m_iInstrumentStatus == 100 && m_iMidiDevice == iMidiDevice)          if (m_iInstrumentStatus == 100 && m_iMidiDevice == iMidiDevice)
274                  return true;                  return true;
275    
276          if (::lscp_set_channel_midi_device(client(), m_iChannelID, iMidiDevice) != LSCP_OK) {          if (::lscp_set_channel_midi_device(pMainForm->client(), m_iChannelID, iMidiDevice) != LSCP_OK) {
277                  appendMessagesClient("lscp_set_channel_midi_device");                  appendMessagesClient("lscp_set_channel_midi_device");
278                  return false;                  return false;
279          }          }
# Line 301  int qsamplerChannel::midiPort (void) con Line 293  int qsamplerChannel::midiPort (void) con
293    
294  bool qsamplerChannel::setMidiPort ( int iMidiPort )  bool qsamplerChannel::setMidiPort ( int iMidiPort )
295  {  {
296          if (client() == NULL || m_iChannelID < 0)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
297            if (pMainForm == NULL)
298                    return false;
299            if (pMainForm->client() == NULL || m_iChannelID < 0)
300                  return false;                  return false;
301          if (m_iInstrumentStatus == 100 && m_iMidiPort == iMidiPort)          if (m_iInstrumentStatus == 100 && m_iMidiPort == iMidiPort)
302                  return true;                  return true;
303    
304          if (::lscp_set_channel_midi_port(client(), m_iChannelID, iMidiPort) != LSCP_OK) {          if (::lscp_set_channel_midi_port(pMainForm->client(), m_iChannelID, iMidiPort) != LSCP_OK) {
305                  appendMessagesClient("lscp_set_channel_midi_port");                  appendMessagesClient("lscp_set_channel_midi_port");
306                  return false;                  return false;
307          }          }
# Line 326  int qsamplerChannel::midiChannel (void) Line 321  int qsamplerChannel::midiChannel (void)
321    
322  bool qsamplerChannel::setMidiChannel ( int iMidiChannel )  bool qsamplerChannel::setMidiChannel ( int iMidiChannel )
323  {  {
324          if (client() == NULL || m_iChannelID < 0)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
325            if (pMainForm == NULL)
326                    return false;
327            if (pMainForm->client() == NULL || m_iChannelID < 0)
328                  return false;                  return false;
329          if (m_iInstrumentStatus == 100 && m_iMidiChannel == iMidiChannel)          if (m_iInstrumentStatus == 100 && m_iMidiChannel == iMidiChannel)
330                  return true;                  return true;
331    
332          if (::lscp_set_channel_midi_channel(client(), m_iChannelID, iMidiChannel) != LSCP_OK) {          if (::lscp_set_channel_midi_channel(pMainForm->client(), m_iChannelID, iMidiChannel) != LSCP_OK) {
333                  appendMessagesClient("lscp_set_channel_midi_channel");                  appendMessagesClient("lscp_set_channel_midi_channel");
334                  return false;                  return false;
335          }          }
# Line 351  int qsamplerChannel::audioDevice (void) Line 349  int qsamplerChannel::audioDevice (void)
349    
350  bool qsamplerChannel::setAudioDevice ( int iAudioDevice )  bool qsamplerChannel::setAudioDevice ( int iAudioDevice )
351  {  {
352          if (client() == NULL || m_iChannelID < 0)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
353            if (pMainForm == NULL)
354                    return false;
355            if (pMainForm->client() == NULL || m_iChannelID < 0)
356                  return false;                  return false;
357          if (m_iInstrumentStatus == 100 && m_iAudioDevice == iAudioDevice)          if (m_iInstrumentStatus == 100 && m_iAudioDevice == iAudioDevice)
358                  return true;                  return true;
359    
360          if (::lscp_set_channel_audio_device(client(), m_iChannelID, iAudioDevice) != LSCP_OK) {          if (::lscp_set_channel_audio_device(pMainForm->client(), m_iChannelID, iAudioDevice) != LSCP_OK) {
361                  appendMessagesClient("lscp_set_channel_audio_device");                  appendMessagesClient("lscp_set_channel_audio_device");
362                  return false;                  return false;
363          }          }
# Line 376  const QString& qsamplerChannel::audioDri Line 377  const QString& qsamplerChannel::audioDri
377    
378  bool qsamplerChannel::setAudioDriver ( const QString& sAudioDriver )  bool qsamplerChannel::setAudioDriver ( const QString& sAudioDriver )
379  {  {
380          if (client() == NULL || m_iChannelID < 0)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
381            if (pMainForm == NULL)
382                    return false;
383            if (pMainForm->client() == NULL || m_iChannelID < 0)
384                  return false;                  return false;
385          if (m_iInstrumentStatus == 100 && m_sAudioDriver == sAudioDriver)          if (m_iInstrumentStatus == 100 && m_sAudioDriver == sAudioDriver)
386                  return true;                  return true;
387    
388          if (::lscp_set_channel_audio_type(client(), m_iChannelID, sAudioDriver.latin1()) != LSCP_OK) {          if (::lscp_set_channel_audio_type(pMainForm->client(), m_iChannelID, sAudioDriver.latin1()) != LSCP_OK) {
389                  appendMessagesClient("lscp_set_channel_audio_type");                  appendMessagesClient("lscp_set_channel_audio_type");
390                  return false;                  return false;
391          }          }
# Line 401  float qsamplerChannel::volume (void) con Line 405  float qsamplerChannel::volume (void) con
405    
406  bool qsamplerChannel::setVolume ( float fVolume )  bool qsamplerChannel::setVolume ( float fVolume )
407  {  {
408          if (client() == NULL || m_iChannelID < 0)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
409            if (pMainForm == NULL)
410                    return false;
411            if (pMainForm->client() == NULL || m_iChannelID < 0)
412                  return false;                  return false;
413          if (m_iInstrumentStatus == 100 && m_fVolume == fVolume)          if (m_iInstrumentStatus == 100 && m_fVolume == fVolume)
414                  return true;                  return true;
415    
416          if (::lscp_set_channel_volume(client(), m_iChannelID, fVolume) != LSCP_OK) {          if (::lscp_set_channel_volume(pMainForm->client(), m_iChannelID, fVolume) != LSCP_OK) {
417                  appendMessagesClient("lscp_set_channel_volume");                  appendMessagesClient("lscp_set_channel_volume");
418                  return false;                  return false;
419          }          }
# Line 426  bool qsamplerChannel::channelMute (void) Line 433  bool qsamplerChannel::channelMute (void)
433    
434  bool qsamplerChannel::setChannelMute ( bool bMute )  bool qsamplerChannel::setChannelMute ( bool bMute )
435  {  {
436          if (client() == NULL || m_iChannelID < 0)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
437            if (pMainForm == NULL)
438                    return false;
439            if (pMainForm->client() == NULL || m_iChannelID < 0)
440                  return false;                  return false;
441          if (m_iInstrumentStatus == 100 && ((m_bMute && bMute) || (!m_bMute && !bMute)))          if (m_iInstrumentStatus == 100 && ((m_bMute && bMute) || (!m_bMute && !bMute)))
442                  return true;                  return true;
443    
444  #ifdef CONFIG_MUTE_SOLO  #ifdef CONFIG_MUTE_SOLO
445          if (::lscp_set_channel_mute(client(), m_iChannelID, bMute) != LSCP_OK) {          if (::lscp_set_channel_mute(pMainForm->client(), m_iChannelID, bMute) != LSCP_OK) {
446                  appendMessagesClient("lscp_set_channel_mute");                  appendMessagesClient("lscp_set_channel_mute");
447                  return false;                  return false;
448          }          }
# Line 453  bool qsamplerChannel::channelSolo (void) Line 463  bool qsamplerChannel::channelSolo (void)
463    
464  bool qsamplerChannel::setChannelSolo ( bool bSolo )  bool qsamplerChannel::setChannelSolo ( bool bSolo )
465  {  {
466          if (client() == NULL || m_iChannelID < 0)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
467            if (pMainForm == NULL)
468                    return false;
469            if (pMainForm->client() == NULL || m_iChannelID < 0)
470                  return false;                  return false;
471          if (m_iInstrumentStatus == 100 && ((m_bSolo && bSolo) || (!m_bSolo && !bSolo)))          if (m_iInstrumentStatus == 100 && ((m_bSolo && bSolo) || (!m_bSolo && !bSolo)))
472                  return true;                  return true;
473    
474  #ifdef CONFIG_MUTE_SOLO  #ifdef CONFIG_MUTE_SOLO
475          if (::lscp_set_channel_solo(client(), m_iChannelID, bSolo) != LSCP_OK) {          if (::lscp_set_channel_solo(pMainForm->client(), m_iChannelID, bSolo) != LSCP_OK) {
476                  appendMessagesClient("lscp_set_channel_solo");                  appendMessagesClient("lscp_set_channel_solo");
477                  return false;                  return false;
478          }          }
# Line 480  int qsamplerChannel::audioChannel ( int Line 493  int qsamplerChannel::audioChannel ( int
493    
494  bool qsamplerChannel::setAudioChannel ( int iAudioOut, int iAudioIn )  bool qsamplerChannel::setAudioChannel ( int iAudioOut, int iAudioIn )
495  {  {
496          if (client() == NULL || m_iChannelID < 0)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
497            if (pMainForm == NULL)
498                    return false;
499            if (pMainForm->client() == NULL || m_iChannelID < 0)
500                  return false;                  return false;
501          if (m_iInstrumentStatus == 100 &&          if (m_iInstrumentStatus == 100 &&
502                          m_audioRouting[iAudioOut] == iAudioIn)                          m_audioRouting[iAudioOut] == iAudioIn)
503                  return true;                  return true;
504    
505          if (::lscp_set_channel_audio_channel(client(),          if (::lscp_set_channel_audio_channel(pMainForm->client(),
506                          m_iChannelID, iAudioOut, iAudioIn) != LSCP_OK) {                          m_iChannelID, iAudioOut, iAudioIn) != LSCP_OK) {
507                  appendMessagesClient("lscp_set_channel_audio_channel");                  appendMessagesClient("lscp_set_channel_audio_channel");
508                  return false;                  return false;
# Line 519  void qsamplerChannel::updateInstrumentNa Line 535  void qsamplerChannel::updateInstrumentNa
535  // Update whole channel info state.  // Update whole channel info state.
536  bool qsamplerChannel::updateChannelInfo (void)  bool qsamplerChannel::updateChannelInfo (void)
537  {  {
538          if (client() == NULL || m_iChannelID < 0)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
539            if (pMainForm == NULL)
540                    return false;
541            if (pMainForm->client() == NULL || m_iChannelID < 0)
542                  return false;                  return false;
543    
544          // Read channel information.          // Read channel information.
545          lscp_channel_info_t *pChannelInfo = ::lscp_get_channel_info(client(), m_iChannelID);          lscp_channel_info_t *pChannelInfo = ::lscp_get_channel_info(pMainForm->client(), m_iChannelID);
546          if (pChannelInfo == NULL) {          if (pChannelInfo == NULL) {
547                  appendMessagesClient("lscp_get_channel_info");                  appendMessagesClient("lscp_get_channel_info");
548                  appendMessagesError(QObject::tr("Could not get channel information.\n\nSorry."));                  appendMessagesError(QObject::tr("Could not get channel information.\n\nSorry."));
# Line 570  bool qsamplerChannel::updateChannelInfo Line 589  bool qsamplerChannel::updateChannelInfo
589          lscp_device_info_t *pDeviceInfo;          lscp_device_info_t *pDeviceInfo;
590          const QString sNone = QObject::tr("(none)");          const QString sNone = QObject::tr("(none)");
591          // Audio device driver type.          // Audio device driver type.
592          pDeviceInfo = ::lscp_get_audio_device_info(client(), m_iAudioDevice);          pDeviceInfo = ::lscp_get_audio_device_info(pMainForm->client(), m_iAudioDevice);
593          if (pDeviceInfo == NULL) {          if (pDeviceInfo == NULL) {
594                  appendMessagesClient("lscp_get_audio_device_info");                  appendMessagesClient("lscp_get_audio_device_info");
595                  m_sAudioDriver = sNone;                  m_sAudioDriver = sNone;
# Line 578  bool qsamplerChannel::updateChannelInfo Line 597  bool qsamplerChannel::updateChannelInfo
597                  m_sAudioDriver = pDeviceInfo->driver;                  m_sAudioDriver = pDeviceInfo->driver;
598          }          }
599          // MIDI device driver type.          // MIDI device driver type.
600          pDeviceInfo = ::lscp_get_midi_device_info(client(), m_iMidiDevice);          pDeviceInfo = ::lscp_get_midi_device_info(pMainForm->client(), m_iMidiDevice);
601          if (pDeviceInfo == NULL) {          if (pDeviceInfo == NULL) {
602                  appendMessagesClient("lscp_get_midi_device_info");                  appendMessagesClient("lscp_get_midi_device_info");
603                  m_sMidiDriver = sNone;                  m_sMidiDriver = sNone;
# Line 600  bool qsamplerChannel::updateChannelInfo Line 619  bool qsamplerChannel::updateChannelInfo
619  // Reset channel method.  // Reset channel method.
620  bool qsamplerChannel::channelReset (void)  bool qsamplerChannel::channelReset (void)
621  {  {
622          if (client() == NULL || m_iChannelID < 0)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
623            if (pMainForm == NULL)
624                    return false;
625            if (pMainForm->client() == NULL || m_iChannelID < 0)
626                  return false;                  return false;
627    
628          if (::lscp_reset_channel(client(), m_iChannelID) != LSCP_OK) {          if (::lscp_reset_channel(pMainForm->client(), m_iChannelID) != LSCP_OK) {
629                  appendMessagesClient("lscp_reset_channel");                  appendMessagesClient("lscp_reset_channel");
630                  return false;                  return false;
631          }          }
# Line 617  bool qsamplerChannel::channelReset (void Line 639  bool qsamplerChannel::channelReset (void
639  // Channel setup dialog form.  // Channel setup dialog form.
640  bool qsamplerChannel::channelSetup ( QWidget *pParent )  bool qsamplerChannel::channelSetup ( QWidget *pParent )
641  {  {
642            qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
643            if (pMainForm == NULL)
644                    return false;
645    
646          bool bResult = false;          bool bResult = false;
647    
648          appendMessages(QObject::tr("setup..."));          appendMessages(QObject::tr("setup..."));
# Line 635  bool qsamplerChannel::channelSetup ( QWi Line 661  bool qsamplerChannel::channelSetup ( QWi
661  // Redirected messages output methods.  // Redirected messages output methods.
662  void qsamplerChannel::appendMessages( const QString& s ) const  void qsamplerChannel::appendMessages( const QString& s ) const
663  {  {
664          if (m_pMainForm)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
665                  m_pMainForm->appendMessages(channelName() + ' ' + s);          if (pMainForm)
666                    pMainForm->appendMessages(channelName() + ' ' + s);
667  }  }
668    
669  void qsamplerChannel::appendMessagesColor( const QString& s,  void qsamplerChannel::appendMessagesColor( const QString& s,
670          const QString& c ) const          const QString& c ) const
671  {  {
672          if (m_pMainForm)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
673                  m_pMainForm->appendMessagesColor(channelName() + ' ' + s, c);          if (pMainForm)
674                    pMainForm->appendMessagesColor(channelName() + ' ' + s, c);
675  }  }
676    
677  void qsamplerChannel::appendMessagesText( const QString& s ) const  void qsamplerChannel::appendMessagesText( const QString& s ) const
678  {  {
679          if (m_pMainForm)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
680                  m_pMainForm->appendMessagesText(channelName() + ' ' + s);          if (pMainForm)
681                    pMainForm->appendMessagesText(channelName() + ' ' + s);
682  }  }
683    
684  void qsamplerChannel::appendMessagesError( const QString& s ) const  void qsamplerChannel::appendMessagesError( const QString& s ) const
685  {  {
686          if (m_pMainForm)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
687                  m_pMainForm->appendMessagesError(channelName() + "\n\n" + s);          if (pMainForm)
688                    pMainForm->appendMessagesError(channelName() + "\n\n" + s);
689  }  }
690    
691  void qsamplerChannel::appendMessagesClient( const QString& s ) const  void qsamplerChannel::appendMessagesClient( const QString& s ) const
692  {  {
693          if (m_pMainForm)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
694                  m_pMainForm->appendMessagesClient(channelName() + ' ' + s);          if (pMainForm)
695                    pMainForm->appendMessagesClient(channelName() + ' ' + s);
696  }  }
697    
698    
699  // Context menu event handler.  // Context menu event handler.
700  void qsamplerChannel::contextMenuEvent( QContextMenuEvent *pEvent )  void qsamplerChannel::contextMenuEvent( QContextMenuEvent *pEvent )
701  {  {
702          if (m_pMainForm)          qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance();
703                  m_pMainForm->contextMenuEvent(pEvent);          if (pMainForm)
704                    pMainForm->contextMenuEvent(pEvent);
705  }  }
706    
707    

Legend:
Removed from v.920  
changed lines
  Added in v.961

  ViewVC Help
Powered by ViewVC