diff options
author | Chris Xiong <chirs241097@gmail.com> | 2015-12-29 23:54:24 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2015-12-29 23:54:24 +0800 |
commit | 8dc90ae27c24aec1851215f2cc28ee24eff01ea5 (patch) | |
tree | 13a604bf55804960ced6ec7559f626962a1265bd /qmpmidiplay.cpp | |
parent | 40ea6580aaf3d19aa77f43551185a55013d216d9 (diff) | |
download | QMidiPlayer-8dc90ae27c24aec1851215f2cc28ee24eff01ea5.tar.xz |
Master Spark. (WTF)
Diffstat (limited to 'qmpmidiplay.cpp')
-rw-r--r-- | qmpmidiplay.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/qmpmidiplay.cpp b/qmpmidiplay.cpp index b676c99..112b8e9 100644 --- a/qmpmidiplay.cpp +++ b/qmpmidiplay.cpp @@ -220,6 +220,12 @@ void CMidiPlayer::getChannelPreset(int ch,int *b,int *p,char *name) *b=info.bank;*p=info.program; strcpy(name,info.name); } +void CMidiPlayer::setChannelPreset(int ch,int b,int p) +{ + if(!synth)return; + fluid_synth_bank_select(synth,ch,b); + fluid_synth_program_change(synth,ch,p); +} //16MSB..LSB1 void CMidiPlayer::setBit(uint16_t &n, uint16_t bn, uint16_t b) {n^=(-b^n)&(1<<bn);} @@ -231,3 +237,7 @@ void CMidiPlayer::setSolo(int ch,bool s) { setBit(solo,ch,s?1:0); } +int CMidiPlayer::getSFCount() +{return synth?fluid_synth_sfcount(synth):0;} +fluid_sfont_t* CMidiPlayer::getSFPtr(int sfid) +{return synth&&sfid<getSFCount()?fluid_synth_get_sfont(synth,sfid):NULL;} |