remove hasSampleInsHeader()
- it is only used by MultiPCM - an alternative approach is in place
This commit is contained in:
parent
c1b7a06a37
commit
3a06e7b963
7 changed files with 21 additions and 92 deletions
|
|
@ -1861,13 +1861,7 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) {
|
|||
int sampleCountBefore=e->song.sampleLen;
|
||||
std::vector<DivInstrument*> instruments=e->instrumentFromFile(path,false);
|
||||
if (!instruments.empty()) {
|
||||
int hasSampleIns=false;
|
||||
for (int s=0; s<e->song.systemLen; s++) {
|
||||
if (e->getDispatch(s)->hasSampleInsHeader()) {
|
||||
hasSampleIns=true;
|
||||
}
|
||||
}
|
||||
if ((e->song.sampleLen!=sampleCountBefore) || hasSampleIns) {
|
||||
if (e->song.sampleLen!=sampleCountBefore) {
|
||||
e->renderSamplesP();
|
||||
}
|
||||
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()) {
|
||||
*e->song.ins[prevIns]=*instruments[0];
|
||||
e->notifyInsChange(prevIns);
|
||||
}
|
||||
} else {
|
||||
e->loadTempIns(instruments[0]);
|
||||
|
|
@ -3934,13 +3929,7 @@ bool FurnaceGUI::loop() {
|
|||
DivWavetable* droppedWave=NULL;
|
||||
//DivSample* droppedSample=NULL;
|
||||
if (!instruments.empty()) {
|
||||
bool hasSampleIns=false;
|
||||
for (int s=0; s<e->song.systemLen; s++) {
|
||||
if (e->getDispatch(s)->hasSampleInsHeader()) {
|
||||
hasSampleIns=true;
|
||||
}
|
||||
}
|
||||
if ((e->song.sampleLen!=sampleCountBefore) || hasSampleIns) {
|
||||
if (e->song.sampleLen!=sampleCountBefore) {
|
||||
e->renderSamplesP();
|
||||
}
|
||||
if (!e->getWarnings().empty()) {
|
||||
|
|
@ -5062,6 +5051,7 @@ bool FurnaceGUI::loop() {
|
|||
if (prevInsData!=NULL) {
|
||||
if (prevIns>=0 && prevIns<(int)e->song.ins.size()) {
|
||||
*e->song.ins[prevIns]=*prevInsData;
|
||||
e->notifyInsChange(prevIns);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -5533,13 +5523,7 @@ bool FurnaceGUI::loop() {
|
|||
instruments.push_back(j);
|
||||
}
|
||||
}
|
||||
bool hasSampleIns=false;
|
||||
for (int s=0; s<e->song.systemLen; s++) {
|
||||
if (e->getDispatch(s)->hasSampleInsHeader()) {
|
||||
hasSampleIns=true;
|
||||
}
|
||||
}
|
||||
if ((e->song.sampleLen!=sampleCountBefore) || hasSampleIns) {
|
||||
if (e->song.sampleLen!=sampleCountBefore) {
|
||||
e->renderSamplesP();
|
||||
}
|
||||
if (warn) {
|
||||
|
|
@ -5579,13 +5563,7 @@ bool FurnaceGUI::loop() {
|
|||
int sampleCountBefore=e->song.sampleLen;
|
||||
std::vector<DivInstrument*> instruments=e->instrumentFromFile(copyOfName.c_str(),true,settings.readInsNames);
|
||||
if (!instruments.empty()) {
|
||||
bool hasSampleIns=false;
|
||||
for (int s=0; s<e->song.systemLen; s++) {
|
||||
if (e->getDispatch(s)->hasSampleInsHeader()) {
|
||||
hasSampleIns=true;
|
||||
}
|
||||
}
|
||||
if ((e->song.sampleLen!=sampleCountBefore) || hasSampleIns) {
|
||||
if (e->song.sampleLen!=sampleCountBefore) {
|
||||
e->renderSamplesP();
|
||||
}
|
||||
if (!e->getWarnings().empty()) {
|
||||
|
|
@ -5603,6 +5581,7 @@ bool FurnaceGUI::loop() {
|
|||
// reset macro zoom
|
||||
memset(e->song.ins[curIns]->temp.vZoom,-1,sizeof(e->song.ins[curIns]->temp.vZoom));
|
||||
MARK_MODIFIED;
|
||||
e->notifyInsChange(curIns);
|
||||
} else {
|
||||
showError(_("...but you haven't selected an instrument!"));
|
||||
}
|
||||
|
|
@ -6816,6 +6795,7 @@ bool FurnaceGUI::loop() {
|
|||
*e->song.ins[curIns]=*i.first;
|
||||
// reset macro zoom
|
||||
memset(e->song.ins[curIns]->temp.vZoom,-1,sizeof(e->song.ins[curIns]->temp.vZoom));
|
||||
e->notifyInsChange(curIns);
|
||||
} else {
|
||||
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; \
|
||||
}
|
||||
|
||||
// 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 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) {
|
||||
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);
|
||||
if (ImGui::Selectable(id.c_str(),ins->amiga.initSample==i)) { PARAMETER
|
||||
ins->amiga.initSample=i;
|
||||
REFRESH_INSTRUMENTS
|
||||
}
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
|
|
@ -6780,7 +6752,6 @@ void FurnaceGUI::drawInsEdit() {
|
|||
|
||||
// reset macro zoom
|
||||
memset(ins->temp.vZoom,-1,sizeof(ins->temp.vZoom));
|
||||
REFRESH_INSTRUMENTS
|
||||
}
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
|
|
@ -7917,17 +7888,17 @@ void FurnaceGUI::drawInsEdit() {
|
|||
|
||||
ImGui::TableNextRow();
|
||||
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();
|
||||
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();
|
||||
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();
|
||||
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();
|
||||
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();
|
||||
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();
|
||||
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();
|
||||
|
|
@ -7937,11 +7908,11 @@ void FurnaceGUI::drawInsEdit() {
|
|||
ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthStretch,0.0);
|
||||
ImGui::TableSetupColumn("c2",ImGuiTableColumnFlags_WidthStretch,0.0);
|
||||
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();
|
||||
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();
|
||||
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();
|
||||
}
|
||||
P(ImGui::Checkbox(_("Damp"),&ins->multipcm.damp));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue