settings.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. #include <stdint.h>
  2. #include <stdbool.h>
  3. #include <switch/services/ncm_types.h>
  4. #include "ui/settings.h"
  5. #include "util/log.h"
  6. #include "sound/sound.h"
  7. /*
  8. * Install Flags.
  9. */
  10. SettingFlag g_install_base = SettingFlag_On;
  11. SettingFlag g_install_upp = SettingFlag_On;
  12. SettingFlag g_install_dlc = SettingFlag_On;
  13. SettingsInstallLocation g_install_base_location = SettingsInstallLocation_Default;
  14. SettingsInstallLocation g_install_upp_location = SettingsInstallLocation_Default;
  15. SettingsInstallLocation g_install_dlc_location = SettingsInstallLocation_Default;
  16. SettingFlag g_overwrite_newer_version = SettingFlag_Off;
  17. SettingFlag g_install_lower_key_gen = SettingFlag_Off;
  18. SettingFlag g_install_standard_crypto = SettingFlag_Off;
  19. SettingFlag g_install_backlight = SettingFlag_On;
  20. /*
  21. * Sound Flags.
  22. */
  23. SettingFlag g_sounds_sound = SettingFlag_On;
  24. SettingFlag g_sounds_music = SettingFlag_On;
  25. /*
  26. * Install Getters.
  27. */
  28. SettingFlag setting_get_install_base(void)
  29. {
  30. return g_install_base;
  31. }
  32. SettingFlag setting_get_install_upp(void)
  33. {
  34. return g_install_upp;
  35. }
  36. SettingFlag setting_get_install_dlc(void)
  37. {
  38. return g_install_dlc;
  39. }
  40. SettingsInstallLocation setting_get_install_base_location(void)
  41. {
  42. return g_install_base_location;
  43. }
  44. SettingsInstallLocation setting_get_install_upp_location(void)
  45. {
  46. return g_install_upp_location;
  47. }
  48. SettingsInstallLocation setting_get_install_dlc_location(void)
  49. {
  50. return g_install_dlc_location;
  51. }
  52. SettingFlag setting_get_overwrite_newer_version(void)
  53. {
  54. return g_overwrite_newer_version;
  55. }
  56. SettingFlag setting_get_install_lower_key_gen(void)
  57. {
  58. return g_install_lower_key_gen;
  59. }
  60. SettingFlag setting_get_install_standard_crypto(void)
  61. {
  62. return g_install_standard_crypto;
  63. }
  64. SettingFlag setting_get_install_backlight(void)
  65. {
  66. return g_install_backlight;
  67. }
  68. /*
  69. * Install Setters.
  70. */
  71. void setting_set_install_base(SettingFlag flag)
  72. {
  73. g_install_base = flag;
  74. }
  75. void setting_set_install_upp(SettingFlag flag)
  76. {
  77. g_install_upp = flag;
  78. }
  79. void setting_set_install_dlc(SettingFlag flag)
  80. {
  81. g_install_dlc = flag;
  82. }
  83. void setting_set_install_base_location(SettingsInstallLocation location)
  84. {
  85. g_install_base_location = location;
  86. }
  87. void setting_set_install_upp_location(SettingsInstallLocation location)
  88. {
  89. g_install_upp_location = location;
  90. }
  91. void setting_set_install_dlc_location(SettingsInstallLocation location)
  92. {
  93. g_install_dlc_location = location;
  94. }
  95. void setting_set_overwrite_newer_version(SettingFlag flag)
  96. {
  97. g_overwrite_newer_version = flag;
  98. }
  99. void setting_set_install_lower_key_gen(SettingFlag flag)
  100. {
  101. g_install_lower_key_gen = flag;
  102. }
  103. void setting_set_install_standard_crypto(SettingFlag flag)
  104. {
  105. g_install_standard_crypto = flag;
  106. }
  107. void setting_set_install_backlight(SettingFlag flag)
  108. {
  109. g_install_backlight = flag;
  110. }
  111. /*
  112. * Sound Getters.
  113. */
  114. SettingFlag setting_get_sound(void)
  115. {
  116. return g_sounds_sound;
  117. }
  118. SettingFlag setting_get_music(void)
  119. {
  120. return g_sounds_music;
  121. }
  122. /*
  123. * Sound Setters.
  124. */
  125. void setting_set_sound(SettingFlag flag)
  126. {
  127. pause_resume_sound();
  128. g_sounds_sound = flag;
  129. }
  130. void setting_set_music(SettingFlag flag)
  131. {
  132. pause_resume_song();
  133. g_sounds_music = flag;
  134. }