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

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

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

revision 2596 by schoenebeck, Thu Jun 5 19:39:12 2014 UTC revision 2600 by schoenebeck, Sat Jun 7 00:16:03 2014 UTC
# Line 471  namespace LinuxSampler { Line 471  namespace LinuxSampler {
471              event.Param.Note.Key      = Key;              event.Param.Note.Key      = Key;
472              event.Param.Note.Velocity = Velocity;              event.Param.Note.Velocity = Velocity;
473              event.Param.Note.Channel  = MidiChannel;              event.Param.Note.Channel  = MidiChannel;
474                event.Format              = {}; // init format specific stuff with zeroes
475              event.pEngineChannel      = this;              event.pEngineChannel      = this;
476              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
477              else dmsg(1,("EngineChannel: Input event queue full!"));              else dmsg(1,("EngineChannel: Input event queue full!"));
# Line 512  namespace LinuxSampler { Line 513  namespace LinuxSampler {
513              event.Param.Note.Key      = Key;              event.Param.Note.Key      = Key;
514              event.Param.Note.Velocity = Velocity;              event.Param.Note.Velocity = Velocity;
515              event.Param.Note.Channel  = MidiChannel;              event.Param.Note.Channel  = MidiChannel;
516                event.Format              = {}; // init format specific stuff with zeroes
517              event.pEngineChannel      = this;              event.pEngineChannel      = this;
518              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
519              else dmsg(1,("EngineChannel: Input event queue full!"));              else dmsg(1,("EngineChannel: Input event queue full!"));
# Line 548  namespace LinuxSampler { Line 550  namespace LinuxSampler {
550              event.Param.Note.Key      = Key;              event.Param.Note.Key      = Key;
551              event.Param.Note.Velocity = Velocity;              event.Param.Note.Velocity = Velocity;
552              event.Param.Note.Channel  = MidiChannel;              event.Param.Note.Channel  = MidiChannel;
553                event.Format              = {}; // init format specific stuff with zeroes
554              event.pEngineChannel      = this;              event.pEngineChannel      = this;
555              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
556              else dmsg(1,("EngineChannel: Input event queue full!"));              else dmsg(1,("EngineChannel: Input event queue full!"));
# Line 589  namespace LinuxSampler { Line 592  namespace LinuxSampler {
592              event.Param.Note.Key      = Key;              event.Param.Note.Key      = Key;
593              event.Param.Note.Velocity = Velocity;              event.Param.Note.Velocity = Velocity;
594              event.Param.Note.Channel  = MidiChannel;              event.Param.Note.Channel  = MidiChannel;
595                event.Format              = {}; // init format specific stuff with zeroes
596              event.pEngineChannel      = this;              event.pEngineChannel      = this;
597              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
598              else dmsg(1,("EngineChannel: Input event queue full!"));              else dmsg(1,("EngineChannel: Input event queue full!"));
# Line 623  namespace LinuxSampler { Line 627  namespace LinuxSampler {
627              event.Type              = Event::type_pitchbend;              event.Type              = Event::type_pitchbend;
628              event.Param.Pitch.Pitch = Pitch;              event.Param.Pitch.Pitch = Pitch;
629              event.Param.Pitch.Channel = MidiChannel;              event.Param.Pitch.Channel = MidiChannel;
630                event.Format            = {}; // init format specific stuff with zeroes
631              event.pEngineChannel    = this;              event.pEngineChannel    = this;
632              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
633              else dmsg(1,("EngineChannel: Input event queue full!"));              else dmsg(1,("EngineChannel: Input event queue full!"));
# Line 652  namespace LinuxSampler { Line 657  namespace LinuxSampler {
657              event.Type              = Event::type_pitchbend;              event.Type              = Event::type_pitchbend;
658              event.Param.Pitch.Pitch = Pitch;              event.Param.Pitch.Pitch = Pitch;
659              event.Param.Pitch.Channel = MidiChannel;              event.Param.Pitch.Channel = MidiChannel;
660                event.Format            = {}; // init format specific stuff with zeroes
661              event.pEngineChannel    = this;              event.pEngineChannel    = this;
662              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
663              else dmsg(1,("AbstractEngineChannel: Input event queue full!"));              else dmsg(1,("AbstractEngineChannel: Input event queue full!"));
# Line 678  namespace LinuxSampler { Line 684  namespace LinuxSampler {
684              event.Param.CC.Controller = Controller;              event.Param.CC.Controller = Controller;
685              event.Param.CC.Value      = Value;              event.Param.CC.Value      = Value;
686              event.Param.CC.Channel    = MidiChannel;              event.Param.CC.Channel    = MidiChannel;
687                event.Format              = {}; // init format specific stuff with zeroes
688              event.pEngineChannel      = this;              event.pEngineChannel      = this;
689              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
690              else dmsg(1,("AbstractEngineChannel: Input event queue full!"));              else dmsg(1,("AbstractEngineChannel: Input event queue full!"));
# Line 709  namespace LinuxSampler { Line 716  namespace LinuxSampler {
716              event.Param.CC.Controller = Controller;              event.Param.CC.Controller = Controller;
717              event.Param.CC.Value      = Value;              event.Param.CC.Value      = Value;
718              event.Param.CC.Channel    = MidiChannel;              event.Param.CC.Channel    = MidiChannel;
719                event.Format              = {}; // init format specific stuff with zeroes
720              event.pEngineChannel      = this;              event.pEngineChannel      = this;
721              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
722              else dmsg(1,("AbstractEngineChannel: Input event queue full!"));              else dmsg(1,("AbstractEngineChannel: Input event queue full!"));
# Line 725  namespace LinuxSampler { Line 733  namespace LinuxSampler {
733              event.Type                          = Event::type_channel_pressure;              event.Type                          = Event::type_channel_pressure;
734              event.Param.ChannelPressure.Value   = Value;              event.Param.ChannelPressure.Value   = Value;
735              event.Param.ChannelPressure.Channel = MidiChannel;              event.Param.ChannelPressure.Channel = MidiChannel;
736                event.Format                        = {}; // init format specific stuff with zeroes
737              event.pEngineChannel                = this;              event.pEngineChannel                = this;
738              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
739              else dmsg(1,("AbstractEngineChannel: Input event queue full!"));              else dmsg(1,("AbstractEngineChannel: Input event queue full!"));
# Line 741  namespace LinuxSampler { Line 750  namespace LinuxSampler {
750              event.Type                          = Event::type_channel_pressure;              event.Type                          = Event::type_channel_pressure;
751              event.Param.ChannelPressure.Value   = Value;              event.Param.ChannelPressure.Value   = Value;
752              event.Param.ChannelPressure.Channel = MidiChannel;              event.Param.ChannelPressure.Channel = MidiChannel;
753                event.Format                        = {}; // init format specific stuff with zeroes
754              event.pEngineChannel                = this;              event.pEngineChannel                = this;
755              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
756              else dmsg(1,("AbstractEngineChannel: Input event queue full!"));              else dmsg(1,("AbstractEngineChannel: Input event queue full!"));
# Line 758  namespace LinuxSampler { Line 768  namespace LinuxSampler {
768              event.Param.NotePressure.Key     = Key;              event.Param.NotePressure.Key     = Key;
769              event.Param.NotePressure.Value   = Value;              event.Param.NotePressure.Value   = Value;
770              event.Param.NotePressure.Channel = MidiChannel;              event.Param.NotePressure.Channel = MidiChannel;
771                event.Format                     = {}; // init format specific stuff with zeroes
772              event.pEngineChannel             = this;              event.pEngineChannel             = this;
773              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
774              else dmsg(1,("AbstractEngineChannel: Input event queue full!"));              else dmsg(1,("AbstractEngineChannel: Input event queue full!"));
# Line 775  namespace LinuxSampler { Line 786  namespace LinuxSampler {
786              event.Param.NotePressure.Key     = Key;              event.Param.NotePressure.Key     = Key;
787              event.Param.NotePressure.Value   = Value;              event.Param.NotePressure.Value   = Value;
788              event.Param.NotePressure.Channel = MidiChannel;              event.Param.NotePressure.Channel = MidiChannel;
789                event.Format                     = {}; // init format specific stuff with zeroes
790              event.pEngineChannel             = this;              event.pEngineChannel             = this;
791              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
792              else dmsg(1,("AbstractEngineChannel: Input event queue full!"));              else dmsg(1,("AbstractEngineChannel: Input event queue full!"));
# Line 887  namespace LinuxSampler { Line 899  namespace LinuxSampler {
899          }          }
900          eventQueueReader.free(); // free all copied events from input queue          eventQueueReader.free(); // free all copied events from input queue
901      }      }
902        
903      /**      /**
904       * Called by real-time instrument script functions to schedule a new event       * Called by real-time instrument script functions to schedule a new event
905       * somewhere in future.       * somewhere in future.
906         *
907         * @returns unique event ID of scheduled new event
908       */       */
909      void AbstractEngineChannel::ScheduleEvent(const Event* pEvent, int delay) { //TODO: delay not implemented yet      int AbstractEngineChannel::ScheduleEvent(const Event* pEvent, int delay) { //TODO: delay not implemented yet
910          // since delay is not implemented yet, we simply add the new event          // since delay is not implemented yet, we simply add the new event
911          // to the event list of the current audio fragmet cycle for now          // to the event list of the current audio fragmet cycle for now
912          RTList<Event>::Iterator itEvent = pEvents->allocAppend();          RTList<Event>::Iterator itEvent = pEvents->allocAppend();
913          if (itEvent) *itEvent = *pEvent; // copy event          if (itEvent) *itEvent = *pEvent; // copy event
914            return pEvents->getID(itEvent);
915        }
916    
917        /**
918         * Called by real-time instrument script functions to ignore the event
919         * reflected by given event ID. The event will be freed immediately to its
920         * pool and cannot be dereferenced by its old ID anymore. Even if its
921         * allocated back from the Pool later on, it will have a different ID.
922         */
923        void AbstractEngineChannel::IgnoreEvent(int id) {
924            RTList<Event>::Iterator it = pEvents->fromID(id);
925            if (it) pEvents->free(it);
926      }      }
927    
928      FxSend* AbstractEngineChannel::AddFxSend(uint8_t MidiCtrl, String Name) throw (Exception) {      FxSend* AbstractEngineChannel::AddFxSend(uint8_t MidiCtrl, String Name) throw (Exception) {

Legend:
Removed from v.2596  
changed lines
  Added in v.2600

  ViewVC Help
Powered by ViewVC