vibrator settings
This commit is contained in:
parent
cb1f268335
commit
9affcc7fc2
2 changed files with 23 additions and 1 deletions
|
|
@ -56,7 +56,7 @@
|
||||||
// for now
|
// for now
|
||||||
#define NOTIFY_LONG_HOLD \
|
#define NOTIFY_LONG_HOLD \
|
||||||
if (vibrator && vibratorAvailable) { \
|
if (vibrator && vibratorAvailable) { \
|
||||||
if (SDL_HapticRumblePlay(vibrator,0.5f,20)!=0) { \
|
if (SDL_HapticRumblePlay(vibrator,settings.vibrationStrength,settings.vibrationLength)!=0) { \
|
||||||
logV("could not vibrate: %s!",SDL_GetError()); \
|
logV("could not vibrate: %s!",SDL_GetError()); \
|
||||||
} \
|
} \
|
||||||
} else { \
|
} else { \
|
||||||
|
|
@ -1823,6 +1823,8 @@ class FurnaceGUI {
|
||||||
int vsync;
|
int vsync;
|
||||||
int frameRateLimit;
|
int frameRateLimit;
|
||||||
unsigned int maxUndoSteps;
|
unsigned int maxUndoSteps;
|
||||||
|
float vibrationStrength;
|
||||||
|
int vibrationLength;
|
||||||
String mainFontPath;
|
String mainFontPath;
|
||||||
String headFontPath;
|
String headFontPath;
|
||||||
String patFontPath;
|
String patFontPath;
|
||||||
|
|
@ -2054,6 +2056,8 @@ class FurnaceGUI {
|
||||||
vsync(1),
|
vsync(1),
|
||||||
frameRateLimit(60),
|
frameRateLimit(60),
|
||||||
maxUndoSteps(100),
|
maxUndoSteps(100),
|
||||||
|
vibrationStrength(0.5f),
|
||||||
|
vibrationLength(100),
|
||||||
mainFontPath(""),
|
mainFontPath(""),
|
||||||
headFontPath(""),
|
headFontPath(""),
|
||||||
patFontPath(""),
|
patFontPath(""),
|
||||||
|
|
|
||||||
|
|
@ -530,6 +530,16 @@ void FurnaceGUI::drawSettings() {
|
||||||
}
|
}
|
||||||
ImGui::Unindent();
|
ImGui::Unindent();
|
||||||
|
|
||||||
|
#ifdef IS_MOBILE
|
||||||
|
// SUBSECTION HAPTIC
|
||||||
|
CONFIG_SUBSECTION("Vibration");
|
||||||
|
|
||||||
|
ImGui::Indent();
|
||||||
|
if (ImGui::SliderFloat("Strength",&settings.vibrationStrength,0.0f,1.0f)) settingsChanged=true;
|
||||||
|
if (ImGui::SliderInt("Length",&settings.vibrationLength,50,500)) settingsChanged=true;
|
||||||
|
ImGui::Unindent();
|
||||||
|
#endif
|
||||||
|
|
||||||
// SUBSECTION FILE
|
// SUBSECTION FILE
|
||||||
CONFIG_SUBSECTION("File");
|
CONFIG_SUBSECTION("File");
|
||||||
|
|
||||||
|
|
@ -4015,6 +4025,9 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
|
||||||
settings.newSongBehavior=conf.getInt("newSongBehavior",0);
|
settings.newSongBehavior=conf.getInt("newSongBehavior",0);
|
||||||
settings.playOnLoad=conf.getInt("playOnLoad",0);
|
settings.playOnLoad=conf.getInt("playOnLoad",0);
|
||||||
settings.centerPopup=conf.getInt("centerPopup",1);
|
settings.centerPopup=conf.getInt("centerPopup",1);
|
||||||
|
|
||||||
|
settings.vibrationStrength=conf.getFloat("vibrationStrength",0.5f);
|
||||||
|
settings.vibrationLength=conf.getInt("vibrationLength",100);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (groups&GUI_SETTINGS_AUDIO) {
|
if (groups&GUI_SETTINGS_AUDIO) {
|
||||||
|
|
@ -4485,6 +4498,8 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
|
||||||
clampSetting(settings.cursorWheelStep,0,1);
|
clampSetting(settings.cursorWheelStep,0,1);
|
||||||
clampSetting(settings.vsync,0,4);
|
clampSetting(settings.vsync,0,4);
|
||||||
clampSetting(settings.frameRateLimit,0,1000);
|
clampSetting(settings.frameRateLimit,0,1000);
|
||||||
|
clampSetting(settings.vibrationStrength,0.0f,1.0f);
|
||||||
|
clampSetting(settings.vibrationLength,50,500);
|
||||||
|
|
||||||
if (settings.exportLoops<0.0) settings.exportLoops=0.0;
|
if (settings.exportLoops<0.0) settings.exportLoops=0.0;
|
||||||
if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0;
|
if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0;
|
||||||
|
|
@ -4546,6 +4561,9 @@ void FurnaceGUI::writeConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
|
||||||
conf.set("newSongBehavior",settings.newSongBehavior);
|
conf.set("newSongBehavior",settings.newSongBehavior);
|
||||||
conf.set("playOnLoad",settings.playOnLoad);
|
conf.set("playOnLoad",settings.playOnLoad);
|
||||||
conf.set("centerPopup",settings.centerPopup);
|
conf.set("centerPopup",settings.centerPopup);
|
||||||
|
|
||||||
|
conf.set("vibrationStrength",settings.vibrationStrength);
|
||||||
|
conf.set("vibrationLength",settings.vibrationLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
// audio
|
// audio
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue