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

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

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

revision 348 by schoenebeck, Sun Jan 23 21:24:16 2005 UTC revision 354 by schoenebeck, Sat Jan 29 15:17:59 2005 UTC
# Line 116  namespace LinuxSampler { namespace gig { Line 116  namespace LinuxSampler { namespace gig {
116       *  @param iLayer              - layer number this voice refers to (only if this is a layered sound of course)       *  @param iLayer              - layer number this voice refers to (only if this is a layered sound of course)
117       *  @param ReleaseTriggerVoice - if this new voice is a release trigger voice (optional, default = false)       *  @param ReleaseTriggerVoice - if this new voice is a release trigger voice (optional, default = false)
118       *  @param VoiceStealing       - wether the voice is allowed to steal voices for further subvoices       *  @param VoiceStealing       - wether the voice is allowed to steal voices for further subvoices
119       *  @returns 0 on success, a value < 0 if something failed       *  @returns 0 on success, a value < 0 if the voice wasn't triggered
120         *           (either due to an error or e.g. because no region is
121         *           defined for the given key)
122       */       */
123      int Voice::Trigger(Pool<Event>::Iterator& itNoteOnEvent, int PitchBend, ::gig::Instrument* pInstrument, int iLayer, bool ReleaseTriggerVoice, bool VoiceStealing) {      int Voice::Trigger(Pool<Event>::Iterator& itNoteOnEvent, int PitchBend, ::gig::Instrument* pInstrument, int iLayer, bool ReleaseTriggerVoice, bool VoiceStealing) {
124          if (!pInstrument) {          if (!pInstrument) {
# Line 137  namespace LinuxSampler { namespace gig { Line 139  namespace LinuxSampler { namespace gig {
139          itChildVoice    = Pool<Voice>::Iterator();          itChildVoice    = Pool<Voice>::Iterator();
140    
141          if (!pRegion) {          if (!pRegion) {
142              std::cerr << "gig::Voice: No Region defined for MIDI key " << MIDIKey << std::endl << std::flush;              dmsg(4, ("gig::Voice: No Region defined for MIDI key %d\n", MIDIKey));
             KillImmediately();  
143              return -1;              return -1;
144          }          }
145    
# Line 170  namespace LinuxSampler { namespace gig { Line 171  namespace LinuxSampler { namespace gig {
171                      DimValues[i] = (uint) ReleaseTriggerVoice;                      DimValues[i] = (uint) ReleaseTriggerVoice;
172                      break;                      break;
173                  case ::gig::dimension_keyboard:                  case ::gig::dimension_keyboard:
174                      DimValues[i] = (uint) itNoteOnEvent->Param.Note.Key;                      DimValues[i] = (uint) pEngine->CurrentKeyDimension;
175                      break;                      break;
176                  case ::gig::dimension_modwheel:                  case ::gig::dimension_modwheel:
177                      DimValues[i] = pEngine->ControllerTable[1];                      DimValues[i] = pEngine->ControllerTable[1];
# Line 251  namespace LinuxSampler { namespace gig { Line 252  namespace LinuxSampler { namespace gig {
252          pDimRgn = pRegion->GetDimensionRegionByValue(DimValues);          pDimRgn = pRegion->GetDimensionRegionByValue(DimValues);
253    
254          pSample = pDimRgn->pSample; // sample won't change until the voice is finished          pSample = pDimRgn->pSample; // sample won't change until the voice is finished
255            if (!pSample || !pSample->SamplesTotal) return -1; // no need to continue if sample is silent
256    
257          // select channel mode (mono or stereo)          // select channel mode (mono or stereo)
258          SYNTHESIS_MODE_SET_CHANNELS(SynthesisMode, pSample->Channels == 2);          SYNTHESIS_MODE_SET_CHANNELS(SynthesisMode, pSample->Channels == 2);

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

  ViewVC Help
Powered by ViewVC