Support properties in GME backend

This commit is contained in:
Zachary Hall 2025-01-25 10:48:02 -08:00
parent a90da8fa95
commit 49ea484034
2 changed files with 5 additions and 1 deletions

View file

@ -43,7 +43,7 @@ std::optional<int> GmeBackend::get_voice_id(std::string path) {
bool GmeBackend::set(std::string path, google::protobuf::Any value) {
auto maybe_voice_id = get_voice_id(path);
if (maybe_voice_id.has_value()) {
bool enable = resolve_any<bool>(value);
bool enable = resolve_value<bool>(value);
gme_mute_voice(gme_backend, maybe_voice_id.value(), !enable);
properties[path] = value;
return true;

View file

@ -19,6 +19,7 @@ class GmeBackend : public PlaybackBackend {
int streamidx;
int loop_len, loop_start;
std::map<std::string, int> voices;
std::optional<int> get_voice_id(std::string path);
public:
uint64_t get_min_samples() override;
std::optional<uint64_t> get_max_samples() override;
@ -30,6 +31,9 @@ class GmeBackend : public PlaybackBackend {
}
void add_licenses() override;
std::vector<Property> get_property_list() override;
bool set(std::string path, google::protobuf::Any value) override;
std::optional<google::protobuf::Any> get(std::string path) override;
std::optional<google::protobuf::Any> reset(std::string path) override;
void seek_samples(uint64_t position) override;
void load(const char *filename) override;
void switch_stream(int idx) override;