CSL 5.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes
csl::MIDIIO Class Reference

MIDIIO class: superclass of in and out; has a message buffer and current messages It's a model so you can observe it. Uses mMsg.CMIDIMessageType as a status flag. More...

`#include <MIDIIOJ.h>`

Inheritance diagram for csl::MIDIIO:

List of all members.

## Public Member Functions
| MIDIIO ()
| < It's a model & sends itself "changed"
virtual | ~MIDIIO ()
void | open ()
| open the abstract
virtual void | open (int devID)=0
| open a device
bool | isOpen ()
| true if MIDI stream is opened.
virtual void | close ()
| closing MIDI stream
virtual void | start ()
virtual void | stop ()
| start MIDI stream
virtual void | clear ()
| stop MIDI stream
void | dumpBuffer ()
| MIDIIO ()
virtual | ~MIDIIO ()
virtual void | open ()
bool | is_open ()
| can't open the abstract class
void | close ()
| closing MIDI stream
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
virtual int | evaluate (void *argument)

## Static Public Member Functions
static int | countDevices ()
static void | dumpDevices ()
| printing device info for all devices.

## Public Attributes
int | mDeviceID
| device ID which will/is opened.
CMIDIMessage | mMsg
| current message (its flags determine the port state)
CMIDIMessage | mMsg2
MidiBuffer | mBuffer
| I/O buffer.

## 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
MidiMessage * | mJMsg
| JUCE-format message.
bool | mIsOpen
| instance status indicators
long | mBufferSize
long | mFilterFlag
PmStream * | mMIDIStream
| opened stream
PmDeviceID | mDeviceID
| device ID which will/is opened.
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

## Detailed Description

MIDIIO class: superclass of in and out; has a message buffer and current messages It's a model so you can observe it. Uses mMsg.CMIDIMessageType as a status flag.

MIDIIO class.

Definition at line 86 of file MIDIIOJ.h.

## Constructor & Destructor Documentation

MIDIIO::MIDIIO | ( |  | ) |

< It's a model & sends itself "changed"

Definition at line 75 of file MIDIIOJ.cpp.

References csl::kNone, csl::CMIDIMessage::message, mIsInitialized, mIsOpen, and mMsg.

MIDIIO::~MIDIIO | ( |  | ) |
| virtual

Definition at line 83 of file MIDIIOJ.cpp.

References mIsInitialized.

csl::MIDIIO::MIDIIO | ( |  | ) |

virtual csl::MIDIIO::~MIDIIO | ( |  | ) |
| virtual

## Member Function Documentation

int MIDIIO::countDevices | ( |  | ) |
| static

Definition at line 51 of file MIDIIOJ.cpp.

void MIDIIO::dumpDevices | ( |  | ) |
| static

printing device info for all devices.

Definition at line 58 of file MIDIIOJ.cpp.

References csl::logMsg().

void MIDIIO::open | ( |  | ) |

open the abstract

Reimplemented in csl::MIDIOut, and csl::MIDIIn.

Definition at line 87 of file MIDIIOJ.cpp.

virtual void csl::MIDIIO::open | ( | int | devID | ) |
| pure virtual

open a device

Implemented in csl::MIDIOut, csl::MIDIPlayer, csl::MIDIOut, csl::MIDIIn, and csl::MIDIIn.

bool MIDIIO::isOpen | ( |  | ) |

true if MIDI stream is opened.

Definition at line 91 of file MIDIIOJ.cpp.

References mIsOpen.

void MIDIIO::close | ( |  | ) |
| virtual

closing MIDI stream

Definition at line 95 of file MIDIIOJ.cpp.

References clear(), and mIsOpen.

virtual void csl::MIDIIO::start | ( | void |  | ) |
| inline virtual

Reimplemented in csl::MIDIIn.

Definition at line 98 of file MIDIIOJ.h.

virtual void csl::MIDIIO::stop | ( | void |  | ) |
| inline virtual

start MIDI stream

Reimplemented in csl::MIDIPlayer, and csl::MIDIIn.

Definition at line 99 of file MIDIIOJ.h.

void MIDIIO::clear | ( |  | ) |
| virtual

stop MIDI stream

clear MIDI stream

Definition at line 102 of file MIDIIOJ.cpp.

References csl::kNone, mBuffer, csl::CMIDIMessage::message, and mMsg.

Referenced by close().

void MIDIIO::dumpBuffer | ( |  | ) |

Definition at line 179 of file MIDIIOJ.cpp.

void MIDIIO::handleError | ( | CException * | err | ) |
| protected

error handler

Definition at line 194 of file MIDIIOJ.cpp.

References csl::kLogError, csl::logMsg(), and csl::CException::what().

void MIDIIO::copyMessage | ( | CMIDIMessage & | source,
|  | CMIDIMessage & | dest
| ) |  |
| protected

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 csl::MIDIOut::write().

void MIDIIO::copyMessage | ( | CMIDIMessage & | source,
|  | MidiMessage * | dest
| ) |  |
| protected

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.

void MIDIIO::copyMessage | ( | const MidiMessage & | source,
|  | CMIDIMessage & | dest
| ) |  |
| protected

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, mMsg, and csl::CMIDIMessage::time.

virtual void csl::MIDIIO::open | ( |  | ) |
| inline virtual

Reimplemented in csl::MIDIOut, and csl::MIDIIn.

Definition at line 100 of file MIDIIOP.h.

bool MIDIIO::is_open | ( |  | ) |

can't open the abstract class

true if MIDI stream is opened.

Definition at line 102 of file MIDIIOP.cpp.

References mIsOpen.

void csl::MIDIIO::close | ( |  | ) |

closing MIDI stream

void MIDIIO::dump_device_info | ( |  | ) |

printing device info for all devices.

Definition at line 113 of file MIDIIOP.cpp.

void MIDIIO::dump_count_devices | ( |  | ) |

printing total number of devices available

thin wrapper for PortMidi functions. made available for flexibility.

Definition at line 132 of file MIDIIOP.cpp.

int MIDIIO::count_devices | ( |  | ) |

Definition at line 138 of file MIDIIOP.cpp.

int MIDIIO::get_default_input_id | ( |  | ) |

Definition at line 142 of file MIDIIOP.cpp.

int MIDIIO::get_default_output_id | ( |  | ) |

Definition at line 146 of file MIDIIOP.cpp.

const PmDeviceInfo * MIDIIO::get_device_info | ( | int | deviceID | ) |

Definition at line 150 of file MIDIIOP.cpp.

Referenced by csl::MIDIIn::open(), and csl::MIDIOut::open().

void MIDIIO::handle_error | ( | PmError | err | ) |
| protected

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(), csl::MIDIOut::open(), csl::MIDIIn::read(), csl::MIDIIn::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().

void Model::attachObserver | ( | Observer * | o | ) |
| 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().

void Model::detachObserver | ( | Observer * | o | ) |
| inherited

Definition at line 507 of file CGestalt.cpp.

References csl::logMsg().

Referenced by csl::SpatialPanner::setSpeakerLayout(), and csl::SpatialPanner::~SpatialPanner().

void Model::changed | ( | void * | argument | ) |
| 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(), csl::MIDIIn::handleIncomingMidiMessage(), and csl::SpeakerLayout::setDefaultSpeakerLayout().

virtual int csl::Model::evaluate | ( | void * | argument | ) |
| inline virtual inherited

Reimplemented in csl::MIDIIn.

Definition at line 259 of file CGestalt.h.

## Member Data Documentation

int csl::MIDIIO::mDeviceID

device ID which will/is opened.

Definition at line 103 of file MIDIIOJ.h.

Referenced by csl::MIDIIn::MIDIIn(), csl::MIDIOut::MIDIOut(), csl::MIDIIn::open(), and csl::MIDIOut::open().

CMIDIMessage csl::MIDIIO::mMsg

current message (its flags determine the port state)

Reimplemented in csl::MIDIOut, and csl::MIDIIn.

Definition at line 104 of file MIDIIOJ.h.

Referenced by clear(), copyMessage(), MIDIIO(), and csl::MIDIPlayer::start().

CMIDIMessage csl::MIDIIO::mMsg2

Definition at line 105 of file MIDIIOJ.h.

Referenced by csl::MIDIIn::handleIncomingMidiMessage().

MidiBuffer csl::MIDIIO::mBuffer

I/O buffer.

Reimplemented in csl::MIDIIn.

Definition at line 106 of file MIDIIOJ.h.

Referenced by clear().

static bool csl::MIDIIO::mIsInitialized = false
| static protected

< static flags to keep track of driver state

Definition at line 109 of file MIDIIOJ.h.

Referenced by MIDIIO(), and ~MIDIIO().

MidiMessage* csl::MIDIIO::mJMsg
| protected

JUCE-format message.

Definition at line 111 of file MIDIIOJ.h.

Referenced by csl::MIDIIn::nextEvent(), and csl::MIDIOut::write().

bool csl::MIDIIO::mIsOpen
| protected

instance status indicators

Definition at line 113 of file MIDIIOJ.h.

Referenced by close(), is_open(), isOpen(), MIDIIO(), and csl::MIDIIn::open().

long csl::MIDIIO::mBufferSize
| protected

Reimplemented in csl::MIDIIn, and csl::MIDIOut.

Definition at line 114 of file MIDIIOJ.h.

long csl::MIDIIO::mFilterFlag
| protected

Reimplemented in csl::MIDIIn.

Definition at line 115 of file MIDIIOJ.h.

PmStream* csl::MIDIIO::mMIDIStream
| protected

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(), csl::MIDIOut::open(), csl::MIDIIn::read(), csl::MIDIIn::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().

PmDeviceID csl::MIDIIO::mDeviceID
| protected

device ID which will/is opened.

static to keep track of Pm_Initialize() / Pm_Terminate()

Definition at line 114 of file MIDIIOP.h.

unsigned MIDIIO::mNumInstantiated = 0
| static protected

Definition at line 118 of file MIDIIOP.h.

bool MIDIIO::mIsPortTimeStarted = false
| static protected

status indicators

Definition at line 121 of file MIDIIOP.h.

Referenced by csl::MIDIIn::open(), and csl::MIDIOut::open().

bool csl::MIDIIO::mIsInput
| protected

Definition at line 122 of file MIDIIOP.h.

bool csl::MIDIIO::mIsOutput
| protected

Definition at line 123 of file MIDIIOP.h.

The documentation for this class was generated from the following files:

- CSL/IO/MIDIIOJ.h
- CSL/IO/MIDIIOP.h
- CSL/IO/MIDIIOJ.cpp
- CSL/IO/MIDIIOP.cpp