Prepare to add hasSamplePtrHeader and hasSampleInstHeader in dispatch (WIP)

for refresh sample memory when loop/end pointer and instrument parameter changed. Also, this PR has minor code style fixes and add warning in MultiPCM sample map usage.
This commit is contained in:
cam900 2025-08-27 22:52:19 +09:00
parent 4ed40d37d6
commit bd8d9a56a0
10 changed files with 141 additions and 28 deletions

View file

@ -60,6 +60,18 @@ const double timeMultipliers[13]={
_x+=_text; \
}
// with sample pointer header in sample memory
#define REFRESH_SAMPLE \
bool hasSamplePtr=false; \
for (int s=0; s<e->song.systemLen; s++) { \
if (e->getDispatch(s)->hasSamplePtrHeader()) { \
hasSamplePtr=true; \
} \
} \
if (hasSamplePtr) { \
e->renderSamplesP(curSample); \
}
#define MAX_RATE(_name,_x) \
if (e->isPreviewingSample()) { \
if ((int)e->getSamplePreviewRate()>(int)(_x)) { \
@ -638,9 +650,7 @@ void FurnaceGUI::drawSampleEdit() {
sample->loopEnd=sample->samples;*/
}
updateSampleTex=true;
if (e->getSampleFormatMask()&(1U<<DIV_SAMPLE_DEPTH_BRR)) {
e->renderSamplesP(curSample);
}
REFRESH_SAMPLE
}
popWarningColor();
if (ImGui::IsItemHovered() && (!warnLoop.empty() || sample->depth==DIV_SAMPLE_DEPTH_BRR)) {
@ -877,9 +887,7 @@ void FurnaceGUI::drawSampleEdit() {
sample->loopStart=sample->loopEnd;
}
updateSampleTex=true;
if (e->getSampleFormatMask()&(1U<<DIV_SAMPLE_DEPTH_BRR)) {
e->renderSamplesP(curSample);
}
REFRESH_SAMPLE
}
if (ImGui::IsItemActive()) {
keepLoopAlive=true;
@ -920,9 +928,7 @@ void FurnaceGUI::drawSampleEdit() {
sample->loopEnd=sample->samples;
}
updateSampleTex=true;
if (e->getSampleFormatMask()&(1U<<DIV_SAMPLE_DEPTH_BRR)) {
e->renderSamplesP(curSample);
}
REFRESH_SAMPLE
}
if (ImGui::IsItemActive()) {
keepLoopAlive=true;