NiCMidi 1.1.0
A MIDI library derived from J.D.Koftinoff jdksmidi
|
A MIDITickComponent which immediately echoes to an out MIDI port all messages incoming from an in MIDI port. More...
#include <thru.h>
Public Member Functions | |
MIDIThru () | |
The constructor. More... | |
virtual | ~MIDIThru () |
The destructor. More... | |
virtual void | Reset () |
Resets the class to initial status: More... | |
unsigned int | GetInPort () const |
Returns the number of the MIDI in port from which messages are actually being received. More... | |
unsigned int | GetOutPort () const |
Returns a pointer to the MIDIOutDriver to whom messages are actually being sent. More... | |
MIDIProcessor * | GetProcessor () |
Returns a pointer to the MIDIProcessor attached to the thru (see SetProcessor()). More... | |
const MIDIProcessor * | GetProcessor () const |
Returns a pointer to the MIDIProcessor attached to the thru (see SetProcessor()). More... | |
int | GetInChannel () const |
Returns the thru in channel (see SetInChannel()) More... | |
int | GetOutChannel () const |
Returns the thru out channel (see SetOutChannel()) More... | |
virtual bool | SetInPort (unsigned int port) |
Selects the hardware in port from which messages will be received. More... | |
virtual bool | SetOutPort (unsigned int port) |
Selects the hardware out port to whom messages will be sent. More... | |
virtual void | SetProcessor (MIDIProcessor *proc) |
Sets the out processor, which can manipulate messages arrived to the in port before they are sent to the out port (see MIDIProcessor). More... | |
virtual bool | SetInChannel (int chan) |
Sets the channel for incoming thru messages. More... | |
virtual bool | SetOutChannel (int chan) |
Sets the channel for outgoing thru messages. More... | |
virtual void | Start () |
Starts the MIDI thru. More... | |
virtual void | Stop () |
Stops the MIDI thru. More... | |
![]() | |
MIDITickComponent (tPriority pr, MIDITick func) | |
The constructor. More... | |
virtual | ~MIDITickComponent () |
The destructor. More... | |
MIDITick * | GetFunc () const |
Returns the address of the StaticTickProc() method, which will be called by the MIDIManager at every clock tick. More... | |
tPriority | GetPriority () const |
Returns the priority. More... | |
tMsecs | GetDevOffset () const |
Returns the user time offset parameter (see SetDevOffset()). More... | |
bool | IsPlaying () const |
Returns true if the callback procedure is active. More... | |
void | SetDevOffset (tMsecs dev_offs) |
Sets an user defined time offset, which will be added to every time calculation. More... | |
Protected Member Functions | |
virtual void | TickProc (tMsecs sys_time) |
Implements the pure virtual method inherited from MIDITickComponent (you must not call it directly). More... | |
Static Protected Member Functions | |
static void | StaticTickProc (tMsecs sys_time, void *pt) |
Implements the static method inherited from MIDITickComponent and called at every timer tick. More... | |
![]() | |
static void | StaticTickProc (tMsecs sys_time, void *pt) |
This is the static callback procedure which the MIDIManager will call at every MIDITimer tick. More... | |
Additional Inherited Members | |
![]() | |
const MIDITick * | tick_proc |
The pointer to the static callback (set by the constructor to StaticTickProc()). More... | |
tMsecs | dev_time_offset |
A time offset set by the user and which you can use for your calculations. More... | |
tMsecs | sys_time_offset |
The system time of the last call of Start(). More... | |
std::recursive_mutex | proc_lock |
A mutex you can use for implementing thread safe methods. More... | |
A MIDITickComponent which immediately echoes to an out MIDI port all messages incoming from an in MIDI port.
You can choose the in and out ports, select an unique channel for receiving and sending messages (or receive and send on any channel) and insert a MIDIProcessor between in and out ports for messages elaboration.
MIDIThru::MIDIThru | ( | ) |
The constructor.
It raises an exception if in your system there are no MIDI in or MIDI out ports, otherwise sets them to the OS id 0 ports.
RtMidiError::INVALID_DEVICE | if in the system are not present MIDI out or MIDI in ports |
|
virtual |
The destructor.
|
virtual |
Resets the class to initial status:
Implements MIDITickComponent.
|
inline |
Returns the number of the MIDI in port from which messages are actually being received.
|
inline |
Returns a pointer to the MIDIOutDriver to whom messages are actually being sent.
|
inline |
Returns a pointer to the MIDIProcessor attached to the thru (see SetProcessor()).
|
inline |
Returns a pointer to the MIDIProcessor attached to the thru (see SetProcessor()).
|
inline |
Returns the thru in channel (see SetInChannel())
|
inline |
Returns the thru out channel (see SetOutChannel())
|
virtual |
Selects the hardware in port from which messages will be received.
This can be done even if thru is already enabled.
|
virtual |
Selects the hardware out port to whom messages will be sent.
This can be done even if thru is already enabled.
|
virtual |
Sets the out processor, which can manipulate messages arrived to the in port before they are sent to the out port (see MIDIProcessor).
If you want to eliminate a processor already set, call it with 0 as parameter (this only sets the processor pointer to 0! The class doesn't own its processor).
|
virtual |
Sets the channel for incoming thru messages.
chan | 0 ... 15: the thru will accept only messages with a specific channel; -1: the thru will accept all messages coming from the in port (this is the default). Non channel messages are always received. |
|
virtual |
Sets the channel for outgoing thru messages.
chan | 0 ... 15: the thru will redirect all messages to a specific channel; -1: the thru will leave channel messages unchanged (this is the default). |
|
virtual |
|
virtual |
|
staticprotected |
Implements the static method inherited from MIDITickComponent and called at every timer tick.
It only calls the member TickProc().
|
protectedvirtual |
Implements the pure virtual method inherited from MIDITickComponent (you must not call it directly).
Implements MIDITickComponent.