CSL
6.0
|
MIDI stream/file player. More...
#include <MIDIIOJ.h>
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... | |
InstrumentLibrary * | mLibrary |
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... | |
MIDIPlayer::MIDIPlayer | ( | string | nam, |
InstrumentLibrary * | lib | ||
) |
Definition at line 410 of file MIDIIOJ.cpp.
MIDIPlayer::MIDIPlayer | ( | string | folder, |
string | nam, | ||
InstrumentLibrary * | lib | ||
) |
Definition at line 418 of file MIDIIOJ.cpp.
|
inlinevirtual |
void MIDIPlayer::start | ( | int | index | ) |
open a device (empty method)
play a track; merges tracks if index< 0
Definition at line 428 of file MIDIIOJ.cpp.
References csl::CMIDIMessage::channel, csl::MIDIIO::copyMessage(), csl::CMIDIMessage::data1, csl::CMIDIMessage::data2, csl::fRand1(), csl::fTimeNow(), csl::Instrument::isActive(), csl::CMIDIMessage::isNoteOn(), csl::logMsg(), mergeTrax(), mFile, mIsOn, mLibrary, csl::MIDIIO::mMsg, mTempoScale, mTrak, csl::Instrument::playMIDI(), set_position_f, csl::Instrument::setParameter(), and csl::sleepSec().
|
virtual |
stop playing
Reimplemented from csl::MIDIIO.
Definition at line 501 of file MIDIIOJ.cpp.
References mIsOn.
|
protected |
Definition at line 383 of file MIDIIOJ.cpp.
References csl::logMsg(), mFile, mIsOn, mNumTrax, mTempoScale, and mTrak.
Referenced by MIDIPlayer().
|
protected |
|
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 len, and csl::logMsg().
|
inherited |
open the abstract
Definition at line 87 of file MIDIIOJ.cpp.
|
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.
Referenced by CSLMIDIComponent::~CSLMIDIComponent().
|
inherited |
closing MIDI stream
|
inlinevirtualinherited |
Reimplemented in csl::MIDIIn.
|
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().
|
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 csl::MIDIIn::handleIncomingMidiMessage(), csl::MIDIIn::nextEvent(), 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, 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 csl::MIDIIn::open(), and csl::MIDIOut::open().
|
protectedinherited |
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().
|
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().
|
inherited |
Definition at line 518 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 540 of file CGestalt.cpp.
References csl::logMsg().
Referenced by csl::SpeakerLayout::addSpeaker(), csl::MIDIIn::handleIncomingMidiMessage(), and csl::SpeakerLayout::setDefaultSpeakerLayout().
|
inlinevirtualinherited |
Reimplemented in csl::MIDIIn.
Definition at line 270 of file CGestalt.h.
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 |
juce::MidiMessageSequence* csl::MIDIPlayer::mTrak |
bool csl::MIDIPlayer::mIsOn |
InstrumentLibrary* csl::MIDIPlayer::mLibrary |
instrument library
Definition at line 202 of file MIDIIOJ.h.
Referenced by MIDIPlayer(), and start().
float csl::MIDIPlayer::mTempoScale |
|
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().
|
protectedinherited |
|
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().
|
inherited |
Definition at line 105 of file MIDIIOJ.h.
Referenced by csl::MIDIIn::handleIncomingMidiMessage().
|
inherited |
|
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 csl::MIDIIn::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 csl::MIDIIn::open().
|
protectedinherited |
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().
|
staticprotectedinherited |
|
staticprotectedinherited |
status indicators
Definition at line 119 of file MIDIIOP.h.
Referenced by csl::MIDIIn::open(), and csl::MIDIOut::open().