|
CSL
6.0
|
MIDIOut class write msgs out to a device (or file) More...
#include <MIDIIOJ.h>
Inheritance diagram for csl::MIDIOut:Public Member Functions | |
| MIDIOut () | |
| ~MIDIOut () | |
| virtual void | open (int deviceID) |
| open a device More... | |
| void | write (CMIDIMessage &msg) |
| void | writeNoteOn (unsigned channel, unsigned pitch, unsigned velocity) |
| MIDINote#, [0, 127]. More... | |
| void | writeNoteOn (unsigned channel, float frequency, float amplitude) |
| [Hz], [0.0 1.0]; More... | |
| void | writeNoteOff (unsigned channel, unsigned pitch, unsigned velocity) |
| MIDINote#, [0, 127]. More... | |
| void | writeNoteOff (unsigned channel, float frequency, float amplitude) |
| [Hz], [0.0 1.0]; More... | |
| void | writePolyTouch (unsigned channel, unsigned pitch, unsigned amount) |
| void | writeControlChange (unsigned channel, unsigned function, unsigned value) |
| void | writeProgramChange (unsigned channel, unsigned programNum) |
| void | writeAftertouch (unsigned channel, unsigned amount) |
| [0, 127] More... | |
| void | writePitchWheel (unsigned channel, unsigned amount) |
| [0, 16384] More... | |
| void | writeSysEX (long when, unsigned char *msg) |
| MIDIOut () | |
| ~MIDIOut () | |
| unsigned | buffer_size () |
| void | set_buffer_size (unsigned bufferSize) |
| long | latency () |
| void | set_latency (long latency) |
| void | open () |
| void | open (int deviceID) |
| open a device More... | |
| void | set_message (CSL_MIDIMessage msg, long when) |
| void | write () |
| void | write (CSL_MIDIMessage *msg, long length) |
| thin wrapper for Pm_Write More... | |
| void | write_short (CSL_MIDIMessage msg) |
| void | write_SysEX (long when, unsigned char *msg) |
| void | write_NoteOn (unsigned channel, unsigned pitch, unsigned velocity) |
| convenience method for each MIDI messages writes directly and doesn't use member mMsg for temporal storage. More... | |
| void | write_NoteOn (unsigned channel, float frequency, float amplitude) |
| [Hz], [0.0 1.0]; More... | |
| void | write_NoteOff (unsigned channel, unsigned pitch, unsigned velocity) |
| MIDINote#, [0, 127]. More... | |
| void | write_NoteOff (unsigned channel, float frequency, float amplitude) |
| [Hz], [0.0 1.0]; More... | |
| void | write_PolyTouch (unsigned channel, unsigned pitch, unsigned amount) |
| void | write_ControlChange (unsigned channel, unsigned function, unsigned value) |
| void | write_ProgramChange (unsigned channel, unsigned programNum) |
| void | write_Aftertouch (unsigned channel, unsigned amount) |
| [0, 127] More... | |
| void | write_PitchWheel (unsigned channel, unsigned amount) |
| [0, 16384] More... | |
| bool | isOpen () |
| true if MIDI stream is opened. More... | |
| virtual void | close () |
| closing MIDI stream More... | |
| void | close () |
| closing MIDI stream More... | |
| virtual void | start () |
| virtual void | stop () |
| start MIDI stream More... | |
| virtual void | clear () |
| stop MIDI stream More... | |
| void | dumpBuffer () |
| bool | is_open () |
| can't open the abstract class More... | |
| void | dump_device_info () |
| printing device info for all devices. More... | |
| void | dump_count_devices () |
| printing total number of devices available More... | |
| int | count_devices () |
| int | get_default_input_id () |
| int | get_default_output_id () |
| const PmDeviceInfo * | get_device_info (int deviceID) |
| void | attachObserver (Observer *) |
| (possibly notify obersvers on my death) More... | |
| void | detachObserver (Observer *) |
| void | changed (void *argument) |
| this is what I send to myself to notify my observers; It's not overridden in general. It results in the observers receiving update() calls < override evaluate to filter updates to the observer map More... | |
| virtual int | evaluate (void *argument) |
Static Public Member Functions | |
| static int | countDevices () |
| static void | dumpDevices () |
| printing device info for all devices. More... | |
Public Attributes | |
| juce::MidiOutput * | mOut |
| the juce midi output is public More... | |
| int | mDeviceID |
| device ID which will/is opened. More... | |
| CMIDIMessage | mMsg2 |
| juce::MidiBuffer | mBuffer |
| I/O buffer. More... | |
Protected Member Functions | |
| void | handleError (CException *err) |
| error handler More... | |
| void | copyMessage (CMIDIMessage &source, CMIDIMessage &dest) |
| copy csl::CMIDIMessage <–> juce::MidiMessage More... | |
| void | copyMessage (CMIDIMessage &source, juce::MidiMessage *dest) |
| void | copyMessage (const juce::MidiMessage &source, CMIDIMessage &dest) |
| void | handle_error (PmError err) |
Protected Attributes | |
| long | mBufferSize |
| long | mLatency |
| CSL_MIDIMessage | mMsg |
| PmDeviceID | mDeviceID |
| device ID which will/is opened. More... | |
| juce::MidiMessage * | mJMsg |
| JUCE-format message. More... | |
| bool | mIsOpen |
| instance status indicators More... | |
| long | mFilterFlag |
| PmStream * | mMIDIStream |
| opened stream More... | |
| bool | mIsInput |
| bool | mIsOutput |
Static Protected Attributes | |
| static bool | mIsInitialized = false |
| < static flags to keep track of driver state More... | |
| static unsigned | mNumInstantiated = 0 |
| static bool | mIsPortTimeStarted = false |
| status indicators More... | |
| MIDIOut::MIDIOut | ( | ) |
Definition at line 326 of file MIDIIOJ.cpp.
References mBufferSize, csl::MIDIIO::mDeviceID, mLatency, and mOut.
| MIDIOut::~MIDIOut | ( | ) |
Definition at line 336 of file MIDIIOJ.cpp.
| csl::MIDIOut::MIDIOut | ( | ) |
| csl::MIDIOut::~MIDIOut | ( | ) |
|
virtual |
open a device
Implements csl::MIDIIO.
Definition at line 339 of file MIDIIOJ.cpp.
References csl::MIDIIO::mDeviceID, and mOut.
| void MIDIOut::write | ( | CMIDIMessage & | msg | ) |
Definition at line 344 of file MIDIIOJ.cpp.
References csl::MIDIIO::copyMessage(), csl::MIDIIO::mJMsg, and mOut.
| void MIDIOut::writeNoteOn | ( | unsigned | channel, |
| unsigned | pitch, | ||
| unsigned | velocity | ||
| ) |
MIDINote#, [0, 127].
Definition at line 353 of file MIDIIOJ.cpp.
| void MIDIOut::writeNoteOn | ( | unsigned | channel, |
| float | frequency, | ||
| float | amplitude | ||
| ) |
[Hz], [0.0 1.0];
Definition at line 356 of file MIDIIOJ.cpp.
| void MIDIOut::writeNoteOff | ( | unsigned | channel, |
| unsigned | pitch, | ||
| unsigned | velocity | ||
| ) |
MIDINote#, [0, 127].
Definition at line 359 of file MIDIIOJ.cpp.
| void MIDIOut::writeNoteOff | ( | unsigned | channel, |
| float | frequency, | ||
| float | amplitude | ||
| ) |
[Hz], [0.0 1.0];
Definition at line 362 of file MIDIIOJ.cpp.
| void MIDIOut::writePolyTouch | ( | unsigned | channel, |
| unsigned | pitch, | ||
| unsigned | amount | ||
| ) |
Definition at line 365 of file MIDIIOJ.cpp.
| void MIDIOut::writeControlChange | ( | unsigned | channel, |
| unsigned | function, | ||
| unsigned | value | ||
| ) |
Definition at line 368 of file MIDIIOJ.cpp.
| void MIDIOut::writeProgramChange | ( | unsigned | channel, |
| unsigned | programNum | ||
| ) |
Definition at line 371 of file MIDIIOJ.cpp.
| void MIDIOut::writeAftertouch | ( | unsigned | channel, |
| unsigned | amount | ||
| ) |
[0, 127]
Definition at line 374 of file MIDIIOJ.cpp.
| void MIDIOut::writePitchWheel | ( | unsigned | channel, |
| unsigned | amount | ||
| ) |
[0, 16384]
Definition at line 377 of file MIDIIOJ.cpp.
| void MIDIOut::writeSysEX | ( | long | when, |
| unsigned char * | msg | ||
| ) |
Definition at line 350 of file MIDIIOJ.cpp.
| unsigned MIDIOut::buffer_size | ( | ) |
Definition at line 502 of file MIDIIOP.cpp.
References mBufferSize.
| void MIDIOut::set_buffer_size | ( | unsigned | bufferSize | ) |
Definition at line 503 of file MIDIIOP.cpp.
References mBufferSize.
| long MIDIOut::latency | ( | ) |
| void MIDIOut::set_latency | ( | long | latency | ) |
Definition at line 505 of file MIDIIOP.cpp.
|
virtual |
Reimplemented from csl::MIDIIO.
Definition at line 507 of file MIDIIOP.cpp.
References DRIVER_INFO, csl::MIDIIO::get_device_info(), csl::MIDIIO::handle_error(), mBufferSize, csl::MIDIIO::mDeviceID, csl::MIDIIO::mIsPortTimeStarted, mLatency, csl::MIDIIO::mMIDIStream, TIME_INFO, TIME_PROC, and TIME_START.
|
virtual |
open a device
Implements csl::MIDIIO.
| void MIDIOut::set_message | ( | CSL_MIDIMessage | msg, |
| long | when | ||
| ) |
Definition at line 530 of file MIDIIOP.cpp.
References csl::copy_CSL_MIDIMessage(), and mMsg.
| void MIDIOut::write | ( | ) |
Definition at line 534 of file MIDIIOP.cpp.
References csl::CSL_MIDIMessageToPmEvent(), csl::MIDIIO::handle_error(), csl::MIDIIO::mMIDIStream, and mMsg.
Referenced by write().
| void MIDIOut::write | ( | CSL_MIDIMessage * | msg, |
| long | length | ||
| ) |
thin wrapper for Pm_Write
Definition at line 545 of file MIDIIOP.cpp.
References csl::copy_CSL_MIDIMessage(), mMsg, and write().
| void MIDIOut::write_short | ( | CSL_MIDIMessage | msg | ) |
Definition at line 553 of file MIDIIOP.cpp.
References csl::CSL_MIDIMessage::channel, csl::CSL_MIDIMessage::data1, csl::CSL_MIDIMessage::data2, csl::MIDIIO::handle_error(), csl::CSL_MIDIMessage::message, csl::MIDIIO::mMIDIStream, and csl::CSL_MIDIMessage::time.
| void MIDIOut::write_SysEX | ( | long | when, |
| unsigned char * | msg | ||
| ) |
Definition at line 565 of file MIDIIOP.cpp.
References csl::MIDIIO::handle_error(), and csl::MIDIIO::mMIDIStream.
| void MIDIOut::write_NoteOn | ( | unsigned | channel, |
| unsigned | pitch, | ||
| unsigned | velocity | ||
| ) |
convenience method for each MIDI messages writes directly and doesn't use member mMsg for temporal storage.
MIDINote#, [0, 127]
Definition at line 572 of file MIDIIOP.cpp.
References csl::MIDIIO::handle_error(), csl::kNoteOn, csl::Message_ChannelToStatus(), csl::MIDIIO::mMIDIStream, and TIME_PROC.
| void MIDIOut::write_NoteOn | ( | unsigned | channel, |
| float | frequency, | ||
| float | amplitude | ||
| ) |
[Hz], [0.0 1.0];
Definition at line 584 of file MIDIIOP.cpp.
References csl::freqToKey(), csl::MIDIIO::handle_error(), csl::kNoteOn, csl::Message_ChannelToStatus(), csl::MIDIIO::mMIDIStream, and TIME_PROC.
| void MIDIOut::write_NoteOff | ( | unsigned | channel, |
| unsigned | pitch, | ||
| unsigned | velocity | ||
| ) |
MIDINote#, [0, 127].
Definition at line 596 of file MIDIIOP.cpp.
References csl::MIDIIO::handle_error(), csl::kNoteOff, csl::Message_ChannelToStatus(), csl::MIDIIO::mMIDIStream, and TIME_PROC.
| void MIDIOut::write_NoteOff | ( | unsigned | channel, |
| float | frequency, | ||
| float | amplitude | ||
| ) |
[Hz], [0.0 1.0];
Definition at line 608 of file MIDIIOP.cpp.
References csl::freqToKey(), csl::MIDIIO::handle_error(), csl::kNoteOff, csl::Message_ChannelToStatus(), csl::MIDIIO::mMIDIStream, and TIME_PROC.
| void MIDIOut::write_PolyTouch | ( | unsigned | channel, |
| unsigned | pitch, | ||
| unsigned | amount | ||
| ) |
Definition at line 620 of file MIDIIOP.cpp.
References csl::MIDIIO::handle_error(), csl::kPolyTouch, csl::Message_ChannelToStatus(), csl::MIDIIO::mMIDIStream, and TIME_PROC.
| void MIDIOut::write_ControlChange | ( | unsigned | channel, |
| unsigned | function, | ||
| unsigned | value | ||
| ) |
Definition at line 632 of file MIDIIOP.cpp.
References csl::MIDIIO::handle_error(), csl::kControlChange, csl::Message_ChannelToStatus(), csl::MIDIIO::mMIDIStream, and TIME_PROC.
| void MIDIOut::write_ProgramChange | ( | unsigned | channel, |
| unsigned | programNum | ||
| ) |
Definition at line 644 of file MIDIIOP.cpp.
References csl::MIDIIO::handle_error(), csl::kProgramChange, csl::Message_ChannelToStatus(), csl::MIDIIO::mMIDIStream, and TIME_PROC.
| void MIDIOut::write_Aftertouch | ( | unsigned | channel, |
| unsigned | amount | ||
| ) |
[0, 127]
Definition at line 656 of file MIDIIOP.cpp.
References csl::MIDIIO::handle_error(), csl::kAftertouch, csl::Message_ChannelToStatus(), csl::MIDIIO::mMIDIStream, and TIME_PROC.
| void MIDIOut::write_PitchWheel | ( | unsigned | channel, |
| unsigned | amount | ||
| ) |
[0, 16384]
Definition at line 668 of file MIDIIOP.cpp.
References csl::MIDIIO::handle_error(), csl::kPitchWheel, csl::Message_ChannelToStatus(), csl::MIDIIO::mMIDIStream, and TIME_PROC.
|
staticinherited |
Definition at line 51 of file MIDIIOJ.cpp.
|
staticinherited |
printing device info for all devices.
Definition at line 58 of file MIDIIOJ.cpp.
References len, and csl::logMsg().
|
inherited |
true if MIDI stream is opened.
Definition at line 91 of file MIDIIOJ.cpp.
References csl::MIDIIO::mIsOpen.
|
virtualinherited |
closing MIDI stream
Definition at line 95 of file MIDIIOJ.cpp.
References csl::MIDIIO::clear(), and csl::MIDIIO::mIsOpen.
Referenced by CSLMIDIComponent::~CSLMIDIComponent().
|
inherited |
closing MIDI stream
|
inlinevirtualinherited |
Reimplemented in csl::MIDIIn.
|
inlinevirtualinherited |
start MIDI stream
Reimplemented in csl::MIDIPlayer, and csl::MIDIIn.
|
virtualinherited |
stop MIDI stream
clear MIDI stream
Definition at line 102 of file MIDIIOJ.cpp.
References csl::kNone, csl::MIDIIO::mBuffer, csl::CMIDIMessage::message, and csl::MIDIIO::mMsg.
Referenced by csl::MIDIIO::close(), and CSLMIDIComponent::update().
|
inherited |
Definition at line 179 of file MIDIIOJ.cpp.
|
protectedinherited |
error handler
Definition at line 194 of file MIDIIOJ.cpp.
References csl::kLogError, csl::logMsg(), and csl::CException::what().
|
protectedinherited |
copy csl::CMIDIMessage <–> juce::MidiMessage
Definition at line 109 of file MIDIIOJ.cpp.
References csl::CMIDIMessage::channel, csl::CMIDIMessage::command, csl::CMIDIMessage::data1, csl::CMIDIMessage::data2, csl::CMIDIMessage::message, and csl::CMIDIMessage::time.
Referenced by csl::MIDIIn::handleIncomingMidiMessage(), csl::MIDIIn::nextEvent(), csl::MIDIPlayer::start(), and write().
|
protectedinherited |
Definition at line 118 of file MIDIIOJ.cpp.
References csl::CMIDIMessage::channel, csl::CMIDIMessage::command, csl::CMIDIMessage::data1, csl::CMIDIMessage::data2, and csl::CMIDIMessage::time.
|
protectedinherited |
Definition at line 127 of file MIDIIOJ.cpp.
References CCOPY_MSG, csl::CMIDIMessage::channel, csl::CMIDIMessage::command, csl::CMIDIMessage::data1, csl::CMIDIMessage::data2, csl::kAftertouch, csl::kControlChange, csl::kLogError, csl::kNoteOff, csl::kNoteOn, csl::kPitchWheel, csl::kPolyTouch, csl::kProgramChange, csl::kSysEX, csl::logMsg(), csl::CMIDIMessage::message, csl::MIDIIO::mMsg, and csl::CMIDIMessage::time.
|
inherited |
can't open the abstract class
true if MIDI stream is opened.
Definition at line 102 of file MIDIIOP.cpp.
References csl::MIDIIO::mIsOpen.
|
inherited |
printing device info for all devices.
Definition at line 113 of file MIDIIOP.cpp.
|
inherited |
printing total number of devices available
thin wrapper for PortMidi functions. made available for flexibility.
Definition at line 132 of file MIDIIOP.cpp.
|
inherited |
Definition at line 138 of file MIDIIOP.cpp.
|
inherited |
Definition at line 142 of file MIDIIOP.cpp.
|
inherited |
Definition at line 146 of file MIDIIOP.cpp.
|
inherited |
Definition at line 150 of file MIDIIOP.cpp.
Referenced by csl::MIDIIn::open(), and open().
|
protectedinherited |
Definition at line 156 of file MIDIIOP.cpp.
References csl::kLogError, and csl::logMsg().
Referenced by csl::MIDIIn::filter_active_sensing(), csl::MIDIIn::filter_clock_msg(), csl::MIDIIn::filter_sysex(), csl::MIDIIn::open(), open(), csl::MIDIIn::read(), csl::MIDIIn::setFilter(), write(), write_Aftertouch(), write_ControlChange(), write_NoteOff(), write_NoteOn(), write_PitchWheel(), write_PolyTouch(), write_ProgramChange(), write_short(), and write_SysEX().
|
inherited |
(possibly notify obersvers on my death)
register/remove observers
Definition at line 502 of file CGestalt.cpp.
References csl::logMsg(), csl::Observer::mKey, and csl::Observer::mPeriod.
Referenced by CSLMIDIComponent::CSLMIDIComponent(), and csl::SpatialPanner::setSpeakerLayout().
|
inherited |
Definition at line 518 of file CGestalt.cpp.
References csl::logMsg().
Referenced by csl::SpatialPanner::setSpeakerLayout(), and csl::SpatialPanner::~SpatialPanner().
|
inherited |
this is what I send to myself to notify my observers; It's not overridden in general. It results in the observers receiving update() calls < override evaluate to filter updates to the observer map
Definition at line 540 of file CGestalt.cpp.
References csl::logMsg().
Referenced by csl::SpeakerLayout::addSpeaker(), csl::MIDIIn::handleIncomingMidiMessage(), and csl::SpeakerLayout::setDefaultSpeakerLayout().
|
inlinevirtualinherited |
Reimplemented in csl::MIDIIn.
Definition at line 270 of file CGestalt.h.
| juce::MidiOutput* csl::MIDIOut::mOut |
|
protected |
Definition at line 177 of file MIDIIOJ.h.
Referenced by buffer_size(), MIDIOut(), open(), and set_buffer_size().
|
protected |
|
protected |
Definition at line 227 of file MIDIIOP.h.
Referenced by set_message(), and write().
|
inherited |
device ID which will/is opened.
Definition at line 103 of file MIDIIOJ.h.
Referenced by csl::MIDIIn::MIDIIn(), MIDIOut(), csl::MIDIIn::open(), and open().
|
protectedinherited |
|
inherited |
Definition at line 105 of file MIDIIOJ.h.
Referenced by csl::MIDIIn::handleIncomingMidiMessage().
|
inherited |
|
staticprotectedinherited |
< static flags to keep track of driver state
Definition at line 109 of file MIDIIOJ.h.
Referenced by csl::MIDIIO::MIDIIO(), and csl::MIDIIO::~MIDIIO().
|
protectedinherited |
JUCE-format message.
Definition at line 111 of file MIDIIOJ.h.
Referenced by csl::MIDIIn::nextEvent(), and write().
|
protectedinherited |
instance status indicators
Definition at line 113 of file MIDIIOJ.h.
Referenced by csl::MIDIIO::close(), csl::MIDIIO::is_open(), csl::MIDIIO::isOpen(), csl::MIDIIO::MIDIIO(), and csl::MIDIIn::open().
|
protectedinherited |
opened stream
Definition at line 113 of file MIDIIOP.h.
Referenced by csl::MIDIIn::filter_active_sensing(), csl::MIDIIn::filter_clock_msg(), csl::MIDIIn::filter_sysex(), csl::MIDIIn::open(), open(), csl::MIDIIn::read(), csl::MIDIIn::setFilter(), write(), write_Aftertouch(), write_ControlChange(), write_NoteOff(), write_NoteOn(), write_PitchWheel(), write_PolyTouch(), write_ProgramChange(), write_short(), and write_SysEX().
|
staticprotectedinherited |
|
staticprotectedinherited |
status indicators
Definition at line 119 of file MIDIIOP.h.
Referenced by csl::MIDIIn::open(), and open().