CSL  6.0
csl::MIDIIO Class Referenceabstract

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:

Public Member Functions

 MIDIIO ()
 < It's a model & sends itself "changed" More...
 
virtual ~MIDIIO ()
 
void open ()
 open the abstract More...
 
virtual void open (int devID)=0
 open a device More...
 
bool isOpen ()
 true if MIDI stream is opened. More...
 
virtual 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 ()
 
 MIDIIO ()
 
virtual ~MIDIIO ()
 
virtual void open ()
 
bool is_open ()
 can't open the abstract class More...
 
void close ()
 closing MIDI stream 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

int mDeviceID
 device ID which will/is opened. More...
 
CMIDIMessage mMsg
 current message (its flags determine the port state) 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

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

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 len, and csl::logMsg().

void MIDIIO::open ( )

open the abstract

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.

Referenced by CSLMIDIComponent::~CSLMIDIComponent().

virtual void csl::MIDIIO::start ( )
inlinevirtual

Reimplemented in csl::MIDIIn.

Definition at line 98 of file MIDIIOJ.h.

virtual void csl::MIDIIO::stop ( )
inlinevirtual

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(), and CSLMIDIComponent::update().

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,
juce::MidiMessage *  dest 
)
protected
virtual void csl::MIDIIO::open ( )
inlinevirtual

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

void Model::detachObserver ( Observer o)
inherited
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 540 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)
inlinevirtualinherited

Reimplemented in csl::MIDIIn.

Definition at line 270 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)

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().

juce::MidiBuffer csl::MIDIIO::mBuffer

I/O buffer.

Definition at line 106 of file MIDIIOJ.h.

Referenced by clear().

static bool csl::MIDIIO::mIsInitialized = false
staticprotected

< static flags to keep track of driver state

Definition at line 109 of file MIDIIOJ.h.

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

juce::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

Definition at line 114 of file MIDIIOJ.h.

long csl::MIDIIO::mFilterFlag
protected

Definition at line 115 of file MIDIIOJ.h.

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
staticprotected

Definition at line 118 of file MIDIIOP.h.

bool MIDIIO::mIsPortTimeStarted = false
staticprotected

status indicators

Definition at line 119 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: