remove hasSampleInsHeader()

- it is only used by MultiPCM
- an alternative approach is in place
This commit is contained in:
tildearrow 2025-09-14 14:21:31 -05:00
parent c1b7a06a37
commit 3a06e7b963
7 changed files with 21 additions and 92 deletions

View file

@ -1007,14 +1007,7 @@ class DivDispatch {
* @return whether it did.
*/
virtual bool hasSamplePtrHeader(int index=0);
/**
* check whether chip has sample instrument header in sample memory.
* @param index the memory index.
* @return whether it did.
*/
virtual bool hasSampleInsHeader(int index=0);
/**
* check whether sample has been loaded in memory.
* @param index index.

View file

@ -2681,6 +2681,9 @@ void DivEngine::loadTempIns(DivInstrument* which) {
tempIns=new DivInstrument;
}
*tempIns=*which;
for (int i=0; i<song.systemLen; i++) {
disCont[i].dispatch->notifyInsAddition(i);
}
BUSY_END;
}
@ -2706,15 +2709,6 @@ void DivEngine::delInstrumentUnsafe(int index) {
}
removeAsset(song.insDir,index);
checkAssetDir(song.insDir,song.ins.size());
bool hasSampleIns=false;
for (int s=0; s<song.systemLen; s++) {
if (disCont[s].dispatch->hasSampleInsHeader()) {
hasSampleIns=true;
}
}
if (hasSampleIns) {
renderSamplesP();
}
}
}

View file

@ -221,10 +221,6 @@ bool DivDispatch::hasSamplePtrHeader(int index) {
return false;
}
bool DivDispatch::hasSampleInsHeader(int index) {
return false;
}
size_t DivDispatch::getSampleMemOffset(int index) {
return 0;
}

View file

@ -566,10 +566,6 @@ bool DivPlatformMultiPCM::hasSamplePtrHeader(int index) {
return (index==0);
}
bool DivPlatformMultiPCM::hasSampleInsHeader(int index) {
return (index==0);
}
bool DivPlatformMultiPCM::isSampleLoaded(int index, int sample) {
if (index!=0) return false;
if (sample<0 || sample>32767) return false;

View file

@ -130,7 +130,6 @@ class DivPlatformMultiPCM: public DivDispatch {
size_t getSampleMemCapacity(int index);
size_t getSampleMemUsage(int index);
bool hasSamplePtrHeader(int index=0);
bool hasSampleInsHeader(int index=0);
bool isSampleLoaded(int index, int sample);
const DivMemoryComposition* getMemCompo(int index);
void renderSamples(int chipID);