channel mask for user presets (#2135)
* user presets channel mask * update tooltip, mask generator helper thing * better tooltip * yea this is better * update doc * apply to all subsongs
This commit is contained in:
parent
fa08bc5d8e
commit
8d81ef87b8
|
@ -12,6 +12,7 @@ chip configuration is exactly as in the [chip manager](chip-manager.md) window.
|
||||||
|
|
||||||
the **Advanced** field stores additional settings that are set when a new song is started. these are listed in "option=value" format, one per line.
|
the **Advanced** field stores additional settings that are set when a new song is started. these are listed in "option=value" format, one per line.
|
||||||
- `tickRate`: sets tick rate.
|
- `tickRate`: sets tick rate.
|
||||||
|
- `chanMask`: sets which channels to hide. written as a comma-separated list of integers
|
||||||
|
|
||||||
**Save and Close**: as it says.
|
**Save and Close**: as it says.
|
||||||
|
|
||||||
|
|
|
@ -520,6 +520,15 @@ void DivEngine::initSongWithDesc(const char* description, bool inBase64, bool ol
|
||||||
if (song.subsong[0]->hz<1.0) song.subsong[0]->hz=1.0;
|
if (song.subsong[0]->hz<1.0) song.subsong[0]->hz=1.0;
|
||||||
if (song.subsong[0]->hz>999.0) song.subsong[0]->hz=999.0;
|
if (song.subsong[0]->hz>999.0) song.subsong[0]->hz=999.0;
|
||||||
|
|
||||||
|
curChanMask=c.getIntList("chanMask",{});
|
||||||
|
for (unsigned char i:curChanMask) {
|
||||||
|
int j=i-1;
|
||||||
|
if (j<0) j=0;
|
||||||
|
if (j>DIV_MAX_CHANS) j=DIV_MAX_CHANS-1;
|
||||||
|
curSubSong->chanShow[j]=false;
|
||||||
|
curSubSong->chanShowChanOsc[j]=false;
|
||||||
|
}
|
||||||
|
|
||||||
song.author=getConfString("defaultAuthorName","");
|
song.author=getConfString("defaultAuthorName","");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -754,6 +763,13 @@ int DivEngine::addSubSong() {
|
||||||
BUSY_BEGIN;
|
BUSY_BEGIN;
|
||||||
saveLock.lock();
|
saveLock.lock();
|
||||||
song.subsong.push_back(new DivSubSong);
|
song.subsong.push_back(new DivSubSong);
|
||||||
|
for (unsigned char i:curChanMask) {
|
||||||
|
int j=i-1;
|
||||||
|
if (j<0) j=0;
|
||||||
|
if (j>DIV_MAX_CHANS) j=DIV_MAX_CHANS-1;
|
||||||
|
song.subsong.back()->chanShow[j]=false;
|
||||||
|
song.subsong.back()->chanShowChanOsc[j]=false;
|
||||||
|
}
|
||||||
saveLock.unlock();
|
saveLock.unlock();
|
||||||
BUSY_END;
|
BUSY_END;
|
||||||
return song.subsong.size()-1;
|
return song.subsong.size()-1;
|
||||||
|
|
|
@ -518,6 +518,7 @@ class DivEngine {
|
||||||
std::vector<DivCommand> cmdStream;
|
std::vector<DivCommand> cmdStream;
|
||||||
std::vector<DivInstrumentType> possibleInsTypes;
|
std::vector<DivInstrumentType> possibleInsTypes;
|
||||||
std::vector<DivEffectContainer> effectInst;
|
std::vector<DivEffectContainer> effectInst;
|
||||||
|
std::vector<int> curChanMask;
|
||||||
static DivSysDef* sysDefs[DIV_MAX_CHIP_DEFS];
|
static DivSysDef* sysDefs[DIV_MAX_CHIP_DEFS];
|
||||||
static DivSystem sysFileMapFur[DIV_MAX_CHIP_DEFS];
|
static DivSystem sysFileMapFur[DIV_MAX_CHIP_DEFS];
|
||||||
static DivSystem sysFileMapDMF[DIV_MAX_CHIP_DEFS];
|
static DivSystem sysFileMapDMF[DIV_MAX_CHIP_DEFS];
|
||||||
|
|
|
@ -475,7 +475,8 @@ void FurnaceGUI::drawUserPresets() {
|
||||||
ImGui::SetTooltip(_(
|
ImGui::SetTooltip(_(
|
||||||
"insert additional settings in `option=value` format.\n"
|
"insert additional settings in `option=value` format.\n"
|
||||||
"available options:\n"
|
"available options:\n"
|
||||||
"- tickRate"
|
"- tickRate \n"
|
||||||
|
"- chanMask \n"
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue