Zrythm v2.0.0-alpha.1
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
in_memory_settings_backend.h
1// SPDX-FileCopyrightText: © 2026 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "utils/isettings_backend.h"
7
8#include <QHash>
9#include <QString>
10#include <QVariant>
11
12namespace zrythm::test_helpers
13{
14
17{
18public:
19 QVariant
20 value (QAnyStringView key, const QVariant &defaultValue) const override
21 {
22 auto it = values_.find (key.toString ());
23 return it != values_.end () ? *it : defaultValue;
24 }
25
26 void setValue (QAnyStringView key, const QVariant &val) override
27 {
28 values_[key.toString ()] = val;
29 }
30
31private:
32 QHash<QString, QVariant> values_;
33};
34
35} // namespace zrythm::test_helpers
Simple in-memory ISettingsBackend that stores values in a hash map.
Interface for an app settings provider.