/[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 2521 by schoenebeck, Wed Feb 19 19:02:43 2014 UTC revision 2522 by schoenebeck, Wed Feb 19 19:21:31 2014 UTC
# Line 86  namespace LinuxSampler { Line 86  namespace LinuxSampler {
86          if (Pitch < -8192 || Pitch > 8191) return false;          if (Pitch < -8192 || Pitch > 8191) return false;
87          Pitch += 8192;          Pitch += 8192;
88          // order: LSB, MSB like it would be in a regular pitch bend MIDI message          // 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 };          event_t ev = {
90                EVENT_TYPE_PITCHBEND,
91                static_cast<uint8_t>(Pitch & 0x7f),
92                static_cast<uint8_t>((Pitch >> 7) & 0x7f)
93            };
94          if (p->events.write_space() <= 0) return false;          if (p->events.write_space() <= 0) return false;
95          p->events.push(&ev);          p->events.push(&ev);
96          return true;          return true;
97      }      }
98    
99      bool VirtualMidiDevice::SendProgramChangeToSampler(int Program) {      bool VirtualMidiDevice::SendProgramChangeToSampler(uint8_t Program) {
100          if (Program < 0 || Program > 127) return false;          if (Program > 127) return false;
101          event_t ev = { EVENT_TYPE_PROGRAM, Program, 0 };          event_t ev = { EVENT_TYPE_PROGRAM, Program, 0 };
102          if (p->events.write_space() <= 0) return false;          if (p->events.write_space() <= 0) return false;
103          p->events.push(&ev);          p->events.push(&ev);

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

  ViewVC Help
Powered by ViewVC