/[svn]/linuxsampler/trunk/src/engines/FxSend.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/FxSend.cpp

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

revision 1721 by schoenebeck, Sun Oct 14 22:00:17 2007 UTC revision 1722 by schoenebeck, Thu Apr 10 17:41:32 2008 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
6   *   Copyright (C) 2005 - 2007 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 2008 Christian Schoenebeck                       *
7   *                                                                         *   *                                                                         *
8   *   This library is free software; you can redistribute it and/or modify  *   *   This library is free software; you can redistribute it and/or modify  *
9   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 33  Line 33 
33    
34  namespace LinuxSampler {  namespace LinuxSampler {
35    
36      FxSend::FxSend(EngineChannel* pEngineChannel, uint8_t MidiCtrl, String Name) throw (Exception) {      FxSend::FxSend(EngineChannel* pEngineChannel, uint8_t MidiCtrl, String Name) throw (Exception)
37            : iMasterEffectChain(-1), iMasterEffect(-1)
38        {
39          this->pEngineChannel = pEngineChannel;          this->pEngineChannel = pEngineChannel;
40          AudioOutputDevice* pDevice = pEngineChannel->GetAudioOutputDevice();          AudioOutputDevice* pDevice = pEngineChannel->GetAudioOutputDevice();
41          const int iChanOffset = (pDevice) ? pDevice->ChannelCount() - pEngineChannel->Channels() : 0;          const int iChanOffset = (pDevice) ? pDevice->ChannelCount() - pEngineChannel->Channels() : 0;
# Line 76  namespace LinuxSampler { Line 78  namespace LinuxSampler {
78          fLevel = DEFAULT_FX_SEND_LEVEL;          fLevel = DEFAULT_FX_SEND_LEVEL;
79      }      }
80    
81        int FxSend::DestinationMasterEffectChain() const {
82            return iMasterEffectChain;
83        }
84    
85        int FxSend::DestinationMasterEffect() const {
86            return iMasterEffect;
87        }
88    
89        void FxSend::SetDestinationMasterEffect(int iChain, int iEffect) throw (Exception) {
90            AudioOutputDevice* pDevice = pEngineChannel->GetAudioOutputDevice();
91            if (iChain < 0 || iChain >= pDevice->MasterEffectChainCount())
92                throw Exception(
93                    "Could not assign FX Send to master effect chain " +
94                    ToString(iChain) + ": effect chain doesn't exist."
95                );
96            if (iEffect < 0 || iEffect >= pDevice->MasterEffectChain(iChain)->EffectCount())
97                throw Exception(
98                    "Could not assign FX Send to master effect " +
99                    ToString(iEffect) + " of effect chain " + ToString(iChain) +
100                    ": effect doesn't exist."
101                );
102            iMasterEffectChain = iChain;
103            iMasterEffect      = iEffect;
104        }
105    
106      int FxSend::DestinationChannel(int SrcChan) {      int FxSend::DestinationChannel(int SrcChan) {
107          if (SrcChan >= pEngineChannel->Channels()) return -1;          if (SrcChan >= pEngineChannel->Channels()) return -1;
108          return Routing[SrcChan];          return Routing[SrcChan];

Legend:
Removed from v.1721  
changed lines
  Added in v.1722

  ViewVC Help
Powered by ViewVC