OXYGENHUB
◆ main openmsx / src / imgui / ImGuiSoundChip.hh
942 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
e8555c89 Andy McCall 1
#ifndef IMGUI_SOUND_CHIP_HH
2
#define IMGUI_SOUND_CHIP_HH
3
4
#include "ImGuiPart.hh"
5
6
#include <map>
7
#include <string>
8
9
namespace openmsx {
10
11
class ImGuiSoundChip final : public ImGuiPart
12
{
13
public:
14
	using ImGuiPart::ImGuiPart;
15
16
	[[nodiscard]] zstring_view iniName() const override { return "sound chip settings"; }
17
	void save(ImGuiTextBuffer& buf) override;
18
	void loadLine(std::string_view name, zstring_view value) override;
19
	void paint(MSXMotherBoard* motherBoard) override;
20
21
private:
22
	void showChipSettings(MSXMotherBoard& motherBoard);
23
	void showChannelSettings(MSXMotherBoard& motherBoard, const std::string& name, bool* enabled);
24
25
private:
26
	std::map<std::string, bool, std::less<>> channels;
27
public:
28
	bool showSoundChipSettings = false;
29
30
	static constexpr auto persistentElements = std::tuple{
31
		PersistentElement{"show", &ImGuiSoundChip::showSoundChipSettings}
32
		// manually handle "showChannels.xxx"
33
	};
34
};
35
36
} // namespace openmsx
37
38
#endif