CSL  6.0
csl::MIDIOut Class Reference

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

Detailed Description

MIDIOut class write msgs out to a device (or file)

MIDIOut class.

Definition at line 156 of file MIDIIOJ.h.

Constructor & Destructor Documentation

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

Member Function Documentation

void MIDIOut::open ( int  devID)
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 ( )

Definition at line 504 of file MIDIIOP.cpp.

References mLatency.

Referenced by set_latency().

void MIDIOut::set_latency ( long  latency)

Definition at line 505 of file MIDIIOP.cpp.

References latency(), and mLatency.

void csl::MIDIOut::open ( int  devID)
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 ( )
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_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 
)
void MIDIOut::write_NoteOff ( unsigned  channel,
unsigned  pitch,
unsigned  velocity 
)
void MIDIOut::write_NoteOff ( unsigned  channel,
float  frequency,
float  amplitude 
)
void MIDIOut::write_PolyTouch ( unsigned  channel,
unsigned  pitch,
unsigned  amount 
)
void MIDIOut::write_ControlChange ( unsigned  channel,
unsigned  function,
unsigned  value 
)
void MIDIOut::write_ProgramChange ( unsigned  channel,
unsigned  programNum 
)
void MIDIOut::write_Aftertouch ( unsigned  channel,
unsigned  amount 
)
void MIDIOut::write_PitchWheel ( unsigned  channel,
unsigned  amount 
)
int MIDIIO::countDevices ( )
staticinherited

Definition at line 51 of file MIDIIOJ.cpp.

void MIDIIO::dumpDevices ( )
staticinherited

printing device info for all devices.

Definition at line 58 of file MIDIIOJ.cpp.

References len, and csl::logMsg().

bool MIDIIO::isOpen ( )
inherited

true if MIDI stream is opened.

Definition at line 91 of file MIDIIOJ.cpp.

References csl::MIDIIO::mIsOpen.

void MIDIIO::close ( )
virtualinherited

closing MIDI stream

Definition at line 95 of file MIDIIOJ.cpp.

References csl::MIDIIO::clear(), and csl::MIDIIO::mIsOpen.

Referenced by CSLMIDIComponent::~CSLMIDIComponent().

void csl::MIDIIO::close ( )
inherited

closing MIDI stream

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

Reimplemented in csl::MIDIIn.

Definition at line 98 of file MIDIIOJ.h.

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

start MIDI stream

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

Definition at line 99 of file MIDIIOJ.h.

void MIDIIO::clear ( )
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().

void MIDIIO::dumpBuffer ( )
inherited

Definition at line 179 of file MIDIIOJ.cpp.

void MIDIIO::handleError ( CException err)
protectedinherited

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 
)
protectedinherited
bool MIDIIO::is_open ( )
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.

void MIDIIO::dump_device_info ( )
inherited

printing device info for all devices.

Definition at line 113 of file MIDIIOP.cpp.

void MIDIIO::dump_count_devices ( )
inherited

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

Definition at line 138 of file MIDIIOP.cpp.

int MIDIIO::get_default_input_id ( )
inherited

Definition at line 142 of file MIDIIOP.cpp.

int MIDIIO::get_default_output_id ( )
inherited

Definition at line 146 of file MIDIIOP.cpp.

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

Definition at line 150 of file MIDIIOP.cpp.

Referenced by csl::MIDIIn::open(), and 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

juce::MidiOutput* csl::MIDIOut::mOut

the juce midi output is public

Definition at line 161 of file MIDIIOJ.h.

Referenced by MIDIOut(), open(), and write().

long csl::MIDIOut::mBufferSize
protected

Definition at line 177 of file MIDIIOJ.h.

Referenced by buffer_size(), MIDIOut(), open(), and set_buffer_size().

long csl::MIDIOut::mLatency
protected

Definition at line 178 of file MIDIIOJ.h.

Referenced by latency(), MIDIOut(), open(), and set_latency().

CSL_MIDIMessage csl::MIDIOut::mMsg
protected

Definition at line 227 of file MIDIIOP.h.

Referenced by set_message(), and write().

int csl::MIDIIO::mDeviceID
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().

PmDeviceID csl::MIDIIO::mDeviceID
protectedinherited

device ID which will/is opened.

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

Definition at line 114 of file MIDIIOP.h.

CMIDIMessage csl::MIDIIO::mMsg2
inherited

Definition at line 105 of file MIDIIOJ.h.

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

juce::MidiBuffer csl::MIDIIO::mBuffer
inherited

I/O buffer.

Definition at line 106 of file MIDIIOJ.h.

Referenced by csl::MIDIIO::clear().

static bool csl::MIDIIO::mIsInitialized = false
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().

juce::MidiMessage* csl::MIDIIO::mJMsg
protectedinherited

JUCE-format message.

Definition at line 111 of file MIDIIOJ.h.

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

bool csl::MIDIIO::mIsOpen
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().

long csl::MIDIIO::mFilterFlag
protectedinherited

Definition at line 115 of file MIDIIOJ.h.

unsigned MIDIIO::mNumInstantiated = 0
staticprotectedinherited

Definition at line 118 of file MIDIIOP.h.

bool MIDIIO::mIsPortTimeStarted = false
staticprotectedinherited

status indicators

Definition at line 119 of file MIDIIOP.h.

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

bool csl::MIDIIO::mIsInput
protectedinherited

Definition at line 122 of file MIDIIOP.h.

bool csl::MIDIIO::mIsOutput
protectedinherited

Definition at line 123 of file MIDIIOP.h.


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