CSL  6.0
csl::MIDIPlayer Class Reference

MIDI stream/file player. More...

#include <MIDIIOJ.h>

+ Inheritance diagram for csl::MIDIPlayer:

Public Member Functions

 MIDIPlayer (string nam, InstrumentLibrary *lib)
 
 MIDIPlayer (string folder, string nam, InstrumentLibrary *lib)
 
 ~MIDIPlayer ()
 
void open (int devID)
 open a device More...
 
void start (int index)
 open a device (empty method) More...
 
void stop ()
 stop playing More...
 
void open ()
 open the abstract 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 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::MidiFile mFile
 JUCE MIDI file. More...
 
int mNumTrax
 num tracks More...
 
juce::MidiMessageSequence * mTrak
 track ptr More...
 
bool mIsOn
 Active flag. More...
 
InstrumentLibrarymLibrary
 instrument library More...
 
float mTempoScale
 tempo scale (secs/beat / ticks/beat) More...
 
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 init (juce::String namS)
 
juce::MidiMessageSequence * mergeTrax ()
 
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

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

MIDI stream/file player.

Definition at line 187 of file MIDIIOJ.h.

Constructor & Destructor Documentation

MIDIPlayer::MIDIPlayer ( string  nam,
InstrumentLibrary lib 
)

Definition at line 410 of file MIDIIOJ.cpp.

References init(), and mLibrary.

MIDIPlayer::MIDIPlayer ( string  folder,
string  nam,
InstrumentLibrary lib 
)

Definition at line 418 of file MIDIIOJ.cpp.

References init(), and mLibrary.

csl::MIDIPlayer::~MIDIPlayer ( )
inline

Definition at line 191 of file MIDIIOJ.h.

Member Function Documentation

void csl::MIDIPlayer::open ( int  devID)
inlinevirtual

open a device

Implements csl::MIDIIO.

Definition at line 193 of file MIDIIOJ.h.

void MIDIPlayer::stop ( )
virtual

stop playing

Reimplemented from csl::MIDIIO.

Definition at line 501 of file MIDIIOJ.cpp.

References mIsOn.

void MIDIPlayer::init ( juce::String  namS)
protected

Definition at line 383 of file MIDIIOJ.cpp.

References csl::logMsg(), mFile, mIsOn, mNumTrax, mTempoScale, and mTrak.

Referenced by MIDIPlayer().

juce::MidiMessageSequence * MIDIPlayer::mergeTrax ( )
protected

Definition at line 507 of file MIDIIOJ.cpp.

References mFile, and mNumTrax.

Referenced by start().

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

void MIDIIO::open ( )
inherited

open the abstract

Definition at line 87 of file MIDIIOJ.cpp.

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.

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

juce::MidiFile csl::MIDIPlayer::mFile

JUCE MIDI file.

Definition at line 197 of file MIDIIOJ.h.

Referenced by init(), mergeTrax(), and start().

int csl::MIDIPlayer::mNumTrax

num tracks

Definition at line 198 of file MIDIIOJ.h.

Referenced by init(), and mergeTrax().

juce::MidiMessageSequence* csl::MIDIPlayer::mTrak

track ptr

Definition at line 199 of file MIDIIOJ.h.

Referenced by init(), and start().

bool csl::MIDIPlayer::mIsOn

Active flag.

Definition at line 200 of file MIDIIOJ.h.

Referenced by init(), start(), and stop().

InstrumentLibrary* csl::MIDIPlayer::mLibrary

instrument library

Definition at line 202 of file MIDIIOJ.h.

Referenced by MIDIPlayer(), and start().

float csl::MIDIPlayer::mTempoScale

tempo scale (secs/beat / ticks/beat)

Definition at line 203 of file MIDIIOJ.h.

Referenced by init(), and start().

int csl::MIDIIO::mDeviceID
inherited

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

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::mMsg
inherited

current message (its flags determine the port state)

Definition at line 104 of file MIDIIOJ.h.

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

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 csl::MIDIOut::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::mBufferSize
protectedinherited

Definition at line 114 of file MIDIIOJ.h.

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 csl::MIDIOut::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: