init support for setting program change
This commit is contained in:
parent
5af3804195
commit
913d22fd57
|
@ -4371,6 +4371,7 @@ bool DivEngine::initAudioBackend() {
|
||||||
lowLatency=getConfInt("lowLatency",0);
|
lowLatency=getConfInt("lowLatency",0);
|
||||||
metroVol=(float)(getConfInt("metroVol",100))/100.0f;
|
metroVol=(float)(getConfInt("metroVol",100))/100.0f;
|
||||||
midiOutClock=getConfInt("midiOutClock",0);
|
midiOutClock=getConfInt("midiOutClock",0);
|
||||||
|
midiOutProgramChange = getConfInt("midiOutProgramChange",0);
|
||||||
midiOutMode=getConfInt("midiOutMode",DIV_MIDI_MODE_NOTE);
|
midiOutMode=getConfInt("midiOutMode",DIV_MIDI_MODE_NOTE);
|
||||||
if (metroVol<0.0f) metroVol=0.0f;
|
if (metroVol<0.0f) metroVol=0.0f;
|
||||||
if (metroVol>2.0f) metroVol=2.0f;
|
if (metroVol>2.0f) metroVol=2.0f;
|
||||||
|
|
|
@ -365,6 +365,7 @@ class DivEngine {
|
||||||
bool systemsRegistered;
|
bool systemsRegistered;
|
||||||
bool hasLoadedSomething;
|
bool hasLoadedSomething;
|
||||||
bool midiOutClock;
|
bool midiOutClock;
|
||||||
|
bool midiOutProgramChange;
|
||||||
int midiOutMode;
|
int midiOutMode;
|
||||||
int softLockCount;
|
int softLockCount;
|
||||||
int subticks, ticks, curRow, curOrder, prevRow, prevOrder, remainingLoops, totalLoops, lastLoopPos, exportLoopCount, nextSpeed, elapsedBars, elapsedBeats, curSpeed;
|
int subticks, ticks, curRow, curOrder, prevRow, prevOrder, remainingLoops, totalLoops, lastLoopPos, exportLoopCount, nextSpeed, elapsedBars, elapsedBeats, curSpeed;
|
||||||
|
@ -1110,6 +1111,7 @@ class DivEngine {
|
||||||
systemsRegistered(false),
|
systemsRegistered(false),
|
||||||
hasLoadedSomething(false),
|
hasLoadedSomething(false),
|
||||||
midiOutClock(false),
|
midiOutClock(false),
|
||||||
|
midiOutProgramChange(false),
|
||||||
midiOutMode(DIV_MIDI_MODE_NOTE),
|
midiOutMode(DIV_MIDI_MODE_NOTE),
|
||||||
softLockCount(0),
|
softLockCount(0),
|
||||||
subticks(0),
|
subticks(0),
|
||||||
|
|
|
@ -278,7 +278,7 @@ int DivEngine::dispatchCmd(DivCommand c) {
|
||||||
cmdStream.push_back(c);
|
cmdStream.push_back(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (output) if (!skipping && output->midiOut!=NULL) {
|
if (output) if (!skipping && output->midiOut!=NULL && !isChannelMuted(c.chan)) {
|
||||||
if (output->midiOut->isDeviceOpen()) {
|
if (output->midiOut->isDeviceOpen()) {
|
||||||
if (midiOutMode==DIV_MIDI_MODE_NOTE) {
|
if (midiOutMode==DIV_MIDI_MODE_NOTE) {
|
||||||
int scaledVol=(chan[c.chan].volume*127)/MAX(1,chan[c.chan].volMax);
|
int scaledVol=(chan[c.chan].volume*127)/MAX(1,chan[c.chan].volMax);
|
||||||
|
@ -305,7 +305,7 @@ int DivEngine::dispatchCmd(DivCommand c) {
|
||||||
chan[c.chan].curMidiNote=-1;
|
chan[c.chan].curMidiNote=-1;
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_INSTRUMENT:
|
case DIV_CMD_INSTRUMENT:
|
||||||
if (chan[c.chan].lastIns!=c.value) {
|
if (chan[c.chan].lastIns!=c.value && midiOutProgramChange) {
|
||||||
output->midiOut->send(TAMidiMessage(0xc0|(c.chan&15),c.value,0));
|
output->midiOut->send(TAMidiMessage(0xc0|(c.chan&15),c.value,0));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1362,6 +1362,7 @@ class FurnaceGUI {
|
||||||
int channelFont;
|
int channelFont;
|
||||||
int channelTextCenter;
|
int channelTextCenter;
|
||||||
int midiOutClock;
|
int midiOutClock;
|
||||||
|
int midiOutProgramChange;
|
||||||
int midiOutMode;
|
int midiOutMode;
|
||||||
int maxRecentFile;
|
int maxRecentFile;
|
||||||
int centerPattern;
|
int centerPattern;
|
||||||
|
@ -1503,6 +1504,7 @@ class FurnaceGUI {
|
||||||
channelFont(1),
|
channelFont(1),
|
||||||
channelTextCenter(1),
|
channelTextCenter(1),
|
||||||
midiOutClock(0),
|
midiOutClock(0),
|
||||||
|
midiOutProgramChange(0),
|
||||||
midiOutMode(1),
|
midiOutMode(1),
|
||||||
maxRecentFile(10),
|
maxRecentFile(10),
|
||||||
centerPattern(0),
|
centerPattern(0),
|
||||||
|
|
|
@ -1149,6 +1149,11 @@ void FurnaceGUI::drawSettings() {
|
||||||
settings.midiOutClock=midiOutClockB;
|
settings.midiOutClock=midiOutClockB;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool midiOutProgramChangeB=settings.midiOutProgramChange;
|
||||||
|
if (ImGui::Checkbox("Send Program Change",&midiOutProgramChangeB)) {
|
||||||
|
settings.midiOutProgramChange=midiOutProgramChangeB;
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2608,6 +2613,7 @@ void FurnaceGUI::syncSettings() {
|
||||||
settings.channelTextCenter=e->getConfInt("channelTextCenter",1);
|
settings.channelTextCenter=e->getConfInt("channelTextCenter",1);
|
||||||
settings.maxRecentFile=e->getConfInt("maxRecentFile",10);
|
settings.maxRecentFile=e->getConfInt("maxRecentFile",10);
|
||||||
settings.midiOutClock=e->getConfInt("midiOutClock",0);
|
settings.midiOutClock=e->getConfInt("midiOutClock",0);
|
||||||
|
settings.midiOutProgramChange=e->getConfInt("midiOutProgramChange",0);
|
||||||
settings.midiOutMode=e->getConfInt("midiOutMode",1);
|
settings.midiOutMode=e->getConfInt("midiOutMode",1);
|
||||||
settings.centerPattern=e->getConfInt("centerPattern",0);
|
settings.centerPattern=e->getConfInt("centerPattern",0);
|
||||||
settings.ordersCursor=e->getConfInt("ordersCursor",1);
|
settings.ordersCursor=e->getConfInt("ordersCursor",1);
|
||||||
|
@ -2726,6 +2732,7 @@ void FurnaceGUI::syncSettings() {
|
||||||
clampSetting(settings.channelTextCenter,0,1);
|
clampSetting(settings.channelTextCenter,0,1);
|
||||||
clampSetting(settings.maxRecentFile,0,30);
|
clampSetting(settings.maxRecentFile,0,30);
|
||||||
clampSetting(settings.midiOutClock,0,1);
|
clampSetting(settings.midiOutClock,0,1);
|
||||||
|
clampSetting(settings.midiOutProgramChange,0,1);
|
||||||
clampSetting(settings.midiOutMode,0,2);
|
clampSetting(settings.midiOutMode,0,2);
|
||||||
clampSetting(settings.centerPattern,0,1);
|
clampSetting(settings.centerPattern,0,1);
|
||||||
clampSetting(settings.ordersCursor,0,1);
|
clampSetting(settings.ordersCursor,0,1);
|
||||||
|
@ -2935,6 +2942,7 @@ void FurnaceGUI::commitSettings() {
|
||||||
e->setConf("channelTextCenter",settings.channelTextCenter);
|
e->setConf("channelTextCenter",settings.channelTextCenter);
|
||||||
e->setConf("maxRecentFile",settings.maxRecentFile);
|
e->setConf("maxRecentFile",settings.maxRecentFile);
|
||||||
e->setConf("midiOutClock",settings.midiOutClock);
|
e->setConf("midiOutClock",settings.midiOutClock);
|
||||||
|
e->setConf("midiOutProgramChange",settings.midiOutProgramChange);
|
||||||
e->setConf("midiOutMode",settings.midiOutMode);
|
e->setConf("midiOutMode",settings.midiOutMode);
|
||||||
e->setConf("centerPattern",settings.centerPattern);
|
e->setConf("centerPattern",settings.centerPattern);
|
||||||
e->setConf("ordersCursor",settings.ordersCursor);
|
e->setConf("ordersCursor",settings.ordersCursor);
|
||||||
|
|
Loading…
Reference in New Issue