mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-24 05:25:12 +00:00
GUI: add clone instrument/wave
This commit is contained in:
parent
fe757ac6e7
commit
464714df00
2 changed files with 33 additions and 8 deletions
|
@ -364,6 +364,9 @@ class DivEngine {
|
||||||
// add instrument
|
// add instrument
|
||||||
int addInstrument(int refChan=0);
|
int addInstrument(int refChan=0);
|
||||||
|
|
||||||
|
// add instrument from file
|
||||||
|
int addInstrumentFromFile(const char* path);
|
||||||
|
|
||||||
// delete instrument
|
// delete instrument
|
||||||
void delInstrument(int index);
|
void delInstrument(int index);
|
||||||
|
|
||||||
|
|
|
@ -527,6 +527,15 @@ void FurnaceGUI::drawInsList() {
|
||||||
modified=true;
|
modified=true;
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
if (ImGui::Button(ICON_FA_FILES_O "##InsClone")) {
|
||||||
|
if (curIns>=0 && curIns<(int)e->song.ins.size()) {
|
||||||
|
int prevIns=curIns;
|
||||||
|
curIns=e->addInstrument(cursor.xCoarse);
|
||||||
|
(*e->song.ins[curIns])=(*e->song.ins[prevIns]);
|
||||||
|
modified=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui::SameLine();
|
||||||
if (ImGui::ArrowButton("InsUp",ImGuiDir_Up)) {
|
if (ImGui::ArrowButton("InsUp",ImGuiDir_Up)) {
|
||||||
if (e->moveInsUp(curIns)) curIns--;
|
if (e->moveInsUp(curIns)) curIns--;
|
||||||
}
|
}
|
||||||
|
@ -536,10 +545,12 @@ void FurnaceGUI::drawInsList() {
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button(ICON_FA_TIMES "##InsDelete")) {
|
if (ImGui::Button(ICON_FA_TIMES "##InsDelete")) {
|
||||||
e->delInstrument(curIns);
|
if (curIns>=0 && curIns<(int)e->song.ins.size()) {
|
||||||
modified=true;
|
e->delInstrument(curIns);
|
||||||
if (curIns>=(int)e->song.ins.size()) {
|
modified=true;
|
||||||
curIns--;
|
if (curIns>=(int)e->song.ins.size()) {
|
||||||
|
curIns--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
@ -1084,6 +1095,15 @@ void FurnaceGUI::drawWaveList() {
|
||||||
modified=true;
|
modified=true;
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
if (ImGui::Button(ICON_FA_FILES_O "##WaveClone")) {
|
||||||
|
if (curWave>=0 && curWave<(int)e->song.wave.size()) {
|
||||||
|
int prevWave=curWave;
|
||||||
|
curWave=e->addWave();
|
||||||
|
(*e->song.wave[curWave])=(*e->song.wave[prevWave]);
|
||||||
|
modified=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui::SameLine();
|
||||||
if (ImGui::ArrowButton("WaveUp",ImGuiDir_Up)) {
|
if (ImGui::ArrowButton("WaveUp",ImGuiDir_Up)) {
|
||||||
if (e->moveWaveUp(curWave)) curWave--;
|
if (e->moveWaveUp(curWave)) curWave--;
|
||||||
}
|
}
|
||||||
|
@ -1093,10 +1113,12 @@ void FurnaceGUI::drawWaveList() {
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button(ICON_FA_TIMES "##WaveDelete")) {
|
if (ImGui::Button(ICON_FA_TIMES "##WaveDelete")) {
|
||||||
e->delWave(curWave);
|
if (curWave>=0 && curWave<(int)e->song.wave.size()) {
|
||||||
modified=true;
|
e->delWave(curWave);
|
||||||
if (curWave>=(int)e->song.wave.size()) {
|
modified=true;
|
||||||
curWave--;
|
if (curWave>=(int)e->song.wave.size()) {
|
||||||
|
curWave--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
Loading…
Reference in a new issue