2024-09-29 17:29:10 +03:00
|
|
|
#include "ui_prefs.hpp"
|
|
|
|
|
|
|
|
KotoUiPreferences::KotoUiPreferences(std::optional<toml::value> v) {
|
2024-10-02 17:51:51 +03:00
|
|
|
this->i_albumInfoShowDescription = true;
|
|
|
|
this->i_albumInfoShowGenre = true;
|
|
|
|
this->i_albumInfoShowNarrator = true;
|
|
|
|
this->i_albumInfoShowYear = true;
|
|
|
|
this->i_lastUsedVolume = 0.5;
|
|
|
|
|
|
|
|
// No UI prefs provided
|
|
|
|
if (!v.has_value()) return;
|
|
|
|
toml::value& uiPrefs = v.value();
|
|
|
|
this->i_albumInfoShowDescription = toml::find_or<bool>(uiPrefs, "album_info_show_description", false);
|
|
|
|
this->i_albumInfoShowGenre = toml::find_or<bool>(uiPrefs, "album_info_show_genre", false);
|
|
|
|
this->i_albumInfoShowNarrator = toml::find_or<bool>(uiPrefs, "album_info_show_narrator", false);
|
|
|
|
this->i_albumInfoShowYear = toml::find_or<bool>(uiPrefs, "album_info_show_year", false);
|
|
|
|
this->i_lastUsedVolume = toml::find_or<float>(uiPrefs, "last_used_volume", 0.5);
|
2024-09-29 17:29:10 +03:00
|
|
|
}
|
|
|
|
|
2024-10-02 17:51:51 +03:00
|
|
|
KotoUiPreferences::~KotoUiPreferences() {}
|
|
|
|
|
2024-09-29 17:29:10 +03:00
|
|
|
bool KotoUiPreferences::getAlbumInfoShowDescription() {
|
2024-10-02 17:51:51 +03:00
|
|
|
return this->i_albumInfoShowDescription;
|
2024-09-29 17:29:10 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool KotoUiPreferences::getAlbumInfoShowGenre() {
|
2024-10-02 17:51:51 +03:00
|
|
|
return this->i_albumInfoShowGenre;
|
2024-09-29 17:29:10 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool KotoUiPreferences::getAlbumInfoShowNarrator() {
|
2024-10-02 17:51:51 +03:00
|
|
|
return this->i_albumInfoShowNarrator;
|
2024-09-29 17:29:10 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool KotoUiPreferences::getAlbumInfoShowYear() {
|
2024-10-02 17:51:51 +03:00
|
|
|
return this->i_albumInfoShowYear;
|
2024-09-29 17:29:10 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
float KotoUiPreferences::getLastUsedVolume() {
|
2024-10-02 17:51:51 +03:00
|
|
|
return this->i_lastUsedVolume;
|
2024-09-29 17:29:10 +03:00
|
|
|
}
|