Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
active_hardware_mb.h
1// SPDX-FileCopyrightText: © 2019-2021, 2024 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#ifndef __GUI_WIDGETS_ACTIVE_HARDWARE_MB_H__
5#define __GUI_WIDGETS_ACTIVE_HARDWARE_MB_H__
6
7#include "common/utils/types.h"
8#include "gui/backend/gtk_widgets/gtk_wrapper.h"
9
10#define ACTIVE_HARDWARE_MB_WIDGET_TYPE (active_hardware_mb_widget_get_type ())
11G_DECLARE_FINAL_TYPE (
13 active_hardware_mb_widget,
14 Z,
15 ACTIVE_HARDWARE_MB_WIDGET,
16 GtkWidget)
17
18
23
24TYPEDEF_STRUCT_UNDERSCORED (ActiveHardwarePopoverWidget);
25
30using ActiveHardwareMbWidget = struct _ActiveHardwareMbWidget
31{
32 GtkWidget parent_instance;
33
35 GtkMenuButton * mbutton;
36
37 // GtkBox * box;
38
40 // GtkImage * img;
41
43 // GtkLabel * label;
44
47
49 bool is_midi;
50
52 bool input;
53
55 GSettings * settings;
56
58 const char * key;
59
61 GtkBox * content;
62
63 GenericCallback callback;
64};
65
66void
67active_hardware_mb_widget_setup (
69 bool is_input,
70 bool is_midi,
71 GSettings * settings,
72 const char * key);
73
78void
80
81void
82active_hardware_mb_widget_refresh (ActiveHardwareMbWidget * self);
83
85active_hardware_mb_widget_new (void);
86
90
91#endif
std::function< void()> GenericCallback
Generic callback.
Definition types.h:112
struct _ActiveHardwareMbWidget { GtkWidget parent_instance; GtkMenuButton *mbutton; ActiveHardwarePopoverWidget *popover; bool is_midi; bool input; GSettings *settings; const char *key; GtkBox *content; GenericCallback callback;} ActiveHardwareMbWidget
A menu button that allows selecting active hardware ports.
void active_hardware_mb_widget_save_settings(ActiveHardwareMbWidget *self)
Called from PreferencesWidget to save the settings.