deviceman.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef DEVICEMAN_H
00024 #define DEVICEMAN_H
00025
00026 #include <libkmid/dattypes.h>
00027
00028 class MidiOut;
00029 class MidiMapper;
00030
00046 class DeviceManager
00047 {
00048 protected:
00049
00054 MidiOut **device;
00055
00060 struct midi_info *midiinfo;
00061
00066 struct synth_info *synthinfo;
00067
00072 int chn2dev[16];
00073
00078 int n_synths;
00079
00084 int n_midi;
00085
00090 int n_total;
00091
00096 int m_rate;
00097
00102 double convertrate;
00103
00108 int timerstarted;
00109
00114 double lastwaittime;
00115
00122 MidiMapper *mapper_tmp;
00123
00124 int initialized;
00125
00130 int seqfd;
00131
00136 int default_dev;
00137
00141 int _ok;
00142
00147 bool alsa;
00148
00152 void seqbuf_dump (void);
00153
00157 void seqbuf_clean (void);
00158
00162 void checkAlsa (void);
00163 public:
00171 DeviceManager(int def=-1);
00172
00177 ~DeviceManager(void);
00178
00190 int initManager(void);
00191
00199 int checkInit(void);
00200
00205 MidiOut *chntodev(int chn)
00206 { return deviceForChannel(chn); };
00207
00216 MidiOut *deviceForChannel(int chn)
00217 { return (device!=0L) ? device[chn2dev[chn]] : 0L ; };
00218
00222 int deviceNumberForChannel(int chn) { return chn2dev[chn]; };
00223
00227 void setDeviceNumberForChannel(int chn, int dev);
00228
00233 int ok(void);
00234
00238 int usingAlsa(void) { return alsa; };
00239
00240
00241
00242
00254 void openDev (void);
00255
00261 void closeDev (void);
00262
00268 void initDev (void);
00269
00279 void noteOn ( uchar chn, uchar note, uchar vel );
00280
00291 void noteOff ( uchar chn, uchar note, uchar vel );
00292
00301 void keyPressure ( uchar chn, uchar note, uchar vel );
00302
00311 void chnPatchChange ( uchar chn, uchar patch );
00312
00320 void chnPressure ( uchar chn, uchar vel );
00321
00331 void chnPitchBender ( uchar chn, uchar lsb, uchar msb );
00332
00346 void chnController ( uchar chn, uchar ctl , uchar v );
00347
00360 void sysEx ( uchar *data,ulong size);
00361
00367 void wait (double ms);
00368
00373 void tmrSetTempo(int v);
00374
00378 void tmrStart(long int tpcn);
00379
00384 void tmrStop(void);
00385
00390 void tmrContinue(void);
00391
00395 void allNotesOff(void);
00396
00407 void sync(bool f=0);
00408
00419 void setVolumePercentage(int i);
00420
00427 int defaultDevice(void);
00428
00438 void setDefaultDevice(int i);
00439
00468 int setPatchesToUse(int *patchesused);
00469
00476 const char *midiMapFilename(void);
00477
00486 void setMidiMap(MidiMapper *map);
00487
00491 int rate(void) { return m_rate; };
00492
00502 int midiPorts(void) { return n_midi; };
00503
00513 int synthDevices(void) { return n_synths; };
00514
00521 const char *name(int i);
00522
00528 const char *type(int i);
00529
00530 private:
00531 class DeviceManagerPrivate;
00532 DeviceManagerPrivate *d;
00533 };
00534
00535 #endif
This file is part of the documentation for kdelibs Version 3.1.5.