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

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

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

revision 319 by schoenebeck, Mon Dec 13 00:46:42 2004 UTC revision 348 by schoenebeck, Sun Jan 23 21:24:16 2005 UTC
# Line 125  namespace LinuxSampler { namespace gig { Line 125  namespace LinuxSampler { namespace gig {
125              playback_state_t            PlaybackState;      ///< When a sample will be triggered, it will be first played from RAM cache and after a couple of sample points it will switch to disk streaming and at the end of a disk stream we have to add null samples, so the interpolator can do it's work correctly              playback_state_t            PlaybackState;      ///< When a sample will be triggered, it will be first played from RAM cache and after a couple of sample points it will switch to disk streaming and at the end of a disk stream we have to add null samples, so the interpolator can do it's work correctly
126              bool                        DiskVoice;          ///< If the sample is very short it completely fits into the RAM cache and doesn't need to be streamed from disk, in that case this flag is set to false              bool                        DiskVoice;          ///< If the sample is very short it completely fits into the RAM cache and doesn't need to be streamed from disk, in that case this flag is set to false
127              Stream::reference_t         DiskStreamRef;      ///< Reference / link to the disk stream              Stream::reference_t         DiskStreamRef;      ///< Reference / link to the disk stream
128                int                         RealSampleWordsLeftToRead; ///< Number of samples left to read, not including the silence added for the interpolator
129              unsigned long               MaxRAMPos;          ///< The upper allowed limit (not actually the end) in the RAM sample cache, after that point it's not safe to chase the interpolator another time over over the current cache position, instead we switch to disk then.              unsigned long               MaxRAMPos;          ///< The upper allowed limit (not actually the end) in the RAM sample cache, after that point it's not safe to chase the interpolator another time over over the current cache position, instead we switch to disk then.
130              bool                        RAMLoop;            ///< If this voice has a loop defined which completely fits into the cached RAM part of the sample, in this case we handle the looping within the voice class, else if the loop is located in the disk stream part, we let the disk stream handle the looping              bool                        RAMLoop;            ///< If this voice has a loop defined which completely fits into the cached RAM part of the sample, in this case we handle the looping within the voice class, else if the loop is located in the disk stream part, we let the disk stream handle the looping
131              uint                        LoopCyclesLeft;     ///< In case there is a RAMLoop and it's not an endless loop; reflects number of loop cycles left to be passed              uint                        LoopCyclesLeft;     ///< In case there is a RAMLoop and it's not an endless loop; reflects number of loop cycles left to be passed
# Line 150  namespace LinuxSampler { namespace gig { Line 151  namespace LinuxSampler { namespace gig {
151              Pool<Event>::Iterator       itKillEvent;         ///< Event which caused this voice to be killed              Pool<Event>::Iterator       itKillEvent;         ///< Event which caused this voice to be killed
152          //private:          //private:
153              int                         SynthesisMode;              int                         SynthesisMode;
             void*                       SynthesizeFragmentFnPtr; ///< Points to the respective synthesis function for the current synthesis mode.  
154    
155              // Static Methods              // Static Methods
156              static float CalculateFilterCutoffCoeff();              static float CalculateFilterCutoffCoeff();
# Line 160  namespace LinuxSampler { namespace gig { Line 160  namespace LinuxSampler { namespace gig {
160              void KillImmediately();              void KillImmediately();
161              void ProcessEvents(uint Samples);              void ProcessEvents(uint Samples);
162              void CalculateBiquadParameters(uint Samples);              void CalculateBiquadParameters(uint Samples);
163              void UpdateSynthesisMode();              void Synthesize(uint Samples, sample_t* pSrc, uint Skip);
             void Synthesize(uint Samples, sample_t* pSrc, int Skip);  
164    
165              inline float CrossfadeAttenuation(uint8_t& CrossfadeControllerValue) {              inline float CrossfadeAttenuation(uint8_t& CrossfadeControllerValue) {
166                  return (CrossfadeControllerValue <= pDimRgn->Crossfade.in_start)  ? 0.0f                  float att = (!pDimRgn->Crossfade.out_end) ? CrossfadeControllerValue / 127.0f /* 0,0,0,0 means no crossfade defined */
167                       : (CrossfadeControllerValue < pDimRgn->Crossfade.in_end)     ? float(CrossfadeControllerValue - pDimRgn->Crossfade.in_start) / float(pDimRgn->Crossfade.in_end - pDimRgn->Crossfade.in_start)                            : (CrossfadeControllerValue < pDimRgn->Crossfade.in_end) ?
168                       : (CrossfadeControllerValue <= pDimRgn->Crossfade.out_start) ? 1.0f                                  ((CrossfadeControllerValue <= pDimRgn->Crossfade.in_start) ? 0.0f
169                       : (CrossfadeControllerValue < pDimRgn->Crossfade.out_end)    ? float(CrossfadeControllerValue - pDimRgn->Crossfade.out_start) / float(pDimRgn->Crossfade.out_end - pDimRgn->Crossfade.out_start)                                  : float(CrossfadeControllerValue - pDimRgn->Crossfade.in_start) / float(pDimRgn->Crossfade.in_end - pDimRgn->Crossfade.in_start))
170                       : 0.0f;                            : (CrossfadeControllerValue <= pDimRgn->Crossfade.out_start) ? 1.0f
171                              : (CrossfadeControllerValue < pDimRgn->Crossfade.out_end) ? float(pDimRgn->Crossfade.out_end - CrossfadeControllerValue) / float(pDimRgn->Crossfade.out_end - pDimRgn->Crossfade.out_start)
172                              : 0.0f;
173                    return pDimRgn->InvertAttenuationController ? 1 - att : att;
174              }              }
175    
176              inline float Constrain(float ValueToCheck, float Min, float Max) {              inline float Constrain(float ValueToCheck, float Min, float Max) {

Legend:
Removed from v.319  
changed lines
  Added in v.348

  ViewVC Help
Powered by ViewVC