• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libtdemid
 

libtdemid

  • libtdemid
midimapper.h
1 /* midimapper.h - The midi mapper object
2  This file is part of LibKMid 0.9.5
3  Copyright (C) 1997,98,99,2000 Antonio Larrosa Jimenez
4  LibKMid's homepage : http://www.arrakis.es/~rlarrosa/libtdemid.html
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 
21  Send comments and bug fixes to Antonio Larrosa <larrosa@kde.org>
22 
23 ***************************************************************************/
24 #ifndef _MIDIMAPPER_H
25 #define _MIDIMAPPER_H
26 
27 #include <stdio.h>
28 #include <libtdemid/dattypes.h>
29 #include <tdelibs_export.h>
30 
31 #define KM_NAME_SIZE 30
32 
59 class KMID_EXPORT MidiMapper
60 {
61  private:
62  class MidiMapperPrivate;
63  MidiMapperPrivate *d;
64 
69  struct Keymap
70  {
71  char name[KM_NAME_SIZE];
72  uchar key[128];
73  struct Keymap *next;
74  };
75 
76  int _ok;
77 
78  uchar channelmap[16];
85  Keymap *channelKeymap[16];
86 
92  int channelPatchForced[16];
93 
94  uchar patchmap[128];
95 
100  Keymap *patchKeymap[128];
101 
106  Keymap *keymaps;
107 
112  char *_filename;
113 
118  int mapExpressionToVolumeEvents;
119 
124  int mapPitchBender;
125 
133  int pitchBenderRatio;
134 
135  void getValue(char *s,char *v);
136  void removeSpaces(char *s);
137  int countWords(char *s);
138  void getWord(char *t,char *s,int w);
139  // get from s the word in position w and store it in t
140 
141  void deallocateMaps(void);
142  Keymap *createKeymap(char *name,uchar use_same_note=0,uchar note=0);
143  void readPatchmap(FILE *fh);
144  void readKeymap(FILE *fh,char *first_line);
145  void readChannelmap(FILE *fh);
146  void readOptions(FILE *fh);
147 
148  void addKeymap(Keymap *newkm);
149  Keymap *keymap(char *n);
150 
151  public:
156  MidiMapper(const char *name);
157 
161  ~MidiMapper();
162 
167  void loadFile(const char *name);
168 
172  int ok(void) { return _ok; }
173 
177  uchar channel(uchar chn) { return channelmap[chn];}
178 
182  uchar patch(uchar chn,uchar pgm);
183 
188  uchar key(uchar chn,uchar pgm, uchar note);
189 
194  void pitchBender(uchar chn,uchar &lsb,uchar &msb);
195 
200  void controller(uchar chn,uchar &ctl,uchar &v);
201 
206  const char *filename(void);
207 
208 };
209 
210 #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

libtdemid

Skip menu "libtdemid"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libtdemid

Skip menu "libtdemid"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for libtdemid by doxygen 1.8.8
This website is maintained by Timothy Pearson.