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

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

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

revision 738 by schoenebeck, Tue Aug 16 17:14:25 2005 UTC revision 775 by schoenebeck, Wed Sep 21 14:30:43 2005 UTC
# Line 190  namespace LinuxSampler { namespace gig { Line 190  namespace LinuxSampler { namespace gig {
190    
191          // delete all input events          // delete all input events
192          pEventQueue->init();          pEventQueue->init();
193            pSysexBuffer->init();
194      }      }
195    
196      /**      /**
# Line 703  namespace LinuxSampler { namespace gig { Line 704  namespace LinuxSampler { namespace gig {
704       */       */
705      void Engine::ProcessPitchbend(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itPitchbendEvent) {      void Engine::ProcessPitchbend(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itPitchbendEvent) {
706          pEngineChannel->Pitch = itPitchbendEvent->Param.Pitch.Pitch; // store current pitch value          pEngineChannel->Pitch = itPitchbendEvent->Param.Pitch.Pitch; // store current pitch value
         itPitchbendEvent.moveToEndOf(pEngineChannel->pEvents);  
707      }      }
708    
709      /**      /**
# Line 1140  namespace LinuxSampler { namespace gig { Line 1140  namespace LinuxSampler { namespace gig {
1140          // update controller value in the engine channel's controller table          // update controller value in the engine channel's controller table
1141          pEngineChannel->ControllerTable[itControlChangeEvent->Param.CC.Controller] = itControlChangeEvent->Param.CC.Value;          pEngineChannel->ControllerTable[itControlChangeEvent->Param.CC.Controller] = itControlChangeEvent->Param.CC.Value;
1142    
1143          // move event from the import event list to the engine channel's CC and pitchbend event list          switch (itControlChangeEvent->Param.CC.Controller) {
         Pool<Event>::Iterator itControlChangeEventOnCCList = itControlChangeEvent.moveToEndOf(pEngineChannel->pEvents);  
   
         switch (itControlChangeEventOnCCList->Param.CC.Controller) {  
1144              case 7: { // volume              case 7: { // volume
1145                  //TODO: not sample accurate yet                  //TODO: not sample accurate yet
1146                  pEngineChannel->GlobalVolume = (float) itControlChangeEventOnCCList->Param.CC.Value / 127.0f;                  pEngineChannel->GlobalVolume = (float) itControlChangeEvent->Param.CC.Value / 127.0f;
1147                  pEngineChannel->bStatusChanged = true; // engine channel status has changed, so set notify flag                  pEngineChannel->bStatusChanged = true; // engine channel status has changed, so set notify flag
1148                  break;                  break;
1149              }              }
1150              case 10: { // panpot              case 10: { // panpot
1151                  //TODO: not sample accurate yet                  //TODO: not sample accurate yet
1152                  const int pan = (int) itControlChangeEventOnCCList->Param.CC.Value - 64;                  const int pan = (int) itControlChangeEvent->Param.CC.Value - 64;
1153                  pEngineChannel->GlobalPanLeft  = 1.0f - float(RTMath::Max(pan, 0)) /  63.0f;                  pEngineChannel->GlobalPanLeft  = 1.0f - float(RTMath::Max(pan, 0)) /  63.0f;
1154                  pEngineChannel->GlobalPanRight = 1.0f - float(RTMath::Min(pan, 0)) / -64.0f;                  pEngineChannel->GlobalPanRight = 1.0f - float(RTMath::Min(pan, 0)) / -64.0f;
1155                  break;                  break;
1156              }              }
1157              case 64: { // sustain              case 64: { // sustain
1158                  if (itControlChangeEventOnCCList->Param.CC.Value >= 64 && !pEngineChannel->SustainPedal) {                  if (itControlChangeEvent->Param.CC.Value >= 64 && !pEngineChannel->SustainPedal) {
1159                      dmsg(4,("PEDAL DOWN\n"));                      dmsg(4,("PEDAL DOWN\n"));
1160                      pEngineChannel->SustainPedal = true;                      pEngineChannel->SustainPedal = true;
1161    
# Line 1173  namespace LinuxSampler { namespace gig { Line 1170  namespace LinuxSampler { namespace gig {
1170                          if (!pKey->KeyPressed) {                          if (!pKey->KeyPressed) {
1171                              RTList<Event>::Iterator itNewEvent = pKey->pEvents->allocAppend();                              RTList<Event>::Iterator itNewEvent = pKey->pEvents->allocAppend();
1172                              if (itNewEvent) {                              if (itNewEvent) {
1173                                  *itNewEvent = *itControlChangeEventOnCCList; // copy event to the key's own event list                                  *itNewEvent = *itControlChangeEvent; // copy event to the key's own event list
1174                                  itNewEvent->Type = Event::type_cancel_release; // transform event type                                  itNewEvent->Type = Event::type_cancel_release; // transform event type
1175                              }                              }
1176                              else dmsg(1,("Event pool emtpy!\n"));                              else dmsg(1,("Event pool emtpy!\n"));
1177                          }                          }
1178                      }                      }
1179                  }                  }
1180                  if (itControlChangeEventOnCCList->Param.CC.Value < 64 && pEngineChannel->SustainPedal) {                  if (itControlChangeEvent->Param.CC.Value < 64 && pEngineChannel->SustainPedal) {
1181                      dmsg(4,("PEDAL UP\n"));                      dmsg(4,("PEDAL UP\n"));
1182                      pEngineChannel->SustainPedal = false;                      pEngineChannel->SustainPedal = false;
1183    
# Line 1195  namespace LinuxSampler { namespace gig { Line 1192  namespace LinuxSampler { namespace gig {
1192                          if (!pKey->KeyPressed) {                          if (!pKey->KeyPressed) {
1193                              RTList<Event>::Iterator itNewEvent = pKey->pEvents->allocAppend();                              RTList<Event>::Iterator itNewEvent = pKey->pEvents->allocAppend();
1194                              if (itNewEvent) {                              if (itNewEvent) {
1195                                  *itNewEvent = *itControlChangeEventOnCCList; // copy event to the key's own event list                                  *itNewEvent = *itControlChangeEvent; // copy event to the key's own event list
1196                                  itNewEvent->Type = Event::type_release; // transform event type                                  itNewEvent->Type = Event::type_release; // transform event type
1197                              }                              }
1198                              else dmsg(1,("Event pool emtpy!\n"));                              else dmsg(1,("Event pool emtpy!\n"));
# Line 1209  namespace LinuxSampler { namespace gig { Line 1206  namespace LinuxSampler { namespace gig {
1206              // Channel Mode Messages              // Channel Mode Messages
1207    
1208              case 120: { // all sound off              case 120: { // all sound off
1209                  KillAllVoices(pEngineChannel, itControlChangeEventOnCCList);                  KillAllVoices(pEngineChannel, itControlChangeEvent);
1210                  break;                  break;
1211              }              }
1212              case 121: { // reset all controllers              case 121: { // reset all controllers
# Line 1217  namespace LinuxSampler { namespace gig { Line 1214  namespace LinuxSampler { namespace gig {
1214                  break;                  break;
1215              }              }
1216              case 123: { // all notes off              case 123: { // all notes off
1217                  ReleaseAllVoices(pEngineChannel, itControlChangeEventOnCCList);                  ReleaseAllVoices(pEngineChannel, itControlChangeEvent);
1218                  break;                  break;
1219              }              }
1220          }          }
# Line 1397  namespace LinuxSampler { namespace gig { Line 1394  namespace LinuxSampler { namespace gig {
1394      }      }
1395    
1396      String Engine::Version() {      String Engine::Version() {
1397          String s = "$Revision: 1.52 $";          String s = "$Revision: 1.54 $";
1398          return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword          return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword
1399      }      }
1400    

Legend:
Removed from v.738  
changed lines
  Added in v.775

  ViewVC Help
Powered by ViewVC