openMSX
VideoSourceSetting.hh
Go to the documentation of this file.
1#ifndef VIDEOSOURCESETTING_HH
2#define VIDEOSOURCESETTING_HH
3
4#include "Setting.hh"
5#include <vector>
6
7namespace openmsx {
8
9class VideoSourceSetting final : public Setting
10{
11public:
12 explicit VideoSourceSetting(CommandController& commandController);
13
14 [[nodiscard]] std::string_view getTypeString() const override;
15 void additionalInfo(TclObject& result) const override;
16 void tabCompletion(std::vector<std::string>& tokens) const override;
17
18 [[nodiscard]] int registerVideoSource(const std::string& source);
19 void unregisterVideoSource(int source);
20 [[nodiscard]] int getSource() noexcept;
21 void setSource(int id);
22 [[nodiscard]] std::vector<std::string_view> getPossibleValues() const;
23
24private:
25 void checkSetValue(std::string_view value) const;
26 [[nodiscard]] bool has(int value) const;
27 [[nodiscard]] int has(std::string_view value) const;
28
29private:
30 struct Source {
31 Source(std::string n, int i)
32 : name(std::move(n)), id(i) {} // clang-15 workaround
33
34 std::string name;
35 int id;
36 };
37 std::vector<Source> sources; // unordered
38};
39
41{
42public:
43 VideoSourceActivator(VideoSourceSetting& setting, const std::string& name);
49
50 [[nodiscard]] int getID() const { return id; }
51
52private:
54 int id;
55};
56
57} // namespace openmsx
58
59#endif
BaseSetting * setting
uintptr_t id
VideoSourceActivator(VideoSourceActivator &&)=delete
VideoSourceActivator(const VideoSourceActivator &)=delete
VideoSourceActivator & operator=(const VideoSourceActivator &)=delete
VideoSourceActivator & operator=(VideoSourceActivator &&)=delete
void tabCompletion(std::vector< std::string > &tokens) const override
Complete a partly typed value.
void additionalInfo(TclObject &result) const override
Helper method for info().
std::string_view getTypeString() const override
Returns a string describing the setting type (integer, string, ..) Could be used in a GUI to pick an ...
int registerVideoSource(const std::string &source)
std::vector< std::string_view > getPossibleValues() const
This file implemented 3 utility functions:
Definition Autofire.cc:11