|
CSL
5.2
|
MIDIIn class is-a MidiInputCallback too, and an "input-ready" flag. More...
#include <MIDIIOJ.h>
Inheritance diagram for csl::MIDIIn:Public Member Functions | |
| MIDIIn () | |
| unsigned | bufferSize () |
| void | setBufferSize (unsigned bufferSize) |
| virtual void | open (int deviceID) |
| open a device | |
| bool | poll () |
| poll returns a bool (really quickly) | |
| void | nextEvent () |
| step to next event or reset flag | |
| void | dumpMessage () |
| print current msg | |
| virtual void | start () |
| start MIDI stream | |
| virtual void | stop () |
| stop MIDI stream | |
| int | evaluate (void *arg) |
| evaluate answers the message command | |
| void | handleIncomingMidiMessage (MidiInput *source, const MidiMessage &message) |
| implement inherited MidiInputCallback | |
| MIDIIn () | |
| unsigned | buffer_size () |
| void | set_buffer_size (unsigned bufferSize) |
| void | open () |
| method for opening the default stream. | |
| void | open (int deviceID) |
| open a device | |
| bool | poll () |
| void | read () |
| generic read method. gets MIDI message and store it in mBuffer | |
| void | read_interpret () |
| read method and sets internal flag for which message was received | |
| PmEvent | buffer () |
| void | dump_buffer () |
| CSL_MIDIMessage | message () |
| void | dump_CSL_MIDIMessage () |
| bool | is_NoteOn_received () |
| bool | is_NoteOff_received () |
| bool | is_PolyTouch_received () |
| bool | is_ControlChange_received () |
| bool | is_ProgramChange_received () |
| bool | is_Aftertouch_received () |
| bool | is_PitchWheel_received () |
| bool | is_SysEX_received () |
| unsigned | get_note () |
| unsigned | get_velocity () |
| unsigned | get_PolyAftertouch () |
| unsigned | get_ControlChange_function () |
| unsigned | get_ControlChange_value () |
| unsigned | get_ProgramNumber () |
| unsigned | get_Aftertouch () |
| unsigned | get_PitchWheel () |
| float | get_frequency () |
| float | get_velocity_float () |
| has range of [0.0 1.0] mapped to [0 127] | |
| void | setFilter () |
| void | filter_active_sensing (bool flag) |
| void | filter_sysex (bool flag) |
| void | filter_clock_msg (bool flag) |
| bool | isOpen () |
| true if MIDI stream is opened. | |
| virtual void | close () |
| closing MIDI stream | |
| void | close () |
| closing MIDI stream | |
| virtual void | clear () |
| stop MIDI stream | |
| void | dumpBuffer () |
| bool | is_open () |
| can't open the abstract class | |
| void | dump_device_info () |
| printing device info for all devices. | |
| void | dump_count_devices () |
| printing total number of devices available | |
| 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) | |
| 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 | |
Static Public Member Functions | |
| static int | countDevices () |
| static void | dumpDevices () |
| printing device info for all devices. | |
Public Attributes | |
| MidiInput * | mDevice |
| my device ptr | |
| double | mStartTime |
| the time I was started | |
| int | mDeviceID |
| device ID which will/is opened. | |
| CMIDIMessage | mMsg2 |
Protected Member Functions | |
| void | handleError (CException *err) |
| error handler | |
| void | copyMessage (CMIDIMessage &source, CMIDIMessage &dest) |
| copy csl::CMIDIMessage <–> juce::MidiMessage | |
| void | copyMessage (CMIDIMessage &source, MidiMessage *dest) |
| void | copyMessage (const MidiMessage &source, CMIDIMessage &dest) |
| void | handle_error (PmError err) |
Protected Attributes | |
| long | mBufferSize |
| fundamental members | |
| long | mFilterFlag |
| CSL_MIDIMessage | mMsg |
| current message (its flags determine the port state) | |
| PmEvent | mBuffer [1] |
| buffer which gets filled by read() | |
| PmError | mLength |
| length | |
| PmDeviceID | mDeviceID |
| device ID which will/is opened. | |
| MidiMessage * | mJMsg |
| JUCE-format message. | |
| bool | mIsOpen |
| instance status indicators | |
| PmStream * | mMIDIStream |
| opened stream | |
| bool | mIsInput |
| bool | mIsOutput |
Static Protected Attributes | |
| static bool | mIsInitialized = false |
| < static flags to keep track of driver state | |
| static unsigned | mNumInstantiated = 0 |
| static bool | mIsPortTimeStarted = false |
| status indicators | |
| MIDIIn::MIDIIn | ( | ) |
Definition at line 202 of file MIDIIOJ.cpp.
References mBufferSize, mDevice, csl::MIDIIO::mDeviceID, and mFilterFlag.
| csl::MIDIIn::MIDIIn | ( | ) |
| unsigned MIDIIn::bufferSize | ( | ) |
Definition at line 209 of file MIDIIOJ.cpp.
References mBufferSize.
Referenced by set_buffer_size(), and setBufferSize().
| void MIDIIn::setBufferSize | ( | unsigned | bufferSize | ) |
Definition at line 213 of file MIDIIOJ.cpp.
References bufferSize(), and mBufferSize.
|
virtual |
open a device
start MIDI stream
Implements csl::MIDIIO.
Definition at line 218 of file MIDIIOJ.cpp.
References gAudioDeviceManager, csl::kLogError, csl::logMsg(), mDevice, csl::MIDIIO::mDeviceID, and csl::MIDIIO::mIsOpen.
| bool MIDIIn::poll | ( | ) |
poll returns a bool (really quickly)
Definition at line 263 of file MIDIIOJ.cpp.
References csl::kNone, csl::CSL_MIDIMessage::message, and mMsg.
| void MIDIIn::nextEvent | ( | ) |
step to next event or reset flag
Definition at line 269 of file MIDIIOJ.cpp.
References csl::MIDIIO::copyMessage(), csl::kNone, mBuffer, csl::CSL_MIDIMessage::message, csl::MIDIIO::mJMsg, and mMsg.
| void MIDIIn::dumpMessage | ( | ) |
print current msg
Definition at line 281 of file MIDIIOJ.cpp.
References csl::CSL_MIDIMessage::channel, csl::CSL_MIDIMessage::data1, csl::CSL_MIDIMessage::data2, csl::kAftertouch, csl::kControlChange, csl::kNone, csl::kNoteOff, csl::kNoteOn, csl::kPitchWheel, csl::kPolyTouch, csl::kProgramChange, csl::kSysEX, csl::CSL_MIDIMessage::message, mMsg, and csl::CSL_MIDIMessage::time.
|
virtual |
start MIDI stream
stop MIDI stream
Reimplemented from csl::MIDIIO.
Definition at line 233 of file MIDIIOJ.cpp.
References mDevice, and mStartTime.
|
virtual |
stop MIDI stream
Reimplemented from csl::MIDIIO.
Definition at line 241 of file MIDIIOJ.cpp.
References mDevice.
|
virtual |
evaluate answers the message command
Reimplemented from csl::Model.
Definition at line 319 of file MIDIIOJ.cpp.
References csl::CMIDIMessage::message.
| void MIDIIn::handleIncomingMidiMessage | ( | MidiInput * | source, |
| const MidiMessage & | message | ||
| ) |
implement inherited MidiInputCallback
Definition at line 248 of file MIDIIOJ.cpp.
References csl::Model::changed(), csl::MIDIIO::copyMessage(), csl::kNone, mBuffer, csl::CSL_MIDIMessage::message, mMsg, csl::MIDIIO::mMsg2, mStartTime, csl::CSL_MIDIMessage::time, csl::CMIDIMessage::time, and csl::timeNow().
| unsigned MIDIIn::buffer_size | ( | ) |
Definition at line 174 of file MIDIIOP.cpp.
References mBufferSize.
| void MIDIIn::set_buffer_size | ( | unsigned | bufferSize | ) |
Definition at line 178 of file MIDIIOP.cpp.
References bufferSize(), and mBufferSize.
| void MIDIIn::open | ( | ) |
method for opening the default stream.
Reimplemented from csl::MIDIIO.
Definition at line 182 of file MIDIIOP.cpp.
References DRIVER_INFO, csl::MIDIIO::get_device_info(), csl::MIDIIO::handle_error(), mBufferSize, csl::MIDIIO::mDeviceID, mFilterFlag, csl::MIDIIO::mIsPortTimeStarted, csl::MIDIIO::mMIDIStream, TIME_INFO, TIME_PROC, and TIME_START.
|
virtual |
open a device
Implements csl::MIDIIO.
| bool csl::MIDIIn::poll | ( | ) |
| void MIDIIn::read | ( | ) |
generic read method. gets MIDI message and store it in mBuffer
Definition at line 221 of file MIDIIOP.cpp.
References csl::MIDIIO::handle_error(), csl::logMsg(), mBuffer, mLength, and csl::MIDIIO::mMIDIStream.
Referenced by read_interpret().
| void MIDIIn::read_interpret | ( | ) |
read method and sets internal flag for which message was received
Definition at line 244 of file MIDIIOP.cpp.
References csl::CSL_MIDIMessage::channel, csl::CSL_MIDIMessage::data1, csl::CSL_MIDIMessage::data2, csl::kAftertouch, csl::kControlChange, csl::kNoteOff, csl::kNoteOn, csl::kPitchWheel, csl::kPolyTouch, csl::kProgramChange, csl::kSysEX, mBuffer, csl::CSL_MIDIMessage::message, mMsg, and read().
|
inline |
| void MIDIIn::dump_buffer | ( | ) |
Definition at line 313 of file MIDIIOP.cpp.
References mBuffer.
|
inline |
| void MIDIIn::dump_CSL_MIDIMessage | ( | ) |
Definition at line 324 of file MIDIIOP.cpp.
References csl::CSL_MIDIMessage::channel, csl::CSL_MIDIMessage::data1, csl::CSL_MIDIMessage::data2, csl::kAftertouch, csl::kControlChange, csl::kNone, csl::kNoteOff, csl::kNoteOn, csl::kPitchWheel, csl::kPolyTouch, csl::kProgramChange, csl::kSysEX, csl::CSL_MIDIMessage::message, mMsg, and csl::CSL_MIDIMessage::time.
| bool MIDIIn::is_NoteOn_received | ( | ) |
Definition at line 361 of file MIDIIOP.cpp.
References csl::kNoteOn, csl::CSL_MIDIMessage::message, and mMsg.
| bool MIDIIn::is_NoteOff_received | ( | ) |
Definition at line 365 of file MIDIIOP.cpp.
References csl::kNoteOff, csl::CSL_MIDIMessage::message, and mMsg.
| bool MIDIIn::is_PolyTouch_received | ( | ) |
Definition at line 369 of file MIDIIOP.cpp.
References csl::kPolyTouch, csl::CSL_MIDIMessage::message, and mMsg.
| bool MIDIIn::is_ControlChange_received | ( | ) |
Definition at line 373 of file MIDIIOP.cpp.
References csl::kControlChange, csl::CSL_MIDIMessage::message, and mMsg.
| bool MIDIIn::is_ProgramChange_received | ( | ) |
Definition at line 377 of file MIDIIOP.cpp.
References csl::kProgramChange, csl::CSL_MIDIMessage::message, and mMsg.
| bool MIDIIn::is_Aftertouch_received | ( | ) |
Definition at line 381 of file MIDIIOP.cpp.
References csl::kAftertouch, csl::CSL_MIDIMessage::message, and mMsg.
| bool MIDIIn::is_PitchWheel_received | ( | ) |
Definition at line 385 of file MIDIIOP.cpp.
References csl::kPitchWheel, csl::CSL_MIDIMessage::message, and mMsg.
| bool MIDIIn::is_SysEX_received | ( | ) |
Definition at line 389 of file MIDIIOP.cpp.
References csl::kSysEX, csl::CSL_MIDIMessage::message, and mMsg.
| unsigned MIDIIn::get_note | ( | ) |
Definition at line 393 of file MIDIIOP.cpp.
References csl::CSL_MIDIMessage::data1, and mMsg.
| unsigned MIDIIn::get_velocity | ( | ) |
Definition at line 394 of file MIDIIOP.cpp.
References csl::CSL_MIDIMessage::data2, and mMsg.
| unsigned MIDIIn::get_PolyAftertouch | ( | ) |
Definition at line 395 of file MIDIIOP.cpp.
References csl::CSL_MIDIMessage::data2, and mMsg.
| unsigned MIDIIn::get_ControlChange_function | ( | ) |
Definition at line 396 of file MIDIIOP.cpp.
References csl::CSL_MIDIMessage::data1, and mMsg.
| unsigned MIDIIn::get_ControlChange_value | ( | ) |
Definition at line 397 of file MIDIIOP.cpp.
References csl::CSL_MIDIMessage::data2, and mMsg.
| unsigned MIDIIn::get_ProgramNumber | ( | ) |
Definition at line 398 of file MIDIIOP.cpp.
References csl::CSL_MIDIMessage::data1, and mMsg.
| unsigned MIDIIn::get_Aftertouch | ( | ) |
Definition at line 399 of file MIDIIOP.cpp.
References csl::CSL_MIDIMessage::data1, and mMsg.
| unsigned MIDIIn::get_PitchWheel | ( | ) |
Definition at line 400 of file MIDIIOP.cpp.
References csl::CSL_MIDIMessage::data1, csl::CSL_MIDIMessage::data2, and mMsg.
| float MIDIIn::get_frequency | ( | ) |
Definition at line 401 of file MIDIIOP.cpp.
References csl::CSL_MIDIMessage::data1, csl::keyToFreq(), and mMsg.
| float MIDIIn::get_velocity_float | ( | ) |
has range of [0.0 1.0] mapped to [0 127]
Definition at line 402 of file MIDIIOP.cpp.
References csl::CSL_MIDIMessage::data2, and mMsg.
| void MIDIIn::setFilter | ( | ) |
Definition at line 404 of file MIDIIOP.cpp.
References csl::MIDIIO::handle_error(), and csl::MIDIIO::mMIDIStream.
| void MIDIIn::filter_active_sensing | ( | bool | flag | ) |
Definition at line 411 of file MIDIIOP.cpp.
References csl::MIDIIO::handle_error(), csl::logMsg(), mFilterFlag, and csl::MIDIIO::mMIDIStream.
| void MIDIIn::filter_sysex | ( | bool | flag | ) |
Definition at line 436 of file MIDIIOP.cpp.
References csl::MIDIIO::handle_error(), csl::logMsg(), mFilterFlag, and csl::MIDIIO::mMIDIStream.
| void MIDIIn::filter_clock_msg | ( | bool | flag | ) |
Definition at line 461 of file MIDIIOP.cpp.
References csl::MIDIIO::handle_error(), csl::logMsg(), mFilterFlag, and csl::MIDIIO::mMIDIStream.
|
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 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.
|
inherited |
closing MIDI stream
|
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().
|
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 handleIncomingMidiMessage(), nextEvent(), csl::MIDIPlayer::start(), and csl::MIDIOut::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, data, 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 open(), and csl::MIDIOut::open().
|
protectedinherited |
Definition at line 156 of file MIDIIOP.cpp.
References csl::kLogError, and csl::logMsg().
Referenced by filter_active_sensing(), filter_clock_msg(), filter_sysex(), open(), csl::MIDIOut::open(), read(), setFilter(), csl::MIDIOut::write(), csl::MIDIOut::write_Aftertouch(), csl::MIDIOut::write_ControlChange(), csl::MIDIOut::write_NoteOff(), csl::MIDIOut::write_NoteOn(), csl::MIDIOut::write_PitchWheel(), csl::MIDIOut::write_PolyTouch(), csl::MIDIOut::write_ProgramChange(), csl::MIDIOut::write_short(), and csl::MIDIOut::write_SysEX().
|
inherited |
(possibly notify obersvers on my death)
register/remove observers
Definition at line 491 of file CGestalt.cpp.
References csl::logMsg(), csl::Observer::mKey, and csl::Observer::mPeriod.
Referenced by csl::SpatialPanner::setSpeakerLayout().
|
inherited |
Definition at line 507 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 529 of file CGestalt.cpp.
References csl::logMsg().
Referenced by csl::SpeakerLayout::addSpeaker(), handleIncomingMidiMessage(), and csl::SpeakerLayout::setDefaultSpeakerLayout().
| MidiInput* csl::MIDIIn::mDevice |
| double csl::MIDIIn::mStartTime |
the time I was started
Definition at line 148 of file MIDIIOJ.h.
Referenced by handleIncomingMidiMessage(), and start().
|
protected |
fundamental members
Reimplemented from csl::MIDIIO.
Definition at line 179 of file MIDIIOP.h.
Referenced by buffer_size(), bufferSize(), MIDIIn(), open(), set_buffer_size(), and setBufferSize().
|
protected |
Reimplemented from csl::MIDIIO.
Definition at line 180 of file MIDIIOP.h.
Referenced by filter_active_sensing(), filter_clock_msg(), filter_sysex(), MIDIIn(), and open().
|
protected |
current message (its flags determine the port state)
Reimplemented from csl::MIDIIO.
Definition at line 182 of file MIDIIOP.h.
Referenced by dump_CSL_MIDIMessage(), dumpMessage(), get_Aftertouch(), get_ControlChange_function(), get_ControlChange_value(), get_frequency(), get_note(), get_PitchWheel(), get_PolyAftertouch(), get_ProgramNumber(), get_velocity(), get_velocity_float(), handleIncomingMidiMessage(), is_Aftertouch_received(), is_ControlChange_received(), is_NoteOff_received(), is_NoteOn_received(), is_PitchWheel_received(), is_PolyTouch_received(), is_ProgramChange_received(), is_SysEX_received(), message(), nextEvent(), poll(), and read_interpret().
|
protected |
buffer which gets filled by read()
Reimplemented from csl::MIDIIO.
Definition at line 184 of file MIDIIOP.h.
Referenced by buffer(), dump_buffer(), handleIncomingMidiMessage(), nextEvent(), read(), and read_interpret().
|
protected |
|
inherited |
device ID which will/is opened.
Definition at line 103 of file MIDIIOJ.h.
Referenced by MIDIIn(), csl::MIDIOut::MIDIOut(), open(), and csl::MIDIOut::open().
|
protectedinherited |
|
inherited |
Definition at line 105 of file MIDIIOJ.h.
Referenced by handleIncomingMidiMessage().
|
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 nextEvent(), and csl::MIDIOut::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 open().
|
protectedinherited |
opened stream
Definition at line 113 of file MIDIIOP.h.
Referenced by filter_active_sensing(), filter_clock_msg(), filter_sysex(), open(), csl::MIDIOut::open(), read(), setFilter(), csl::MIDIOut::write(), csl::MIDIOut::write_Aftertouch(), csl::MIDIOut::write_ControlChange(), csl::MIDIOut::write_NoteOff(), csl::MIDIOut::write_NoteOn(), csl::MIDIOut::write_PitchWheel(), csl::MIDIOut::write_PolyTouch(), csl::MIDIOut::write_ProgramChange(), csl::MIDIOut::write_short(), and csl::MIDIOut::write_SysEX().
|
staticprotectedinherited |
|
staticprotectedinherited |
status indicators
Definition at line 121 of file MIDIIOP.h.
Referenced by open(), and csl::MIDIOut::open().