GUI: implement "clear all subsongs"
This commit is contained in:
parent
b8a4fdb4c6
commit
c4614bff30
|
@ -813,6 +813,16 @@ bool DivEngine::removeSubSong(int index) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DivEngine::clearSubSongs() {
|
||||||
|
BUSY_BEGIN;
|
||||||
|
saveLock.lock();
|
||||||
|
song.clearSongData();
|
||||||
|
changeSong(0);
|
||||||
|
curOrder=0;
|
||||||
|
saveLock.unlock();
|
||||||
|
BUSY_END;
|
||||||
|
}
|
||||||
|
|
||||||
void DivEngine::changeSystem(int index, DivSystem which, bool preserveOrder) {
|
void DivEngine::changeSystem(int index, DivSystem which, bool preserveOrder) {
|
||||||
int chanCount=chans;
|
int chanCount=chans;
|
||||||
quitDispatch();
|
quitDispatch();
|
||||||
|
|
|
@ -821,6 +821,9 @@ class DivEngine {
|
||||||
// remove subsong
|
// remove subsong
|
||||||
bool removeSubSong(int index);
|
bool removeSubSong(int index);
|
||||||
|
|
||||||
|
// clear all subsong data
|
||||||
|
void clearSubSongs();
|
||||||
|
|
||||||
// change system
|
// change system
|
||||||
void changeSystem(int index, DivSystem which, bool preserveOrder=true);
|
void changeSystem(int index, DivSystem which, bool preserveOrder=true);
|
||||||
|
|
||||||
|
|
|
@ -3494,10 +3494,7 @@ bool FurnaceGUI::loop() {
|
||||||
case GUI_WARN_CLEAR:
|
case GUI_WARN_CLEAR:
|
||||||
if (ImGui::Button("All subsongs")) {
|
if (ImGui::Button("All subsongs")) {
|
||||||
stop();
|
stop();
|
||||||
//e->lockEngine([this]() {
|
e->clearSubSongs();
|
||||||
//e->curSubSong->clearData();
|
|
||||||
//});
|
|
||||||
e->setOrder(0);
|
|
||||||
curOrder=0;
|
curOrder=0;
|
||||||
oldOrder=0;
|
oldOrder=0;
|
||||||
oldOrder1=0;
|
oldOrder1=0;
|
||||||
|
|
Loading…
Reference in a new issue