a couple mobile improvements

comment section in sub-songs
background play option!
This commit is contained in:
tildearrow 2024-10-22 16:38:57 -05:00
parent 48aa3b438f
commit c20a839871
4 changed files with 26 additions and 8 deletions

View file

@ -1995,6 +1995,7 @@ class FurnaceGUI {
int backupMaxCopies;
int autoFillSave;
int autoMacroStepSize;
int backgroundPlay;
unsigned int maxUndoSteps;
float vibrationStrength;
int vibrationLength;
@ -2254,6 +2255,7 @@ class FurnaceGUI {
backupMaxCopies(5),
autoFillSave(0),
autoMacroStepSize(0),
backgroundPlay(0),
maxUndoSteps(100),
vibrationStrength(0.5f),
vibrationLength(20),

View file

@ -1260,6 +1260,16 @@ void FurnaceGUI::drawSettings() {
settingsChanged=true;
}
#ifdef ANDROID
// SUBSECTION ANDROID
CONFIG_SUBSECTION(_("Android"));
bool backgroundPlayB=settings.backgroundPlay;
if (ImGui::Checkbox(_("Enable background playback (restart!)"),&backgroundPlayB)) {
settings.backgroundPlay=backgroundPlayB;
settingsChanged=true;
}
#endif
END_SECTION;
}
CONFIG_SECTION(_("Audio")) {
@ -4850,6 +4860,8 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
settings.autoFillSave=conf.getInt("autoFillSave",0);
settings.locale=conf.getString("locale","");
settings.backgroundPlay=conf.getInt("backgroundPlay",0);
}
if (groups&GUI_SETTINGS_AUDIO) {
@ -5371,6 +5383,7 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
clampSetting(settings.autoFillSave,0,1);
clampSetting(settings.autoMacroStepSize,0,2);
clampSetting(settings.s3mOPL3,0,1);
clampSetting(settings.backgroundPlay,0,1);
if (settings.exportLoops<0.0) settings.exportLoops=0.0;
if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0;
@ -5453,6 +5466,8 @@ void FurnaceGUI::writeConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
conf.set("autoFillSave",settings.autoFillSave);
conf.set("locale",settings.locale);
conf.set("backgroundPlay",settings.backgroundPlay);
}
// audio

View file

@ -132,7 +132,7 @@ void FurnaceGUI::drawSubSongs(bool asChild) {
MARK_MODIFIED;
}
if (!asChild && ImGui::GetContentRegionAvail().y>(10.0f*dpiScale)) {
if (ImGui::GetContentRegionAvail().y>(10.0f*dpiScale)) {
if (ImGui::InputTextMultiline("##SubSongNotes",&e->curSubSong->notes,ImGui::GetContentRegionAvail(),ImGuiInputTextFlags_UndoRedo)) {
MARK_MODIFIED;
}

View file

@ -510,13 +510,6 @@ static void handleTermGUI(int) {
// TODO: CoInitializeEx on Windows?
// TODO: add crash log
int main(int argc, char** argv) {
// uncomment these if you want Furnace to play in the background on Android.
// not recommended. it lags.
#if defined(HAVE_SDL2) && defined(ANDROID)
//SDL_SetHint(SDL_HINT_ANDROID_BLOCK_ON_PAUSE,"0");
//SDL_SetHint(SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO,"0");
#endif
// Windows console thing - thanks dj.tuBIG/MaliceX
#ifdef _WIN32
#ifndef TA_SUBSYSTEM_CONSOLE
@ -751,6 +744,14 @@ int main(int argc, char** argv) {
e.setAudio(DIV_AUDIO_DUMMY);
}
#if defined(HAVE_SDL2) && defined(ANDROID)
if (e.getConfInt("backgroundPlay",0)!=0) {
SDL_SetHint(SDL_HINT_ANDROID_BLOCK_ON_PAUSE,"0");
SDL_SetHint(SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO,"0");
}
#endif
if (!fileName.empty() && ((!e.getConfBool("tutIntroPlayed",TUT_INTRO_PLAYED)) || e.getConfInt("alwaysPlayIntro",0)!=3 || consoleMode || benchMode || infoMode || outName!="" || vgmOutName!="" || cmdOutName!="")) {
logI("loading module...");
FILE* f=ps_fopen(fileName.c_str(),"rb");