midimapper.h
/* midimapper.h - The midi mapper object
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 _MIDIMAPPER_H
#define _MIDIMAPPER_H
#include <stdio.h>
#include <libkmid/dattypes.h>
#include <kdelibs_export.h>
#define KM_NAME_SIZE 30
class KMID_EXPORT MidiMapper
{
private:
class MidiMapperPrivate;
MidiMapperPrivate *d;
struct Keymap
{
char name[KM_NAME_SIZE];
uchar key[128];
struct Keymap *next;
};
int _ok;
uchar channelmap[16];
Keymap *channelKeymap[16];
int channelPatchForced[16];
uchar patchmap[128];
Keymap *patchKeymap[128];
Keymap *keymaps;
char *_filename;
int mapExpressionToVolumeEvents;
int mapPitchBender;
int pitchBenderRatio;
void getValue(char *s,char *v);
void removeSpaces(char *s);
int countWords(char *s);
void getWord(char *t,char *s,int w);
// get from s the word in position w and store it in t
void deallocateMaps(void);
Keymap *createKeymap(char *name,uchar use_same_note=0,uchar note=0);
void readPatchmap(FILE *fh);
void readKeymap(FILE *fh,char *first_line);
void readChannelmap(FILE *fh);
void readOptions(FILE *fh);
void addKeymap(Keymap *newkm);
Keymap *keymap(char *n);
public:
MidiMapper(const char *name);
~MidiMapper();
void loadFile(const char *name);
int ok(void) { return _ok; }
uchar channel(uchar chn) { return channelmap[chn];}
uchar patch(uchar chn,uchar pgm);
uchar key(uchar chn,uchar pgm, uchar note);
void pitchBender(uchar chn,uchar &lsb,uchar &msb);
void controller(uchar chn,uchar &ctl,uchar &v);
const char *filename(void);
};
#endif
MidiMapper::ok
int ok(void)
Returns the status of the object.
Definition: midimapper.h:172
MidiMapper::channel
uchar channel(uchar chn)
Returns the channel which chn should be mapped to.
Definition: midimapper.h:177
MidiMapper
A Midi Mapper class which defines the way MIDI events are translated (or "mapped") to different ones...
Definition: midimapper.h:59

KDE Home | KDE Accessibility Home | Description of Access Keys