mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-28 07:23:01 +00:00
GUI: implement "clear all subsongs"
This commit is contained in:
parent
b8a4fdb4c6
commit
c4614bff30
3 changed files with 14 additions and 4 deletions
|
@ -813,6 +813,16 @@ bool DivEngine::removeSubSong(int index) {
|
|||
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) {
|
||||
int chanCount=chans;
|
||||
quitDispatch();
|
||||
|
|
|
@ -821,6 +821,9 @@ class DivEngine {
|
|||
// remove subsong
|
||||
bool removeSubSong(int index);
|
||||
|
||||
// clear all subsong data
|
||||
void clearSubSongs();
|
||||
|
||||
// change system
|
||||
void changeSystem(int index, DivSystem which, bool preserveOrder=true);
|
||||
|
||||
|
|
|
@ -3494,10 +3494,7 @@ bool FurnaceGUI::loop() {
|
|||
case GUI_WARN_CLEAR:
|
||||
if (ImGui::Button("All subsongs")) {
|
||||
stop();
|
||||
//e->lockEngine([this]() {
|
||||
//e->curSubSong->clearData();
|
||||
//});
|
||||
e->setOrder(0);
|
||||
e->clearSubSongs();
|
||||
curOrder=0;
|
||||
oldOrder=0;
|
||||
oldOrder1=0;
|
||||
|
|
Loading…
Reference in a new issue