/[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 2558 by schoenebeck, Wed Feb 19 19:02:43 2014 UTC revision 2559 by schoenebeck, Sun May 18 17:38:25 2014 UTC
# Line 619  namespace LinuxSampler { Line 619  namespace LinuxSampler {
619          }          }
620      }      }
621    
622        void AbstractEngineChannel::SendChannelPressure(uint8_t Value, uint8_t MidiChannel) {
623            if (pEngine) {
624                // protection in case there are more than 1 MIDI input threads sending MIDI events to this EngineChannel
625                LockGuard g;
626                if (hasMultipleMIDIInputs()) g = LockGuard(MidiInputMutex);
627    
628                Event event = pEngine->pEventGenerator->CreateEvent();
629                event.Type                          = Event::type_channel_pressure;
630                event.Param.ChannelPressure.Value   = Value;
631                event.Param.ChannelPressure.Channel = MidiChannel;
632                event.pEngineChannel                = this;
633                if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
634                else dmsg(1,("AbstractEngineChannel: Input event queue full!"));
635            }
636        }
637    
638        void AbstractEngineChannel::SendChannelPressure(uint8_t Value, uint8_t MidiChannel, int32_t FragmentPos) {
639            if (pEngine) {
640                // protection in case there are more than 1 MIDI input threads sending MIDI events to this EngineChannel
641                LockGuard g;
642                if (hasMultipleMIDIInputs()) g = LockGuard(MidiInputMutex);
643    
644                Event event = pEngine->pEventGenerator->CreateEvent(FragmentPos);
645                event.Type                          = Event::type_channel_pressure;
646                event.Param.ChannelPressure.Value   = Value;
647                event.Param.ChannelPressure.Channel = MidiChannel;
648                event.pEngineChannel                = this;
649                if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
650                else dmsg(1,("AbstractEngineChannel: Input event queue full!"));
651            }
652        }
653    
654        void AbstractEngineChannel::SendPolyphonicKeyPressure(uint8_t Key, uint8_t Value, uint8_t MidiChannel) {
655            if (pEngine) {
656                // protection in case there are more than 1 MIDI input threads sending MIDI events to this EngineChannel
657                LockGuard g;
658                if (hasMultipleMIDIInputs()) g = LockGuard(MidiInputMutex);
659    
660                Event event = pEngine->pEventGenerator->CreateEvent();
661                event.Type                       = Event::type_note_pressure;
662                event.Param.NotePressure.Key     = Key;
663                event.Param.NotePressure.Value   = Value;
664                event.Param.NotePressure.Channel = MidiChannel;
665                event.pEngineChannel             = this;
666                if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
667                else dmsg(1,("AbstractEngineChannel: Input event queue full!"));
668            }
669        }
670    
671        void AbstractEngineChannel::SendPolyphonicKeyPressure(uint8_t Key, uint8_t Value, uint8_t MidiChannel, int32_t FragmentPos) {
672            if (pEngine) {
673                // protection in case there are more than 1 MIDI input threads sending MIDI events to this EngineChannel
674                LockGuard g;
675                if (hasMultipleMIDIInputs()) g = LockGuard(MidiInputMutex);
676    
677                Event event = pEngine->pEventGenerator->CreateEvent(FragmentPos);
678                event.Type                       = Event::type_note_pressure;
679                event.Param.NotePressure.Key     = Key;
680                event.Param.NotePressure.Value   = Value;
681                event.Param.NotePressure.Channel = MidiChannel;
682                event.pEngineChannel             = this;
683                if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
684                else dmsg(1,("AbstractEngineChannel: Input event queue full!"));
685            }
686        }
687    
688      /**      /**
689       * Copy all events from the engine channel's input event queue buffer to       * Copy all events from the engine channel's input event queue buffer to
690       * the internal event list. This will be done at the beginning of each       * the internal event list. This will be done at the beginning of each

Legend:
Removed from v.2558  
changed lines
  Added in v.2559

  ViewVC Help
Powered by ViewVC