remove hasSampleInsHeader()
- it is only used by MultiPCM - an alternative approach is in place
This commit is contained in:
parent
c1b7a06a37
commit
3a06e7b963
|
@ -1008,13 +1008,6 @@ class DivDispatch {
|
||||||
*/
|
*/
|
||||||
virtual bool hasSamplePtrHeader(int index=0);
|
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.
|
* check whether sample has been loaded in memory.
|
||||||
* @param index index.
|
* @param index index.
|
||||||
|
|
|
@ -2681,6 +2681,9 @@ void DivEngine::loadTempIns(DivInstrument* which) {
|
||||||
tempIns=new DivInstrument;
|
tempIns=new DivInstrument;
|
||||||
}
|
}
|
||||||
*tempIns=*which;
|
*tempIns=*which;
|
||||||
|
for (int i=0; i<song.systemLen; i++) {
|
||||||
|
disCont[i].dispatch->notifyInsAddition(i);
|
||||||
|
}
|
||||||
BUSY_END;
|
BUSY_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2706,15 +2709,6 @@ void DivEngine::delInstrumentUnsafe(int index) {
|
||||||
}
|
}
|
||||||
removeAsset(song.insDir,index);
|
removeAsset(song.insDir,index);
|
||||||
checkAssetDir(song.insDir,song.ins.size());
|
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -221,10 +221,6 @@ bool DivDispatch::hasSamplePtrHeader(int index) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DivDispatch::hasSampleInsHeader(int index) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t DivDispatch::getSampleMemOffset(int index) {
|
size_t DivDispatch::getSampleMemOffset(int index) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -566,10 +566,6 @@ bool DivPlatformMultiPCM::hasSamplePtrHeader(int index) {
|
||||||
return (index==0);
|
return (index==0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DivPlatformMultiPCM::hasSampleInsHeader(int index) {
|
|
||||||
return (index==0);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool DivPlatformMultiPCM::isSampleLoaded(int index, int sample) {
|
bool DivPlatformMultiPCM::isSampleLoaded(int index, int sample) {
|
||||||
if (index!=0) return false;
|
if (index!=0) return false;
|
||||||
if (sample<0 || sample>32767) return false;
|
if (sample<0 || sample>32767) return false;
|
||||||
|
|
|
@ -130,7 +130,6 @@ class DivPlatformMultiPCM: public DivDispatch {
|
||||||
size_t getSampleMemCapacity(int index);
|
size_t getSampleMemCapacity(int index);
|
||||||
size_t getSampleMemUsage(int index);
|
size_t getSampleMemUsage(int index);
|
||||||
bool hasSamplePtrHeader(int index=0);
|
bool hasSamplePtrHeader(int index=0);
|
||||||
bool hasSampleInsHeader(int index=0);
|
|
||||||
bool isSampleLoaded(int index, int sample);
|
bool isSampleLoaded(int index, int sample);
|
||||||
const DivMemoryComposition* getMemCompo(int index);
|
const DivMemoryComposition* getMemCompo(int index);
|
||||||
void renderSamples(int chipID);
|
void renderSamples(int chipID);
|
||||||
|
|
|
@ -1861,13 +1861,7 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) {
|
||||||
int sampleCountBefore=e->song.sampleLen;
|
int sampleCountBefore=e->song.sampleLen;
|
||||||
std::vector<DivInstrument*> instruments=e->instrumentFromFile(path,false);
|
std::vector<DivInstrument*> instruments=e->instrumentFromFile(path,false);
|
||||||
if (!instruments.empty()) {
|
if (!instruments.empty()) {
|
||||||
int hasSampleIns=false;
|
if (e->song.sampleLen!=sampleCountBefore) {
|
||||||
for (int s=0; s<e->song.systemLen; s++) {
|
|
||||||
if (e->getDispatch(s)->hasSampleInsHeader()) {
|
|
||||||
hasSampleIns=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((e->song.sampleLen!=sampleCountBefore) || hasSampleIns) {
|
|
||||||
e->renderSamplesP();
|
e->renderSamplesP();
|
||||||
}
|
}
|
||||||
if (curFileDialog==GUI_FILE_INS_OPEN_REPLACE) {
|
if (curFileDialog==GUI_FILE_INS_OPEN_REPLACE) {
|
||||||
|
@ -1876,6 +1870,7 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) {
|
||||||
}
|
}
|
||||||
if (prevIns>=0 && prevIns<=(int)e->song.ins.size()) {
|
if (prevIns>=0 && prevIns<=(int)e->song.ins.size()) {
|
||||||
*e->song.ins[prevIns]=*instruments[0];
|
*e->song.ins[prevIns]=*instruments[0];
|
||||||
|
e->notifyInsChange(prevIns);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
e->loadTempIns(instruments[0]);
|
e->loadTempIns(instruments[0]);
|
||||||
|
@ -3934,13 +3929,7 @@ bool FurnaceGUI::loop() {
|
||||||
DivWavetable* droppedWave=NULL;
|
DivWavetable* droppedWave=NULL;
|
||||||
//DivSample* droppedSample=NULL;
|
//DivSample* droppedSample=NULL;
|
||||||
if (!instruments.empty()) {
|
if (!instruments.empty()) {
|
||||||
bool hasSampleIns=false;
|
if (e->song.sampleLen!=sampleCountBefore) {
|
||||||
for (int s=0; s<e->song.systemLen; s++) {
|
|
||||||
if (e->getDispatch(s)->hasSampleInsHeader()) {
|
|
||||||
hasSampleIns=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((e->song.sampleLen!=sampleCountBefore) || hasSampleIns) {
|
|
||||||
e->renderSamplesP();
|
e->renderSamplesP();
|
||||||
}
|
}
|
||||||
if (!e->getWarnings().empty()) {
|
if (!e->getWarnings().empty()) {
|
||||||
|
@ -5062,6 +5051,7 @@ bool FurnaceGUI::loop() {
|
||||||
if (prevInsData!=NULL) {
|
if (prevInsData!=NULL) {
|
||||||
if (prevIns>=0 && prevIns<(int)e->song.ins.size()) {
|
if (prevIns>=0 && prevIns<(int)e->song.ins.size()) {
|
||||||
*e->song.ins[prevIns]=*prevInsData;
|
*e->song.ins[prevIns]=*prevInsData;
|
||||||
|
e->notifyInsChange(prevIns);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -5533,13 +5523,7 @@ bool FurnaceGUI::loop() {
|
||||||
instruments.push_back(j);
|
instruments.push_back(j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool hasSampleIns=false;
|
if (e->song.sampleLen!=sampleCountBefore) {
|
||||||
for (int s=0; s<e->song.systemLen; s++) {
|
|
||||||
if (e->getDispatch(s)->hasSampleInsHeader()) {
|
|
||||||
hasSampleIns=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((e->song.sampleLen!=sampleCountBefore) || hasSampleIns) {
|
|
||||||
e->renderSamplesP();
|
e->renderSamplesP();
|
||||||
}
|
}
|
||||||
if (warn) {
|
if (warn) {
|
||||||
|
@ -5579,13 +5563,7 @@ bool FurnaceGUI::loop() {
|
||||||
int sampleCountBefore=e->song.sampleLen;
|
int sampleCountBefore=e->song.sampleLen;
|
||||||
std::vector<DivInstrument*> instruments=e->instrumentFromFile(copyOfName.c_str(),true,settings.readInsNames);
|
std::vector<DivInstrument*> instruments=e->instrumentFromFile(copyOfName.c_str(),true,settings.readInsNames);
|
||||||
if (!instruments.empty()) {
|
if (!instruments.empty()) {
|
||||||
bool hasSampleIns=false;
|
if (e->song.sampleLen!=sampleCountBefore) {
|
||||||
for (int s=0; s<e->song.systemLen; s++) {
|
|
||||||
if (e->getDispatch(s)->hasSampleInsHeader()) {
|
|
||||||
hasSampleIns=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((e->song.sampleLen!=sampleCountBefore) || hasSampleIns) {
|
|
||||||
e->renderSamplesP();
|
e->renderSamplesP();
|
||||||
}
|
}
|
||||||
if (!e->getWarnings().empty()) {
|
if (!e->getWarnings().empty()) {
|
||||||
|
@ -5603,6 +5581,7 @@ bool FurnaceGUI::loop() {
|
||||||
// reset macro zoom
|
// reset macro zoom
|
||||||
memset(e->song.ins[curIns]->temp.vZoom,-1,sizeof(e->song.ins[curIns]->temp.vZoom));
|
memset(e->song.ins[curIns]->temp.vZoom,-1,sizeof(e->song.ins[curIns]->temp.vZoom));
|
||||||
MARK_MODIFIED;
|
MARK_MODIFIED;
|
||||||
|
e->notifyInsChange(curIns);
|
||||||
} else {
|
} else {
|
||||||
showError(_("...but you haven't selected an instrument!"));
|
showError(_("...but you haven't selected an instrument!"));
|
||||||
}
|
}
|
||||||
|
@ -6816,6 +6795,7 @@ bool FurnaceGUI::loop() {
|
||||||
*e->song.ins[curIns]=*i.first;
|
*e->song.ins[curIns]=*i.first;
|
||||||
// reset macro zoom
|
// reset macro zoom
|
||||||
memset(e->song.ins[curIns]->temp.vZoom,-1,sizeof(e->song.ins[curIns]->temp.vZoom));
|
memset(e->song.ins[curIns]->temp.vZoom,-1,sizeof(e->song.ins[curIns]->temp.vZoom));
|
||||||
|
e->notifyInsChange(curIns);
|
||||||
} else {
|
} else {
|
||||||
showError(_("...but you haven't selected an instrument!"));
|
showError(_("...but you haven't selected an instrument!"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1982,35 +1982,8 @@ void FurnaceGUI::drawGBEnv(unsigned char vol, unsigned char len, unsigned char s
|
||||||
updateFMPreview=true; \
|
updateFMPreview=true; \
|
||||||
}
|
}
|
||||||
|
|
||||||
// with instrument header in sample memory
|
|
||||||
#define PH(x) if (x) { \
|
|
||||||
MARK_MODIFIED; \
|
|
||||||
e->notifyInsChange(curIns); \
|
|
||||||
updateFMPreview=true; \
|
|
||||||
bool hasSampleIns=false; \
|
|
||||||
for (int s=0; s<e->song.systemLen; s++) { \
|
|
||||||
if (e->getDispatch(s)->hasSampleInsHeader()) { \
|
|
||||||
hasSampleIns=true; \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
if (hasSampleIns) { \
|
|
||||||
e->renderSamplesP(curSample); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define PARAMETER MARK_MODIFIED; e->notifyInsChange(curIns); updateFMPreview=true;
|
#define PARAMETER MARK_MODIFIED; e->notifyInsChange(curIns); updateFMPreview=true;
|
||||||
|
|
||||||
#define REFRESH_INSTRUMENTS \
|
|
||||||
bool hasSampleIns=false; \
|
|
||||||
for (int s=0; s<e->song.systemLen; s++) { \
|
|
||||||
if (e->getDispatch(s)->hasSampleInsHeader()) { \
|
|
||||||
hasSampleIns=true; \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
if (hasSampleIns) { \
|
|
||||||
e->renderSamplesP(curSample); \
|
|
||||||
}
|
|
||||||
|
|
||||||
String genericGuide(float value) {
|
String genericGuide(float value) {
|
||||||
return fmt::sprintf("%d",(int)value);
|
return fmt::sprintf("%d",(int)value);
|
||||||
}
|
}
|
||||||
|
@ -3505,7 +3478,6 @@ void FurnaceGUI::insTabSample(DivInstrument* ins) {
|
||||||
id=fmt::sprintf("%d: %s",i,e->song.sample[i]->name);
|
id=fmt::sprintf("%d: %s",i,e->song.sample[i]->name);
|
||||||
if (ImGui::Selectable(id.c_str(),ins->amiga.initSample==i)) { PARAMETER
|
if (ImGui::Selectable(id.c_str(),ins->amiga.initSample==i)) { PARAMETER
|
||||||
ins->amiga.initSample=i;
|
ins->amiga.initSample=i;
|
||||||
REFRESH_INSTRUMENTS
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::EndCombo();
|
ImGui::EndCombo();
|
||||||
|
@ -6780,7 +6752,6 @@ void FurnaceGUI::drawInsEdit() {
|
||||||
|
|
||||||
// reset macro zoom
|
// reset macro zoom
|
||||||
memset(ins->temp.vZoom,-1,sizeof(ins->temp.vZoom));
|
memset(ins->temp.vZoom,-1,sizeof(ins->temp.vZoom));
|
||||||
REFRESH_INSTRUMENTS
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::EndCombo();
|
ImGui::EndCombo();
|
||||||
|
@ -7917,17 +7888,17 @@ void FurnaceGUI::drawInsEdit() {
|
||||||
|
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
PH(CWVSliderScalar("##Attack Rate",sliderSize,ImGuiDataType_U8,&ins->multipcm.ar,&_ZERO,&_FIFTEEN)); rightClickable
|
P(CWVSliderScalar("##Attack Rate",sliderSize,ImGuiDataType_U8,&ins->multipcm.ar,&_ZERO,&_FIFTEEN)); rightClickable
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
PH(CWVSliderScalar("##Decay 1 Rate",sliderSize,ImGuiDataType_U8,&ins->multipcm.d1r,&_ZERO,&_FIFTEEN)); rightClickable
|
P(CWVSliderScalar("##Decay 1 Rate",sliderSize,ImGuiDataType_U8,&ins->multipcm.d1r,&_ZERO,&_FIFTEEN)); rightClickable
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
PH(CWVSliderScalar("##Decay Level",sliderSize,ImGuiDataType_U8,&ins->multipcm.dl,&_ZERO,&_FIFTEEN)); rightClickable
|
P(CWVSliderScalar("##Decay Level",sliderSize,ImGuiDataType_U8,&ins->multipcm.dl,&_ZERO,&_FIFTEEN)); rightClickable
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
PH(CWVSliderScalar("##Decay 2 Rate",sliderSize,ImGuiDataType_U8,&ins->multipcm.d2r,&_ZERO,&_FIFTEEN)); rightClickable
|
P(CWVSliderScalar("##Decay 2 Rate",sliderSize,ImGuiDataType_U8,&ins->multipcm.d2r,&_ZERO,&_FIFTEEN)); rightClickable
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
PH(CWVSliderScalar("##Release Rate",sliderSize,ImGuiDataType_U8,&ins->multipcm.rr,&_ZERO,&_FIFTEEN)); rightClickable
|
P(CWVSliderScalar("##Release Rate",sliderSize,ImGuiDataType_U8,&ins->multipcm.rr,&_ZERO,&_FIFTEEN)); rightClickable
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
PH(CWVSliderScalar("##Rate Correction",sliderSize,ImGuiDataType_U8,&ins->multipcm.rc,&_ZERO,&_FIFTEEN)); rightClickable
|
P(CWVSliderScalar("##Rate Correction",sliderSize,ImGuiDataType_U8,&ins->multipcm.rc,&_ZERO,&_FIFTEEN)); rightClickable
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
drawFMEnv(0,ins->multipcm.ar,ins->multipcm.d1r,ins->multipcm.d2r,ins->multipcm.rr,ins->multipcm.dl,0,0,0,127,15,15,ImVec2(ImGui::GetContentRegionAvail().x,sliderSize.y),ins->type);
|
drawFMEnv(0,ins->multipcm.ar,ins->multipcm.d1r,ins->multipcm.d2r,ins->multipcm.rr,ins->multipcm.dl,0,0,0,127,15,15,ImVec2(ImGui::GetContentRegionAvail().x,sliderSize.y),ins->type);
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
|
@ -7937,11 +7908,11 @@ void FurnaceGUI::drawInsEdit() {
|
||||||
ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthStretch,0.0);
|
ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthStretch,0.0);
|
||||||
ImGui::TableSetupColumn("c2",ImGuiTableColumnFlags_WidthStretch,0.0);
|
ImGui::TableSetupColumn("c2",ImGuiTableColumnFlags_WidthStretch,0.0);
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
PH(CWSliderScalar(_("LFO Rate"),ImGuiDataType_U8,&ins->multipcm.lfo,&_ZERO,&_SEVEN)); rightClickable
|
P(CWSliderScalar(_("LFO Rate"),ImGuiDataType_U8,&ins->multipcm.lfo,&_ZERO,&_SEVEN)); rightClickable
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
PH(CWSliderScalar(_("PM Depth"),ImGuiDataType_U8,&ins->multipcm.vib,&_ZERO,&_SEVEN)); rightClickable
|
P(CWSliderScalar(_("PM Depth"),ImGuiDataType_U8,&ins->multipcm.vib,&_ZERO,&_SEVEN)); rightClickable
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
PH(CWSliderScalar(_("AM Depth"),ImGuiDataType_U8,&ins->multipcm.am,&_ZERO,&_SEVEN)); rightClickable
|
P(CWSliderScalar(_("AM Depth"),ImGuiDataType_U8,&ins->multipcm.am,&_ZERO,&_SEVEN)); rightClickable
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
}
|
}
|
||||||
P(ImGui::Checkbox(_("Damp"),&ins->multipcm.damp));
|
P(ImGui::Checkbox(_("Damp"),&ins->multipcm.damp));
|
||||||
|
|
Loading…
Reference in a new issue