38 return bytes[0] & 0xf;
43 bytes[0] = (
bytes[0] & 0xf0) | (channel & 0xf);
65 bytes[1] = note & 0x7f;
76 bytes[2] = value & 0x7f;
#define PRIVATE
Attribute for private functions not intended to be called by plugins.
Definition common.hpp:32
Driver * getDriver(int driverId)
std::vector< int > getDriverIds()
void addDriver(int driverId, Driver *driver)
Registers a new MIDI driver.
Root namespace for the Rack API.
Definition AudioDisplay.hpp:9
Rack instance state.
Definition context.hpp:45
A single MIDI device of a driver API.
Definition midi.hpp:157
virtual ~Device()
Definition midi.hpp:158
virtual std::string getName()
Definition midi.hpp:159
Wraps a MIDI driver API containing any number of MIDI devices.
Definition midi.hpp:101
virtual int getDefaultOutputDeviceId()
Definition midi.hpp:135
virtual std::string getInputDeviceName(int deviceId)
Returns the name of an input device without obtaining it.
Definition midi.hpp:116
virtual void unsubscribeOutput(int deviceId, Output *output)
Definition midi.hpp:144
virtual void unsubscribeInput(int deviceId, Input *input)
Removes the give port as a reference holder of a device.
Definition midi.hpp:128
virtual std::string getName()
Returns the name of the driver.
Definition midi.hpp:104
virtual ~Driver()
Definition midi.hpp:102
virtual std::string getOutputDeviceName(int deviceId)
Definition midi.hpp:138
virtual std::vector< int > getOutputDeviceIds()
Definition midi.hpp:132
virtual InputDevice * subscribeInput(int deviceId, Input *input)
Adds the given port as a reference holder of a device and returns the it.
Definition midi.hpp:122
virtual int getDefaultInputDeviceId()
Returns the default device to use when the driver is selected, or -1 for none.
Definition midi.hpp:112
virtual std::vector< int > getInputDeviceIds()
Returns a list of all input device IDs that can be subscribed to.
Definition midi.hpp:108
virtual OutputDevice * subscribeOutput(int deviceId, Output *output)
Definition midi.hpp:141
void setSize(int size)
Definition midi.hpp:31
void setFrame(int64_t frame)
Definition midi.hpp:85
std::string toString() const
void setValue(uint8_t value)
Definition midi.hpp:73
void setStatus(uint8_t status)
Definition midi.hpp:51
std::vector< uint8_t > bytes
Initialized to 3 empty bytes.
Definition midi.hpp:18
Message()
Definition midi.hpp:26
uint8_t getNote() const
Definition midi.hpp:57
void setNote(uint8_t note)
Definition midi.hpp:62
void setChannel(uint8_t channel)
Definition midi.hpp:40
int getSize() const
Definition midi.hpp:28
uint8_t getChannel() const
Definition midi.hpp:35
int64_t getFrame() const
Definition midi.hpp:81
uint8_t getStatus() const
Definition midi.hpp:46
int64_t frame
The Engine frame timestamp of the Message.
Definition midi.hpp:24
uint8_t getValue() const
Definition midi.hpp:68
void unsubscribe(Output *output)
Not public.
virtual void sendMessage(const Message &message)
Sends a MIDI message to the device.
Definition midi.hpp:181
std::set< Output * > subscribed
Definition midi.hpp:175
void subscribe(Output *output)
Not public.
void setDeviceId(int deviceId) override
OutputDevice * outputDevice
Not owned.
Definition midi.hpp:274
void sendMessage(const Message &message)
std::vector< int > getDeviceIds() override
std::vector< int > getChannels() override
std::string getDeviceName(int deviceId) override
int getDefaultDeviceId() override
A handle to a Device, typically owned by modules to have shared access to a single Device.
Definition midi.hpp:195
std::string getChannelName(int channel)
void setChannel(int channel)
virtual std::string getDeviceName(int deviceId)=0
int deviceId
Definition midi.hpp:206
virtual std::vector< int > getChannels()=0
void fromJson(json_t *rootJ)
virtual std::vector< int > getDeviceIds()=0
Driver * driver
Not owned.
Definition midi.hpp:208
virtual void setDeviceId(int deviceId)=0
int driverId
Definition midi.hpp:205
int channel
For MIDI output, the channel to automatically set outbound messages.
Definition midi.hpp:202
void setDriverId(int driverId)
virtual int getDefaultDeviceId()=0
Context * context
Definition midi.hpp:210
Device * device
Definition midi.hpp:209