We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac62ad8 commit 3b2ad7bCopy full SHA for 3b2ad7b
include/libremidi/configurations.hpp
@@ -68,4 +68,21 @@ LIBREMIDI_EXPORT
68
libremidi::API midi_api(const output_api_configuration& conf);
69
LIBREMIDI_EXPORT
70
libremidi::API midi_api(const observer_api_configuration& conf);
71
+
72
+void set_client_name(auto&& conf, std::string name)
73
+{
74
+ std::visit([&](auto& impl) {
75
+ if constexpr (requires { impl.client_name; })
76
+ impl.client_name = std::move(name);
77
+ }, conf);
78
+}
79
80
+std::optional<std::string> client_name(const auto& conf) noexcept
81
82
+ return std::visit([&](auto& impl) -> std::optional<std::string> {
83
84
+ return impl.client_name;
85
+ return std::nullopt;
86
87
88
}
0 commit comments