MidiOut Class Reference
External MIDI port output class . Sends MIDI events to external MIDI devices. More...
#include <midiout.h>
Inheritance diagram for MidiOut:

Public Member Functions | |
MidiOut (int d=0) | |
Constructor. | |
virtual | ~MidiOut () |
Destructor. | |
virtual void | openDev (int sqfd) |
Opens the device. | |
virtual void | closeDev () |
Closes the device. | |
virtual void | initDev () |
Initializes the device sending generic standard midi events and controllers, such as changing the patches of each channel to an Acoustic Piano (000), setting the volume to a normal value, etc. | |
int | deviceType () const |
const char * | deviceName (void) const |
Returns the name and type of this MIDI device. | |
void | setMidiMapper (MidiMapper *map) |
Sets a MidiMapper object to be used to modify the midi events before sending them. | |
virtual void | noteOn (uchar chn, uchar note, uchar vel) |
See DeviceManager::noteOn(). | |
virtual void | noteOff (uchar chn, uchar note, uchar vel) |
See DeviceManager::noteOff(). | |
virtual void | keyPressure (uchar chn, uchar note, uchar vel) |
See DeviceManager::keyPressure(). | |
virtual void | chnPatchChange (uchar chn, uchar patch) |
See DeviceManager::chnPatchChange(). | |
virtual void | chnPressure (uchar chn, uchar vel) |
See DeviceManager::chnPressure(). | |
virtual void | chnPitchBender (uchar chn, uchar lsb, uchar msb) |
See DeviceManager::chnPitchBender(). | |
virtual void | chnController (uchar chn, uchar ctl, uchar v) |
See DeviceManager::chnController(). | |
virtual void | sysex (uchar *data, ulong size) |
See DeviceManager::sysex(). | |
void | allNotesOff (void) |
Send a All Notes Off event to every channel. | |
virtual void | channelSilence (uchar chn) |
Mutes all notes being played on a given channel. | |
virtual void | channelMute (uchar chn, int a) |
Mute or "unmute" a given channel . | |
virtual void | setVolumePercentage (int volper) |
Change all channel volume events multiplying it by this percentage correction Instead of forcing a channel to a fixed volume, this method allows to music to fade out even when it was being played softly. | |
int | ok (void) |
Returns true if everything's ok and false if there has been any problem. | |
const char * | midiMapFilename () |
Returns the path to the file where the current used MidiMapper object reads the configuration from, or an empty string if there's no MidiMapper. | |
void | sync (int i=0) |
Sends the buffer to the device and returns when it's played, so you can synchronize XXX: sync should be virtual after next bic release. | |
Protected Member Functions | |
void | seqbuf_dump (void) |
void | seqbuf_clean (void) |
Protected Attributes | |
int | seqfd |
int | device |
int | devicetype |
int | volumepercentage |
MidiMapper * | map |
uchar | chnpatch [16] |
int | chnbender [16] |
uchar | chnpressure [16] |
uchar | chncontroller [16][256] |
int | chnmute [16] |
int | _ok |
Detailed Description
External MIDI port output class . Sends MIDI events to external MIDI devices.This class is used to send midi events to external midi devices.
MidiOut is inherited by other MIDI devices classes (like SynthOut or FMOut) to support a common API.
In general, you don't want to use MidiOut directly, but within a DeviceManager object, which is the preferred way to generate music.
If you want to add support for other devices (I don't think there are any) you just have to create a class that inherits from MidiOut and create one object of your new class in DeviceManager::initManager().
- Version:
- 0.9.5 17/01/2000
- Author:
- Antonio Larrosa Jimenez <larrosa@kde.org>
Definition at line 51 of file midiout.h.
Constructor & Destructor Documentation
|
Constructor. After constructing a MidiOut device, you must open it (using openDev() ). Additionally you may want to initialize it (with initDev() ), Definition at line 46 of file midiout.cc. |
|
Destructor. It doesn't matter if you close the device (closeDev() ) before you destruct the object because in other case, it will be closed here. Definition at line 57 of file midiout.cc. References closeDev(). |
Member Function Documentation
|
Opens the device. This is generally called from DeviceManager , so you shouldn't call this yourself (except if you created the MidiOut object yourself.
Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut. Definition at line 63 of file midiout.cc. Referenced by DeviceManager::openDev(). |
|
Closes the device. It basically tells the device (the file descriptor) is going to be closed.
Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut. Definition at line 77 of file midiout.cc. References ok(). Referenced by DeviceManager::closeDev(), DeviceManager::openDev(), and ~MidiOut(). |
|
Initializes the device sending generic standard midi events and controllers, such as changing the patches of each channel to an Acoustic Piano (000), setting the volume to a normal value, etc.
Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut. Definition at line 86 of file midiout.cc. References chnController(), chnPatchChange(), chnPitchBender(), chnPressure(), ok(), and sysex(). Referenced by DeviceManager::initDev(). |
|
Reimplemented in AlsaOut. Definition at line 139 of file midiout.h. Referenced by deviceName(), and sync(). |
|
Returns the name and type of this MIDI device.
Reimplemented in AlsaOut. Definition at line 280 of file midiout.cc. References deviceType(). Referenced by DeviceManager::name(). |
|
Sets a MidiMapper object to be used to modify the midi events before sending them.
Definition at line 107 of file midiout.cc. |
|
See DeviceManager::noteOn().
Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut. Definition at line 113 of file midiout.cc. References MidiMapper::channel(), MidiMapper::key(), and noteOff(). Referenced by DeviceManager::noteOn(). |
|
See DeviceManager::noteOff().
Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut. Definition at line 130 of file midiout.cc. References MidiMapper::channel(), and MidiMapper::key(). Referenced by channelSilence(), DeviceManager::noteOff(), and noteOn(). |
|
See DeviceManager::keyPressure().
Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut. Definition at line 140 of file midiout.cc. References MidiMapper::channel(), and MidiMapper::key(). Referenced by DeviceManager::keyPressure(). |
|
See DeviceManager::chnPatchChange().
Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut. Definition at line 147 of file midiout.cc. References MidiMapper::channel(), and MidiMapper::patch(). Referenced by DeviceManager::chnPatchChange(), and initDev(). |
|
See DeviceManager::chnPressure().
Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut. Definition at line 158 of file midiout.cc. References MidiMapper::channel(). Referenced by DeviceManager::chnPressure(), and initDev(). |
|
See DeviceManager::chnPitchBender().
Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut. Definition at line 166 of file midiout.cc. References MidiMapper::channel(), and MidiMapper::pitchBender(). Referenced by DeviceManager::chnPitchBender(), and initDev(). |
|
See DeviceManager::chnController().
Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut. Definition at line 186 of file midiout.cc. References MidiMapper::channel(), and MidiMapper::controller(). Referenced by allNotesOff(), DeviceManager::chnController(), and initDev(). |
|
See DeviceManager::sysex().
Reimplemented in AlsaOut, FMOut, GUSOut, and SynthOut. Definition at line 205 of file midiout.cc. Referenced by initDev(), and DeviceManager::sysEx(). |
|
Send a All Notes Off event to every channel.
Definition at line 220 of file midiout.cc. References chnController(), and sync(). Referenced by DeviceManager::allNotesOff(). |
|
Mutes all notes being played on a given channel.
Reimplemented in AlsaOut. Definition at line 230 of file midiout.cc. References noteOff(), and sync(). Referenced by channelMute(). |
|
Mute or "unmute" a given channel .
Reimplemented in AlsaOut. Definition at line 240 of file midiout.cc. References channelSilence(). |
|
Change all channel volume events multiplying it by this percentage correction Instead of forcing a channel to a fixed volume, this method allows to music to fade out even when it was being played softly.
Reimplemented in AlsaOut, and FMOut. Definition at line 224 of file midiout.h. Referenced by DeviceManager::setVolumePercentage(). |
|
Returns true if everything's ok and false if there has been any problem.
Reimplemented in AlsaOut. Definition at line 230 of file midiout.h. Referenced by SynthOut::closeDev(), closeDev(), GUSOut::closeDev(), FMOut::closeDev(), SynthOut::initDev(), initDev(), GUSOut::initDev(), FMOut::initDev(), and DeviceManager::openDev(). |
|
Returns the path to the file where the current used MidiMapper object reads the configuration from, or an empty string if there's no MidiMapper.
Definition at line 275 of file midiout.cc. References MidiMapper::filename(). |
|
Sends the buffer to the device and returns when it's played, so you can synchronize XXX: sync should be virtual after next bic release.
Reimplemented in AlsaOut. Definition at line 294 of file midiout.cc. References deviceType(). Referenced by allNotesOff(), and channelSilence(). |
The documentation for this class was generated from the following files: