/[svn]/linuxsampler/trunk/src/engines/gig/EGADSR.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/gig/EGADSR.h

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

revision 3327 by persson, Sat Jan 30 10:30:02 2010 UTC revision 3328 by schoenebeck, Sun Jul 23 18:27:29 2017 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 - 2010 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 2017 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 37  namespace LinuxSampler { namespace gig { Line 37  namespace LinuxSampler { namespace gig {
37   */   */
38  class EGADSR : public EG {  class EGADSR : public EG {
39      public:      public:
40            EGADSR();
41    
42          /**          /**
43           * Will be called by the voice when the key / voice was triggered.           * Will be called by the voice when the key / voice was triggered.
# Line 66  class EGADSR : public EG { Line 67  class EGADSR : public EG {
67           */           */
68          void trigger(uint PreAttack, float AttackTime, bool HoldAttack, float Decay1Time, double Decay2Time, bool InfiniteSustain, uint SustainLevel, float ReleaseTime, float Volume, uint SampleRate); //FIXME: we should better use 'float' for SampleRate          void trigger(uint PreAttack, float AttackTime, bool HoldAttack, float Decay1Time, double Decay2Time, bool InfiniteSustain, uint SustainLevel, float ReleaseTime, float Volume, uint SampleRate); //FIXME: we should better use 'float' for SampleRate
69    
70            void setStateOptions(bool AttackCancel, bool AttackHoldCancel, bool Decay1Cancel, bool Decay2Cancel, bool ReleaseCancel);
71    
72          /**          /**
73           * Should be called to inform the EG about an external event and           * Should be called to inform the EG about an external event and
74           * also whenever an envelope stage is completed. This will handle           * also whenever an envelope stage is completed. This will handle
# Line 91  class EGADSR : public EG { Line 94  class EGADSR : public EG {
94          };          };
95    
96          stage_t   Stage;          stage_t   Stage;
97            event_t   PostponedEvent;   ///< Only if *Cancel variable below is set to to false in the respective EG stage: holds the transition event type for processing after that current stage completed its full duration.
98          bool      HoldAttack;          bool      HoldAttack;
99          bool      InfiniteSustain;          bool      InfiniteSustain;
100            bool      AttackCancel;     ///< Whether the "attack" stage is cancelled when receiving a note-off.
101            bool      AttackHoldCancel; ///< Whether the "attack hold" stage is cancelled when receiving a note-off.
102            bool      Decay1Cancel;     ///< Whether the "decay 1" stage is cancelled when receiving a note-off.
103            bool      Decay2Cancel;     ///< Whether the "decay 2" stage is cancelled when receiving a note-off.
104            bool      ReleaseCancel;    ///< Whether the "release" stage is cancelled when receiving a note-on.
105          float     Decay1Time;          float     Decay1Time;
106          float     Decay1Level2;          float     Decay1Level2;
107          float     Decay1Slope;          float     Decay1Slope;
# Line 106  class EGADSR : public EG { Line 115  class EGADSR : public EG {
115          float     invVolume;          float     invVolume;
116          float     ExpOffset;          float     ExpOffset;
117    
118            void enterNextStageForReleaseEvent(uint SampleRate);
119          void enterAttackStage(const uint PreAttack, const float AttackTime, const uint SampleRate);          void enterAttackStage(const uint PreAttack, const float AttackTime, const uint SampleRate);
120          void enterAttackHoldStage();          void enterAttackHoldStage();
121          void enterDecay1Part1Stage(const uint SampleRate);          void enterDecay1Part1Stage(const uint SampleRate);

Legend:
Removed from v.3327  
changed lines
  Added in v.3328

  ViewVC Help
Powered by ViewVC