/[svn]/linuxsampler/trunk/src/drivers/midi/VirtualMidiDevice.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/drivers/midi/VirtualMidiDevice.cpp

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

revision 2385 by schoenebeck, Fri Dec 14 17:41:32 2012 UTC revision 2521 by schoenebeck, Wed Feb 19 19:02:43 2014 UTC
# Line 1  Line 1 
1  /*  /*
2      Copyright (C) 2008 - 2012 Christian Schoenebeck      Copyright (C) 2008 - 2014 Christian Schoenebeck
3   */   */
4    
5  #include "VirtualMidiDevice.h"  #include "VirtualMidiDevice.h"
# Line 80  namespace LinuxSampler { Line 80  namespace LinuxSampler {
80          if (p->events.write_space() <= 0) return false;          if (p->events.write_space() <= 0) return false;
81          p->events.push(&ev);          p->events.push(&ev);
82          return true;          return true;
83        }
84    
85        bool VirtualMidiDevice::SendPitchBendToSampler(int Pitch) {
86            if (Pitch < -8192 || Pitch > 8191) return false;
87            Pitch += 8192;
88            // order: LSB, MSB like it would be in a regular pitch bend MIDI message
89            event_t ev = { EVENT_TYPE_PITCHBEND, Pitch & 0x7f, (Pitch >> 7) & 0x7f };
90            if (p->events.write_space() <= 0) return false;
91            p->events.push(&ev);
92            return true;
93        }
94    
95        bool VirtualMidiDevice::SendProgramChangeToSampler(int Program) {
96            if (Program < 0 || Program > 127) return false;
97            event_t ev = { EVENT_TYPE_PROGRAM, Program, 0 };
98            if (p->events.write_space() <= 0) return false;
99            p->events.push(&ev);
100            return true;
101      }      }
102    
103      bool VirtualMidiDevice::GetMidiEventFromDevice(event_t& Event) {      bool VirtualMidiDevice::GetMidiEventFromDevice(event_t& Event) {

Legend:
Removed from v.2385  
changed lines
  Added in v.2521

  ViewVC Help
Powered by ViewVC