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

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

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

revision 2120 by persson, Sun Jun 28 16:43:38 2009 UTC revision 2121 by schoenebeck, Tue Sep 14 17:09:08 2010 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 - 2009 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 20010 Christian Schoenebeck                      *
7   *                                                                         *   *                                                                         *
8   *   This program is free software; you can redistribute it and/or modify  *   *   This program 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 43  namespace LinuxSampler { Line 43  namespace LinuxSampler {
43          uint8_t uiMidiBankLsb;          uint8_t uiMidiBankLsb;
44          uint8_t uiMidiRpnMsb; ///< MIDI Registered Parameter Number (upper 8 bits / coarse)          uint8_t uiMidiRpnMsb; ///< MIDI Registered Parameter Number (upper 8 bits / coarse)
45          uint8_t uiMidiRpnLsb; ///< MIDI Registered Parameter Number (lower 8 bits / fine)          uint8_t uiMidiRpnLsb; ///< MIDI Registered Parameter Number (lower 8 bits / fine)
46            uint8_t uiMidiNrpnMsb; ///< MIDI Non-Registered Parameter Number (upper 8 bits / coarse)
47            uint8_t uiMidiNrpnLsb; ///< MIDI Non-Registered Parameter Number (lower 8 bits / fine)
48          bool    bMidiBankMsbReceived;          bool    bMidiBankMsbReceived;
49          bool    bMidiBankLsbReceived;          bool    bMidiBankLsbReceived;
50          bool    bProgramChangeReceived;          bool    bProgramChangeReceived;
51          bool    bMidiRpnReceived;          bool    bMidiRpnReceived;
52            bool    bMidiNrpnReceived;
53          int     iMidiInstrumentMap;          int     iMidiInstrumentMap;
54          atomic_t voiceCount;          atomic_t voiceCount;
55          atomic_t diskStreamCount;          atomic_t diskStreamCount;
# Line 68  namespace LinuxSampler { Line 71  namespace LinuxSampler {
71          SetDiskStreamCount(0);          SetDiskStreamCount(0);
72          p->pSamplerChannel = NULL;          p->pSamplerChannel = NULL;
73          ResetMidiRpnController();          ResetMidiRpnController();
74            ResetMidiNrpnController();
75      }      }
76    
77      EngineChannel::~EngineChannel() {      EngineChannel::~EngineChannel() {
# Line 202  namespace LinuxSampler { Line 206  namespace LinuxSampler {
206          StatusChanged(true);          StatusChanged(true);
207      }      }
208    
209        // RPNs ...
210    
211      void EngineChannel::SetMidiRpnControllerMsb(uint8_t CtrlMSB) {      void EngineChannel::SetMidiRpnControllerMsb(uint8_t CtrlMSB) {
212          p->uiMidiRpnMsb = CtrlMSB;          p->uiMidiRpnMsb = CtrlMSB;
213          p->bMidiRpnReceived = true;          p->bMidiRpnReceived = true;
# Line 222  namespace LinuxSampler { Line 228  namespace LinuxSampler {
228                 (p->uiMidiRpnMsb << 8) | p->uiMidiRpnLsb : -1;                 (p->uiMidiRpnMsb << 8) | p->uiMidiRpnLsb : -1;
229      }      }
230    
231        // NRPNs ...
232    
233        void EngineChannel::SetMidiNrpnControllerMsb(uint8_t CtrlMSB) {
234            p->uiMidiNrpnMsb = CtrlMSB;
235            p->bMidiNrpnReceived = true;
236        }
237    
238        void EngineChannel::SetMidiNrpnControllerLsb(uint8_t CtrlLSB) {
239            p->uiMidiNrpnLsb = CtrlLSB;
240            p->bMidiNrpnReceived = true;
241        }
242    
243        void EngineChannel::ResetMidiNrpnController() {
244            p->uiMidiNrpnMsb = p->uiMidiNrpnLsb = 0;
245            p->bMidiNrpnReceived = false;
246        }
247    
248        int EngineChannel::GetMidiNrpnController() {
249            return (p->bMidiNrpnReceived) ?
250                   (p->uiMidiNrpnMsb << 8) | p->uiMidiNrpnLsb : -1;
251        }
252    
253      uint EngineChannel::GetVoiceCount() {      uint EngineChannel::GetVoiceCount() {
254          return atomic_read(&p->voiceCount);          return atomic_read(&p->voiceCount);
255      }      }

Legend:
Removed from v.2120  
changed lines
  Added in v.2121

  ViewVC Help
Powered by ViewVC