linuxsampler 2.3.1
VirtualMidiDevice.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2008 - 2021 Christian Schoenebeck
3 */
4
5#ifndef LS_VIRTUALMIDIDEVICE_H
6#define LS_VIRTUALMIDIDEVICE_H
7
8#include "../../common/global.h"
9
10namespace LinuxSampler {
11
21public:
30
36
38 // Device methods
39 // (called by the VirtualMidiDevice implementation)
40
48
56
64
72
82
96
105
114
123
128
133
142
151
156
158 // Sampler methods
159 // (usually only called by the Sampler)
160
172
184
196
207
209 // General Purpose Methods
210
219 void SetMaxEvents(int n);
220
235 void Reset();
236
241
246
247private:
248 struct private_data_t;
249 private_data_t* const p;
250};
251
252} // namespace LinuxSampler
253
254#endif // LS_VIRTUALMIDIDEVICE_H
Wraps as a kind of pointer class some data object shared with other threads, to protect / synchronize...
Light-weight MIDI interface (for MIDI in & out) intended to be used by pure software MIDI "devices",...
bool SendCCToSampler(uint8_t Controller, uint8_t Value)
Sends a MIDI Control Change event to the sampler.
bool SendNoteOffToSampler(uint8_t Key, uint8_t Velocity)
Sends a MIDI note off event to the sampler.
uint8_t NoteOnVelocity(uint8_t Key)
Returns the velocity of the last note on event.
bool ControllersChanged()
Can be called by the virtual MIDI device to check whether a Control Change MIDI event arrived to the ...
void Reset()
Intended to be called on "panic" / all notes off situations.
void SendCCToDevice(uint8_t Controller, uint8_t Value)
Informs the virtual MIDI device that a Control Change event occured (e.g.
bool SendPitchBendToSampler(int Pitch)
Sends a MIDI Pitch Bend event to the sampler.
void SendNoteOnToDevice(uint8_t Key, uint8_t Velocity)
Informs the virtual MIDI device that a note on event occured (e.g.
uint8_t ControllerValue(uint8_t Controller)
Returns the value of the last Control Change event.
virtual ~VirtualMidiDevice()
Destructor.
void SetMaxEvents(int n)
Adjusts the internal event buffer to cover at least the given amount of MIDI events.
uint8_t NoteOffVelocity(uint8_t Key)
Returns the velocity of the last note off event.
bool ControllerChanged(uint8_t Controller)
Can be called by the virtual MIDI device to check whether a Control Change MIDI event arrived to the ...
void SendNoteOffToDevice(uint8_t Key, uint8_t Velocity)
Informs the virtual MIDI device that a note off event occured (e.g.
bool SendChannelPressureToSampler(uint8_t Pressure)
Sends a MIDI Channel Pressure (aftertouch) event to the sampler.
bool NotesChanged()
Can be called by the virtual MIDI device to check whether a new note on or note off MIDI event arrive...
bool NoteChanged(uint8_t Key)
Can be called by the virtual MIDI device to check whether a new note on or note off MIDI event arrive...
bool NoteIsActive(uint8_t Key)
Can be called by the virtual MIDI device to check which key / note is currently active by the sampler...
bool SendProgramChangeToSampler(uint8_t Program)
Sends a MIDI Program Change event to the sampler.
bool GetMidiEventFromDevice(event_t &Event)
Gets the next pending MIDI event from the virtual MIDI device by using a lockfree FIFO.
bool SendNoteOnToSampler(uint8_t Key, uint8_t Velocity)
Sends a MIDI note on event to the sampler.
uint8_t Arg1
Depends on Type (e.g. key number for note on/off events).
uint8_t Arg2
Depends on Type (e.g. velocity for note on/off events).