Line data Source code
1 : #pragma once
2 :
3 : #include <string>
4 : #include <vector>
5 :
6 : namespace Amplitron {
7 :
8 : class IAudioEngine;
9 : class IMidiManager;
10 : struct PresetData;
11 : struct MidiMapping;
12 :
13 : /**
14 : * @brief Abstract interface for the Preset Manager.
15 : * Satisfies the Dependency Inversion Principle (DIP).
16 : */
17 126 : class IPresetManager {
18 : public:
19 378 : virtual ~IPresetManager() = default;
20 :
21 : virtual bool save_preset_data(const std::string& filepath, const PresetData& preset) = 0;
22 : virtual bool save_preset(const std::string& filepath, const std::string& preset_name,
23 : const std::string& description, IAudioEngine& engine,
24 : const std::vector<MidiMapping>& midi_mappings = {}) = 0;
25 : virtual bool load_preset(const std::string& filepath, IAudioEngine& engine,
26 : IMidiManager* midi_manager = nullptr) = 0;
27 : virtual std::vector<std::string> list_presets() = 0;
28 : virtual bool delete_preset(const std::string& filepath) = 0;
29 : virtual std::string get_last_error() const = 0;
30 : virtual std::string get_presets_directory() const = 0;
31 : };
32 :
33 : } // namespace Amplitron
|