/[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 748 by capela, Wed Aug 17 23:03:26 2005 UTC revision 751 by capela, Fri Aug 19 17:10:16 2005 UTC
# Line 57  qsamplerChannel::qsamplerChannel ( qsamp Line 57  qsamplerChannel::qsamplerChannel ( qsamp
57          m_sAudioDriver      = "ALSA";          m_sAudioDriver      = "ALSA";
58          m_iAudioDevice      = -1;          m_iAudioDevice      = -1;
59          m_fVolume           = 0.0;          m_fVolume           = 0.0;
60            m_bMute             = false;
61            m_bSolo             = false;
62  }  }
63    
64  // Default destructor.  // Default destructor.
# Line 417  bool qsamplerChannel::setVolume ( float Line 418  bool qsamplerChannel::setVolume ( float
418  }  }
419    
420    
421    // Sampler channel mute state.
422    bool qsamplerChannel::channelMute (void) const
423    {
424            return m_bMute;
425    }
426    
427    bool qsamplerChannel::setChannelMute ( bool bMute )
428    {
429            if (client() == NULL || m_iChannelID < 0)
430                    return false;
431            if (m_iInstrumentStatus == 100 && ((m_bMute && bMute) || (!m_bMute && !bMute)))
432                    return true;
433    
434    #ifdef CONFIG_MUTE_SOLO
435            if (::lscp_set_channel_mute(client(), m_iChannelID, bMute) != LSCP_OK) {
436                    appendMessagesClient("lscp_set_channel_mute");
437                    return false;
438            }
439            appendMessages(QObject::tr("Mute: %1.").arg((int) bMute));
440            m_bMute = bMute;
441            return true;
442    #else
443            return false;
444    #endif
445    }
446    
447    
448    // Sampler channel solo state.
449    bool qsamplerChannel::channelSolo (void) const
450    {
451            return m_bSolo;
452    }
453    
454    bool qsamplerChannel::setChannelSolo ( bool bSolo )
455    {
456            if (client() == NULL || m_iChannelID < 0)
457                    return false;
458            if (m_iInstrumentStatus == 100 && ((m_bSolo && bSolo) || (!m_bSolo && !bSolo)))
459                    return true;
460    
461    #ifdef CONFIG_MUTE_SOLO
462            if (::lscp_set_channel_solo(client(), m_iChannelID, bSolo) != LSCP_OK) {
463                    appendMessagesClient("lscp_set_channel_solo");
464                    return false;
465            }
466            appendMessages(QObject::tr("Solo: %1.").arg((int) bSolo));
467            m_bSolo = bSolo;
468            return true;
469    #else
470            return false;
471    #endif
472    }
473    
474    
475  // Istrument name remapper.  // Istrument name remapper.
476  void qsamplerChannel::updateInstrumentName (void)  void qsamplerChannel::updateInstrumentName (void)
477  {  {
# Line 465  bool qsamplerChannel::updateChannelInfo Line 520  bool qsamplerChannel::updateChannelInfo
520          m_iMidiChannel      = pChannelInfo->midi_channel;          m_iMidiChannel      = pChannelInfo->midi_channel;
521          m_iAudioDevice      = pChannelInfo->audio_device;          m_iAudioDevice      = pChannelInfo->audio_device;
522          m_fVolume           = pChannelInfo->volume;          m_fVolume           = pChannelInfo->volume;
523    #ifdef CONFIG_MUTE_SOLO
524            m_bMute             = pChannelInfo->mute;
525            m_bSolo             = pChannelInfo->solo;
526    #endif
527          // Some sanity checks.          // Some sanity checks.
528          if (m_sEngineName == "NONE" || m_sEngineName.isEmpty())          if (m_sEngineName == "NONE" || m_sEngineName.isEmpty())
529                  m_sEngineName = QString::null;                  m_sEngineName = QString::null;

Legend:
Removed from v.748  
changed lines
  Added in v.751

  ViewVC Help
Powered by ViewVC