![]() |
VCV Rack API v2
|
A handle to a Device, typically owned by modules to have shared access to a single Device. More...
#include <midi.hpp>
Public Member Functions | |
| Port () | |
| virtual | ~Port () |
| Driver * | getDriver () |
| int | getDriverId () |
| void | setDriverId (int driverId) |
| Device * | getDevice () |
| virtual std::vector< int > | getDeviceIds ()=0 |
| virtual int | getDefaultDeviceId ()=0 |
| int | getDeviceId () |
| virtual void | setDeviceId (int deviceId)=0 |
| virtual std::string | getDeviceName (int deviceId)=0 |
| virtual std::vector< int > | getChannels ()=0 |
| int | getChannel () |
| void | setChannel (int channel) |
| std::string | getChannelName (int channel) |
| json_t * | toJson () |
| void | fromJson (json_t *rootJ) |
Public Attributes | |
| int | channel = -1 |
| For MIDI output, the channel to automatically set outbound messages. | |
| int | driverId = -1 |
| int | deviceId = -1 |
| Driver * | driver = NULL |
| Not owned. | |
| Device * | device = NULL |
| Context * | context |
A handle to a Device, typically owned by modules to have shared access to a single Device.
All Port methods safely wrap Drivers methods. That is, if the active Device throws a rack::Exception, it is caught and logged inside all Port methods, so they do not throw exceptions.
Use Input or Output subclasses in your module, not Port directly.
| rack::midi::Port::Port | ( | ) |
|
virtual |
| Driver * rack::midi::Port::getDriver | ( | ) |
| int rack::midi::Port::getDriverId | ( | ) |
| void rack::midi::Port::setDriverId | ( | int | driverId | ) |
| Device * rack::midi::Port::getDevice | ( | ) |
|
pure virtual |
Implemented in rack::midi::Input, and rack::midi::Output.
|
pure virtual |
Implemented in rack::midi::Input, and rack::midi::Output.
| int rack::midi::Port::getDeviceId | ( | ) |
|
pure virtual |
Implemented in rack::midi::Input, and rack::midi::Output.
|
pure virtual |
Implemented in rack::midi::Input, and rack::midi::Output.
|
pure virtual |
Implemented in rack::midi::Input, and rack::midi::Output.
| int rack::midi::Port::getChannel | ( | ) |
| void rack::midi::Port::setChannel | ( | int | channel | ) |
| std::string rack::midi::Port::getChannelName | ( | int | channel | ) |
| json_t * rack::midi::Port::toJson | ( | ) |
| void rack::midi::Port::fromJson | ( | json_t * | rootJ | ) |
| int rack::midi::Port::channel = -1 |
For MIDI output, the channel to automatically set outbound messages.
If -1, the channel is not overwritten and must be set by MIDI generator.
For MIDI input, messages will be filtered by the channel. If -1, all MIDI channels pass through.
| int rack::midi::Port::driverId = -1 |
| int rack::midi::Port::deviceId = -1 |
| Context* rack::midi::Port::context |