#include <Destination.h>
Inheritance diagram for TSE3::Ins::Destination:
Public Member Functions | |
Destination () | |
~Destination () | |
Instrument * | defaultInstrument () const |
void | setDefaultInstrument (Instrument *instrument) |
bool | allChannels (int port) |
Instrument * | port (int port) |
void | setPort (int port, Instrument *instrument) |
Instrument * | channel (int channel, int port) |
void | setChannel (int channel, int port, Instrument *instrument) |
size_t | numInstruments () const |
Instrument * | instrument (size_t index) |
Instrument * | instrument (const std::string &title) |
void | addInstrument (Instrument *instrument) |
void | removeInstrument (Instrument *instrument) |
The Destination class is a simple utility class that can be used to associate Instrument definitions with MIDI outputs (channel/port pairs).
An application can use this to remember what sort of instrument definition to use for which output; to present the correct program change information to the user, for example.
For each port, you may choose one Instrument for every channel, or may select a number of different Instrument objects for the different individual channels.
You may also leave a particular definition unspecified (as zero).
The Destination class has a secondary purpose of keeping track of all the currently used Instrument objects, keeping the list of desinations up to date if any Instrument is removed.
Since this class operates independantly of a TSE3::MidiScheduler it cannot track what port numbers are currently valid, and which are not.
|
Creates a Destination object. Initially no destinations are specified. |
|
|
|
Returns the default Instrument. This is the instrument definition that is returned if no other mapping has been made. By default, this is set to zero.
|
|
Sets the default Instrument.
|
|
Returns whether there is one Instrument selected for every channel on this port (true) or whether each channel is been assigned separately (false).
|
|
Returns the Instrument selected for this entire port. This instrument is used for every channel on this port.
If no instrument has been specified for this
If allChannels is false for this
|
|
Sets which instrument is used by this port. This will have the side effect of making allChannels return true.
You may specify an
|
|
Returns the Instrument selected for this channel/port destination.
If no instrument has been specified for this port/channel, then
If allChannels is true for this
|
|
Sets which instrument is used by this channel/port pair. This will have the side effect of making allChannels return false.
You may specify an
|
|
Returns the number of Instrument objects currently managed by the Destination object. |
|
Returns the Instrument at the given index. The list of Instrument object is ordered alphabetically.
|
|
Returns the Instrument with the given title, or zero if there is no such Instrument.
|
|
Adds the specified Instrument to the list of Instrument objects. You can only insert a given Instrument once. The instrument is inserted into the list in alphabetical order of title. The Instrument object is considered to be 'owned' by the Destination class, and will be deleted when the Destination is.
|
|
Removed the specified Instrument from the list of Instrument objects. If Once removed it is your responsibility to delete the Instrument.
|