30 std::optional<std::string>
get_string(std::string_view key)
const;
31 void set_string(std::string_view key, std::string_view value);
34 std::optional<int64_t>
get_int(std::string_view key)
const;
35 void set_int(std::string_view key, int64_t value);
38 std::optional<double>
get_double(std::string_view key)
const;
42 std::optional<bool>
get_bool(std::string_view key)
const;
43 void set_bool(std::string_view key,
bool value);
55 int size()
const {
return static_cast<int>(values_.size()); }
58 std::vector<std::string>
keys()
const;
61 const std::string&
path()
const {
return path_; }
62 void set_path(std::string_view p) { path_ = std::string(p); }
65 bool save_to(
const std::string& dest)
const;
66 std::map<std::string, std::string, std::less<>> values_;
92 const std::string&
app_name()
const {
return app_name_; }
101 std::string app_name_;
const PropertiesFile & user_settings() const
Definition properties_file.hpp:79
static std::string common_settings_dir(std::string_view app_name)
Platform-specific common settings directory.
PropertiesFile & common_settings()
Common/shared settings (e.g., /Library/Application Support/AppName/settings.json).
Definition properties_file.hpp:82
const std::string & app_name() const
Application name.
Definition properties_file.hpp:92
const PropertiesFile & common_settings() const
Definition properties_file.hpp:83
static std::string user_settings_dir(std::string_view app_name)
Platform-specific user settings directory.
PropertiesFile & user_settings()
User-specific settings (e.g., ~/Library/Preferences/AppName.json on macOS).
Definition properties_file.hpp:78
ApplicationProperties(std::string_view app_name)
Initialize with application name (determines storage path).
void save()
Save both settings files.
void load()
Load both user and common settings from their platform paths.
JSON-backed persistent settings file.
Definition properties_file.hpp:16
std::optional< int64_t > get_int(std::string_view key) const
Get/set integer properties.
int size() const
Number of properties.
Definition properties_file.hpp:55
bool load(std::string_view path)
Load properties from a JSON file. Returns false if file doesn't exist or is invalid.
bool save(std::string_view path)
Save properties to a JSON file. Stores the path for subsequent save() calls.
bool contains(std::string_view key) const
Whether a key exists.
void clear()
Clear all properties.
void set_int(std::string_view key, int64_t value)
void set_string(std::string_view key, std::string_view value)
void remove(std::string_view key)
Remove a property.
void set_bool(std::string_view key, bool value)
const std::string & path() const
The file path (set after load or explicit set).
Definition properties_file.hpp:61
void set_path(std::string_view p)
Definition properties_file.hpp:62
std::optional< double > get_double(std::string_view key) const
Get/set float properties.
std::optional< std::string > get_string(std::string_view key) const
Get/set string properties.
std::vector< std::string > keys() const
Get all keys.
bool save() const
Save to the path it was loaded from (or last saved to).
void set_double(std::string_view key, double value)
std::optional< bool > get_bool(std::string_view key) const
Get/set boolean properties.
SequencerStateChannel is the audio-safe transport for a plugin's structured NON-parameter state: the ...
Definition audio_device_manager.hpp:48