midiout.h
/* midiout.h - class midiOut which handles the /dev/sequencer device
This file is part of LibKMid 0.9.5
Copyright (C) 1997,98,99,2000 Antonio Larrosa Jimenez
LibKMid's homepage : http://www.arrakis.es/~rlarrosa/libkmid.html
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
Send comments and bug fixes to Antonio Larrosa <larrosa@kde.org>
***************************************************************************/
#ifndef _MIDIOUT_H
#define _MIDIOUT_H
#include <libkmid/dattypes.h>
#include <libkmid/deviceman.h>
#include <libkmid/midimapper.h>
#include <stdio.h>
class MidiOut
{
private:
class MidiOutPrivate;
MidiOutPrivate *d;
protected:
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;
void seqbuf_dump (void);
void seqbuf_clean(void);
public:
MidiOut(int d=0);
virtual ~MidiOut();
virtual void openDev (int sqfd);
virtual void closeDev ();
virtual void initDev ();
int deviceType () const { return devicetype; }
const char * deviceName (void) const;
void setMidiMapper ( MidiMapper *map );
virtual void noteOn ( uchar chn, uchar note, uchar vel );
virtual void noteOff ( uchar chn, uchar note, uchar vel );
virtual void keyPressure ( uchar chn, uchar note, uchar vel );
virtual void chnPatchChange ( uchar chn, uchar patch );
virtual void chnPressure ( uchar chn, uchar vel );
virtual void chnPitchBender ( uchar chn, uchar lsb, uchar msb );
virtual void chnController ( uchar chn, uchar ctl , uchar v );
virtual void sysex ( uchar *data,ulong size);
void allNotesOff(void);
virtual void channelSilence ( uchar chn );
virtual void channelMute ( uchar chn, int b );
virtual void setVolumePercentage ( int volper )
{ volumepercentage = volper; }
int ok (void)
{ if (seqfd<0) return 0;
return (_ok>0);
}
const char *midiMapFilename ();
void sync(int i=0);
};
#endif
MidiOut::channelSilence
virtual void channelSilence(uchar chn)
Mutes all notes being played on a given channel.
Definition: midiout.cc:230
MidiOut::chnPatchChange
virtual void chnPatchChange(uchar chn, uchar patch)
See DeviceManager::chnPatchChange()
Definition: midiout.cc:147
MidiOut::noteOn
virtual void noteOn(uchar chn, uchar note, uchar vel)
See DeviceManager::noteOn()
Definition: midiout.cc:113
MidiOut::initDev
virtual void initDev()
Initializes the device sending generic standard midi events and controllers, such as changing the pat...
Definition: midiout.cc:86
MidiOut::MidiOut
MidiOut(int d=0)
Constructor.
Definition: midiout.cc:46
MidiOut::~MidiOut
virtual ~MidiOut()
Destructor.
Definition: midiout.cc:57
MidiOut::openDev
virtual void openDev(int sqfd)
Opens the device.
Definition: midiout.cc:63
MidiOut::chnController
virtual void chnController(uchar chn, uchar ctl, uchar v)
See DeviceManager::chnController()
Definition: midiout.cc:186
MidiOut::noteOff
virtual void noteOff(uchar chn, uchar note, uchar vel)
See DeviceManager::noteOff()
Definition: midiout.cc:130
MidiOut::midiMapFilename
const char * midiMapFilename()
Returns the path to the file where the current used MidiMapper object reads the configuration from...
Definition: midiout.cc:275
MidiOut
External MIDI port output class .
Definition: midiout.h:51
MidiOut::channelMute
virtual void channelMute(uchar chn, int b)
Mute or "unmute" a given channel .
Definition: midiout.cc:240
MidiMapper
A Midi Mapper class which defines the way MIDI events are translated (or "mapped") to different ones...
Definition: midimapper.h:59
MidiOut::ok
int ok(void)
Returns true if everything's ok and false if there has been any problem.
Definition: midiout.h:231
MidiOut::setVolumePercentage
virtual void setVolumePercentage(int volper)
Change all channel volume events multiplying it by this percentage correction Instead of forcing a ch...
Definition: midiout.h:225
MidiOut::chnPitchBender
virtual void chnPitchBender(uchar chn, uchar lsb, uchar msb)
See DeviceManager::chnPitchBender()
Definition: midiout.cc:166
MidiOut::sync
void sync(int i=0)
Sends the buffer to the device and returns when it's played, so you can synchronize XXX: sync should ...
Definition: midiout.cc:294
MidiOut::deviceName
const char * deviceName(void) const
Returns the name and type of this MIDI device.
Definition: midiout.cc:280
MidiOut::sysex
virtual void sysex(uchar *data, ulong size)
See DeviceManager::sysex()
Definition: midiout.cc:205
MidiOut::deviceType
int deviceType() const
Definition: midiout.h:139
MidiOut::allNotesOff
void allNotesOff(void)
Send a All Notes Off event to every channel.
Definition: midiout.cc:220
MidiOut::setMidiMapper
void setMidiMapper(MidiMapper *map)
Sets a MidiMapper object to be used to modify the midi events before sending them.
Definition: midiout.cc:107
MidiOut::keyPressure
virtual void keyPressure(uchar chn, uchar note, uchar vel)
See DeviceManager::keyPressure()
Definition: midiout.cc:140
MidiOut::chnPressure
virtual void chnPressure(uchar chn, uchar vel)
See DeviceManager::chnPressure()
Definition: midiout.cc:158
MidiOut::closeDev
virtual void closeDev()
Closes the device.
Definition: midiout.cc:77

KDE Home | KDE Accessibility Home | Description of Access Keys