.TH "MidiOut" 3 "28 Jan 2004" "libkmid Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
MidiOut \- External MIDI port output class . Sends MIDI events to external MIDI devices.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <midiout.h>\fP
.PP
Inherited by \fBAlsaOut\fP, \fBFMOut\fP, \fBGUSOut\fP, and \fBSynthOut\fP.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBMidiOut\fP (int d=0)"
.br
.RI "\fIConstructor. \fP"
.ti -1c
.RI "virtual \fB~MidiOut\fP ()"
.br
.RI "\fIDestructor. \fP"
.ti -1c
.RI "virtual void \fBopenDev\fP (int sqfd)"
.br
.RI "\fIOpens the device. \fP"
.ti -1c
.RI "virtual void \fBcloseDev\fP ()"
.br
.RI "\fICloses the device. \fP"
.ti -1c
.RI "virtual void \fBinitDev\fP ()"
.br
.RI "\fIInitializes 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. \fP"
.ti -1c
.RI "int \fBdeviceType\fP () const "
.br
.ti -1c
.RI "const  char * \fBdeviceName\fP (void) const "
.br
.RI "\fIReturns the name and type of this MIDI device. \fP"
.ti -1c
.RI "void \fBsetMidiMapper\fP (\fBMidiMapper\fP *map)"
.br
.RI "\fISets a \fBMidiMapper\fP object to be used to modify the midi events before sending them. \fP"
.ti -1c
.RI "virtual void \fBnoteOn\fP (\fBuchar\fP chn, \fBuchar\fP note, \fBuchar\fP vel)"
.br
.RI "\fISee \fBDeviceManager::noteOn\fP(). \fP"
.ti -1c
.RI "virtual void \fBnoteOff\fP (\fBuchar\fP chn, \fBuchar\fP note, \fBuchar\fP vel)"
.br
.RI "\fISee \fBDeviceManager::noteOff\fP(). \fP"
.ti -1c
.RI "virtual void \fBkeyPressure\fP (\fBuchar\fP chn, \fBuchar\fP note, \fBuchar\fP vel)"
.br
.RI "\fISee \fBDeviceManager::keyPressure\fP(). \fP"
.ti -1c
.RI "virtual void \fBchnPatchChange\fP (\fBuchar\fP chn, \fBuchar\fP patch)"
.br
.RI "\fISee \fBDeviceManager::chnPatchChange\fP(). \fP"
.ti -1c
.RI "virtual void \fBchnPressure\fP (\fBuchar\fP chn, \fBuchar\fP vel)"
.br
.RI "\fISee \fBDeviceManager::chnPressure\fP(). \fP"
.ti -1c
.RI "virtual void \fBchnPitchBender\fP (\fBuchar\fP chn, \fBuchar\fP lsb, \fBuchar\fP msb)"
.br
.RI "\fISee \fBDeviceManager::chnPitchBender\fP(). \fP"
.ti -1c
.RI "virtual void \fBchnController\fP (\fBuchar\fP chn, \fBuchar\fP ctl, \fBuchar\fP v)"
.br
.RI "\fISee \fBDeviceManager::chnController\fP(). \fP"
.ti -1c
.RI "virtual void \fBsysex\fP (\fBuchar\fP *data, \fBulong\fP size)"
.br
.RI "\fISee \fBDeviceManager::sysex\fP(). \fP"
.ti -1c
.RI "void \fBallNotesOff\fP (void)"
.br
.RI "\fISend a All Notes Off event to every channel. \fP"
.ti -1c
.RI "virtual void \fBchannelSilence\fP (\fBuchar\fP chn)"
.br
.RI "\fIMutes all notes being played on a given channel. \fP"
.ti -1c
.RI "virtual void \fBchannelMute\fP (\fBuchar\fP chn, int a)"
.br
.RI "\fIMute or 'unmute' a given channel . \fP"
.ti -1c
.RI "virtual void \fBsetVolumePercentage\fP (int volper)"
.br
.RI "\fIChange 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. \fP"
.ti -1c
.RI "int \fBok\fP (void)"
.br
.RI "\fIReturns true if everything's ok and false if there has been any problem. \fP"
.ti -1c
.RI "const  char * \fBmidiMapFilename\fP ()"
.br
.RI "\fIReturns the path to the file where the current used \fBMidiMapper\fP object reads the configuration from, or an empty string if there's no \fBMidiMapper\fP. \fP"
.ti -1c
.RI "void \fBsync\fP (int i=0)"
.br
.RI "\fISends the buffer to the device and returns when it's played, so you can synchronize XXX: sync should be virtual after next bic release. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "void \fBseqbuf_dump\fP (void)"
.br
.ti -1c
.RI "void \fBseqbuf_clean\fP (void)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "int \fBseqfd\fP"
.br
.ti -1c
.RI "int \fBdevice\fP"
.br
.ti -1c
.RI "int \fBdevicetype\fP"
.br
.ti -1c
.RI "int \fBvolumepercentage\fP"
.br
.ti -1c
.RI "\fBMidiMapper\fP * \fBmap\fP"
.br
.ti -1c
.RI "\fBuchar\fP \fBchnpatch\fP [16]"
.br
.ti -1c
.RI "int \fBchnbender\fP [16]"
.br
.ti -1c
.RI "\fBuchar\fP \fBchnpressure\fP [16]"
.br
.ti -1c
.RI "\fBuchar\fP \fBchncontroller\fP [16][256]"
.br
.ti -1c
.RI "int \fBchnmute\fP [16]"
.br
.ti -1c
.RI "int \fB_ok\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
External MIDI port output class . Sends MIDI events to external MIDI devices. 

This class is used to send midi events to external midi devices.
.PP
MidiOut is inherited by other MIDI devices classes (like \fBSynthOut\fP or \fBFMOut\fP) to support a common API.
.PP
In general, you don't want to use MidiOut directly, but within a \fBDeviceManager\fP object, which is the preferred way to generate music.
.PP
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 \fBDeviceManager::initManager\fP().
.PP
\fBVersion:\fP
.RS 4
0.9.5 17/01/2000 
.RE
.PP
\fBAuthor:\fP
.RS 4
Antonio Larrosa Jimenez <larrosa@kde.org> 
.RE
.PP

.PP
Definition at line 51 of file midiout.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "MidiOut::MidiOut (int d = 0)"
.PP
Constructor. After constructing a MidiOut device, you must open it (using \fBopenDev\fP() ). Additionally you may want to initialize it (with \fBinitDev\fP() ), Definition at line 46 of file midiout.cc.
.SS "MidiOut::~\fBMidiOut\fP ()\fC [virtual]\fP"
.PP
Destructor. It doesn't matter if you close the device (\fBcloseDev\fP() ) before you destruct the object because in other case, it will be closed here. Definition at line 57 of file midiout.cc.
.PP
References closeDev().
.SH "Member Function Documentation"
.PP 
.SS "void MidiOut::openDev (int sqfd)\fC [virtual]\fP"
.PP
Opens the device. This is generally called from \fBDeviceManager\fP , so you shouldn't call this yourself (except if you created the MidiOut object yourself. 
.PP
\fBParameters:\fP
.RS 4
\fIsqfd\fP a file descriptor of /dev/sequencer 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBcloseDev\fP 
.PP
\fBinitDev\fP 
.RE
.PP
Reimplemented in \fBAlsaOut\fP, \fBFMOut\fP, \fBGUSOut\fP, and \fBSynthOut\fP.
.PP
Definition at line 63 of file midiout.cc.
.PP
Referenced by DeviceManager::openDev().
.SS "void MidiOut::closeDev ()\fC [virtual]\fP"
.PP
Closes the device. It basically tells the device (the file descriptor) is going to be closed. 
.PP
\fBSee also:\fP
.RS 4
\fBopenDev\fP 
.RE
.PP
Reimplemented in \fBAlsaOut\fP, \fBFMOut\fP, \fBGUSOut\fP, and \fBSynthOut\fP.
.PP
Definition at line 77 of file midiout.cc.
.PP
References ok().
.PP
Referenced by DeviceManager::closeDev(), DeviceManager::openDev(), and ~MidiOut().
.SS "void MidiOut::initDev ()\fC [virtual]\fP"
.PP
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 \fBAlsaOut\fP, \fBFMOut\fP, \fBGUSOut\fP, and \fBSynthOut\fP.
.PP
Definition at line 86 of file midiout.cc.
.PP
References chnController(), chnPatchChange(), chnPitchBender(), chnPressure(), ok(), and sysex().
.PP
Referenced by DeviceManager::initDev().
.SS "int MidiOut::deviceType () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the device type of the object. This is to identify the inherited class that a given object is polymorphed to. The returned value is one of these :
.RE
.PP
.IP "\(bu" 2
KMID_EXTERNAL_MIDI if it's a \fBMidiOut\fP object 
.IP "\(bu" 2
KMID_SYNTH if it's a \fBSynthOut\fP object (as an AWE device) 
.IP "\(bu" 2
KMID_FM if it's a \fBFMOut\fP object 
.IP "\(bu" 2
KMID_GUS if it's a \fBGUSOut\fP object
.PP
which are defined in \fBmidispec.h\fP
.PP
\fBSee also:\fP
.RS 4
\fBdeviceName\fP 
.RE
.PP
Reimplemented in \fBAlsaOut\fP.
.PP
Definition at line 139 of file midiout.h.
.PP
Referenced by deviceName(), and sync().
.SS "const  char * MidiOut::deviceName (void) const"
.PP
Returns the name and type of this MIDI device. \fBSee also:\fP
.RS 4
\fBdeviceType\fP 
.RE
.PP
Reimplemented in \fBAlsaOut\fP.
.PP
Definition at line 280 of file midiout.cc.
.PP
References deviceType().
.PP
Referenced by DeviceManager::name().
.SS "void MidiOut::setMidiMapper (\fBMidiMapper\fP * map)"
.PP
Sets a \fBMidiMapper\fP object to be used to modify the midi events before sending them. \fBParameters:\fP
.RS 4
\fImap\fP the \fBMidiMapper\fP to use.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBMidiMapper\fP 
.PP
\fBmidiMapFilename\fP 
.RE
.PP
Definition at line 107 of file midiout.cc.
.SS "void MidiOut::noteOn (\fBuchar\fP chn, \fBuchar\fP note, \fBuchar\fP vel)\fC [virtual]\fP"
.PP
See \fBDeviceManager::noteOn\fP(). Reimplemented in \fBAlsaOut\fP, \fBFMOut\fP, \fBGUSOut\fP, and \fBSynthOut\fP.
.PP
Definition at line 113 of file midiout.cc.
.PP
References MidiMapper::channel(), MidiMapper::key(), and noteOff().
.PP
Referenced by DeviceManager::noteOn().
.SS "void MidiOut::noteOff (\fBuchar\fP chn, \fBuchar\fP note, \fBuchar\fP vel)\fC [virtual]\fP"
.PP
See \fBDeviceManager::noteOff\fP(). Reimplemented in \fBAlsaOut\fP, \fBFMOut\fP, \fBGUSOut\fP, and \fBSynthOut\fP.
.PP
Definition at line 130 of file midiout.cc.
.PP
References MidiMapper::channel(), and MidiMapper::key().
.PP
Referenced by channelSilence(), DeviceManager::noteOff(), and noteOn().
.SS "void MidiOut::keyPressure (\fBuchar\fP chn, \fBuchar\fP note, \fBuchar\fP vel)\fC [virtual]\fP"
.PP
See \fBDeviceManager::keyPressure\fP(). Reimplemented in \fBAlsaOut\fP, \fBFMOut\fP, \fBGUSOut\fP, and \fBSynthOut\fP.
.PP
Definition at line 140 of file midiout.cc.
.PP
References MidiMapper::channel(), and MidiMapper::key().
.PP
Referenced by DeviceManager::keyPressure().
.SS "void MidiOut::chnPatchChange (\fBuchar\fP chn, \fBuchar\fP patch)\fC [virtual]\fP"
.PP
See \fBDeviceManager::chnPatchChange\fP(). Reimplemented in \fBAlsaOut\fP, \fBFMOut\fP, \fBGUSOut\fP, and \fBSynthOut\fP.
.PP
Definition at line 147 of file midiout.cc.
.PP
References MidiMapper::channel(), and MidiMapper::patch().
.PP
Referenced by DeviceManager::chnPatchChange(), and initDev().
.SS "void MidiOut::chnPressure (\fBuchar\fP chn, \fBuchar\fP vel)\fC [virtual]\fP"
.PP
See \fBDeviceManager::chnPressure\fP(). Reimplemented in \fBAlsaOut\fP, \fBFMOut\fP, \fBGUSOut\fP, and \fBSynthOut\fP.
.PP
Definition at line 158 of file midiout.cc.
.PP
References MidiMapper::channel().
.PP
Referenced by DeviceManager::chnPressure(), and initDev().
.SS "void MidiOut::chnPitchBender (\fBuchar\fP chn, \fBuchar\fP lsb, \fBuchar\fP msb)\fC [virtual]\fP"
.PP
See \fBDeviceManager::chnPitchBender\fP(). Reimplemented in \fBAlsaOut\fP, \fBFMOut\fP, \fBGUSOut\fP, and \fBSynthOut\fP.
.PP
Definition at line 166 of file midiout.cc.
.PP
References MidiMapper::channel(), and MidiMapper::pitchBender().
.PP
Referenced by DeviceManager::chnPitchBender(), and initDev().
.SS "void MidiOut::chnController (\fBuchar\fP chn, \fBuchar\fP ctl, \fBuchar\fP v)\fC [virtual]\fP"
.PP
See \fBDeviceManager::chnController\fP(). Reimplemented in \fBAlsaOut\fP, \fBFMOut\fP, \fBGUSOut\fP, and \fBSynthOut\fP.
.PP
Definition at line 186 of file midiout.cc.
.PP
References MidiMapper::channel(), and MidiMapper::controller().
.PP
Referenced by allNotesOff(), DeviceManager::chnController(), and initDev().
.SS "void MidiOut::sysex (\fBuchar\fP * data, \fBulong\fP size)\fC [virtual]\fP"
.PP
See \fBDeviceManager::sysex\fP(). Reimplemented in \fBAlsaOut\fP, \fBFMOut\fP, \fBGUSOut\fP, and \fBSynthOut\fP.
.PP
Definition at line 205 of file midiout.cc.
.PP
Referenced by initDev(), and DeviceManager::sysEx().
.SS "void MidiOut::allNotesOff (void)"
.PP
Send a All Notes Off event to every channel. Definition at line 220 of file midiout.cc.
.PP
References chnController(), and sync().
.PP
Referenced by DeviceManager::allNotesOff().
.SS "void MidiOut::channelSilence (\fBuchar\fP chn)\fC [virtual]\fP"
.PP
Mutes all notes being played on a given channel. Reimplemented in \fBAlsaOut\fP.
.PP
Definition at line 230 of file midiout.cc.
.PP
References noteOff(), and sync().
.PP
Referenced by channelMute().
.SS "void MidiOut::channelMute (\fBuchar\fP chn, int a)\fC [virtual]\fP"
.PP
Mute or 'unmute' a given channel . \fBParameters:\fP
.RS 4
\fIchn\fP channel to work on 
.br
\fIb\fP if true, the device will ignore subsequent notes played on the chn channel, and mute all notes being played on it. If b is false, the channel is back to work. 
.RE
.PP
Reimplemented in \fBAlsaOut\fP.
.PP
Definition at line 240 of file midiout.cc.
.PP
References channelSilence().
.SS "virtual void MidiOut::setVolumePercentage (int volper)\fC [inline, virtual]\fP"
.PP
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. \fBParameters:\fP
.RS 4
\fIvolper\fP is an integer value, where 0 is quiet, 100 is used to send an unmodified value, 200 play music twice louder than it should, etc. 
.RE
.PP
Reimplemented in \fBAlsaOut\fP, and \fBFMOut\fP.
.PP
Definition at line 224 of file midiout.h.
.PP
Referenced by DeviceManager::setVolumePercentage().
.SS "int MidiOut::ok (void)\fC [inline]\fP"
.PP
Returns true if everything's ok and false if there has been any problem. Reimplemented in \fBAlsaOut\fP.
.PP
Definition at line 230 of file midiout.h.
.PP
Referenced by SynthOut::closeDev(), closeDev(), GUSOut::closeDev(), FMOut::closeDev(), SynthOut::initDev(), initDev(), GUSOut::initDev(), FMOut::initDev(), and DeviceManager::openDev().
.SS "const  char * MidiOut::midiMapFilename ()"
.PP
Returns the path to the file where the current used \fBMidiMapper\fP object reads the configuration from, or an empty string if there's no \fBMidiMapper\fP. Definition at line 275 of file midiout.cc.
.PP
References MidiMapper::filename().
.SS "void MidiOut::sync (int i = 0)"
.PP
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 \fBAlsaOut\fP.
.PP
Definition at line 294 of file midiout.cc.
.PP
References deviceType().
.PP
Referenced by allNotesOff(), and channelSilence().

.SH "Author"
.PP 
Generated automatically by Doxygen for libkmid Library from the source code.
