13#include "../audio/audio.hpp"
14#include "../l10n/l10n.hpp"
15#include "../macros.hpp"
23hi_export_module(hikogui.widgets.audio_device_widget);
25hi_export
namespace hi {
inline namespace v1 {
46 _grid_widget = std::make_unique<grid_widget>(
this);
49 _sync_device_list_task = sync_device_list();
53 [[nodiscard]] generator<widget_intf&> children(
bool include_invisible)
noexcept override
55 co_yield *_grid_widget;
58 [[nodiscard]] box_constraints update_constraints() noexcept
override
61 _grid_constraints = _grid_widget->update_constraints();
62 return _grid_constraints;
65 void set_layout(widget_layout
const& context)
noexcept override
68 auto const grid_rectangle = context.rectangle();
69 _grid_shape = {_grid_constraints, grid_rectangle, theme().baseline_adjustment()};
75 void draw(draw_context
const& context)
noexcept override
78 _grid_widget->draw(context);
82 hitbox hitbox_test(point2 position)
const noexcept override
86 r = _grid_widget->hitbox_test_from_parent(position, r);
93 [[nodiscard]]
bool accepts_keyboard_focus(keyboard_focus_group group)
const noexcept override
96 return _grid_widget->accepts_keyboard_focus(group);
106 box_constraints _grid_constraints;
107 box_shape _grid_shape;
111 selection_widget *_device_selection_widget =
nullptr;
113 observer<std::vector<std::pair<std::string, label>>> _device_list;
115 hi::scoped_task<> _sync_device_list_task;
117 [[nodiscard]] hi::scoped_task<> sync_device_list() noexcept
121 auto proxy = _device_list.
get();
124 proxy->emplace_back(device.id(), device.label());
Defines selection_widget.
@ partial
A widget is partially enabled.
@ invisible
The widget is invisible.
The HikoGUI namespace.
Definition array_generic.hpp:20
bool compare_store(T &lhs, U &&rhs) noexcept
Compare then store if there was a change.
Definition misc.hpp:53
generator< audio_device & > audio_devices(Filters &&...filters) noexcept
Get audio devices matching the filter arguments.
Definition audio_system.hpp:101
@ level
The child widget stays at the same elevation and layer.
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
auto when_any(Args const &...args)
await on a set of objects which can be converted to an awaitable.
Definition when_any.hpp:173
static audio_system & global() noexcept
Create an audio system object specific for the current operating system.
Definition audio_system_win32.hpp:230
Definition widget_intf.hpp:24
widget_intf * parent
Pointer to the parent widget.
Definition widget_intf.hpp:35
A observer pointing to the whole or part of a observed_base.
Definition observer_intf.hpp:32
Audio device configuration widget.
Definition audio_device_widget.hpp:30
observer< audio_direction > direction
The audio direction (input or output) of devices is should show.
Definition audio_device_widget.hpp:40
observer< std::string > device_id
The audio device this widget has selected and is configuring.
Definition audio_device_widget.hpp:36
A graphical control element that allows the user to choose only one of a predefined set of mutually e...
Definition selection_widget.hpp:48
An interactive graphical object as part of the user-interface.
Definition widget.hpp:37
widget() noexcept
Constructor for creating sub views.
Definition widget.hpp:55