Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
plugin_browser.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2019-2023 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-FileCopyrightText: © 2024 Miró Allard <miro.allard@pm.me>
3// SPDX-License-Identifier: LicenseRef-ZrythmLicense
4
10
11#ifndef __GUI_WIDGETS_PLUGIN_BROWSER_H__
12#define __GUI_WIDGETS_PLUGIN_BROWSER_H__
13
14#include "common/plugins/collections.h"
15#include "common/plugins/plugin.h"
16#include "common/utils/symap.h"
17#include "gui/backend/gtk_widgets/gtk_wrapper.h"
18#include "gui/backend/gtk_widgets/item_factory.h"
19
20#define PLUGIN_BROWSER_WIDGET_TYPE (plugin_browser_widget_get_type ())
21G_DECLARE_FINAL_TYPE (
23 plugin_browser_widget,
24 Z,
25 PLUGIN_BROWSER_WIDGET,
26 GtkWidget);
27
28TYPEDEF_STRUCT_UNDERSCORED (ExpanderBoxWidget);
29class ItemFactory;
30
36
37#define MW_PLUGIN_BROWSER MW_RIGHT_DOCK_EDGE->plugin_browser
38
39enum class PluginBrowserTab
40{
41 PLUGIN_BROWSER_TAB_COLLECTION,
42 PLUGIN_BROWSER_TAB_AUTHOR,
43 PLUGIN_BROWSER_TAB_CATEGORY,
44 PLUGIN_BROWSER_TAB_PROTOCOL,
45};
46
47enum class PluginBrowserFilter
48{
49 PLUGIN_BROWSER_FILTER_NONE,
50 PLUGIN_BROWSER_FILTER_INSTRUMENT,
51 PLUGIN_BROWSER_FILTER_EFFECT,
52 PLUGIN_BROWSER_FILTER_MODULATOR,
53 PLUGIN_BROWSER_FILTER_MIDI_EFFECT,
54};
55
56enum class PluginBrowserSortStyle
57{
58 PLUGIN_BROWSER_SORT_ALPHA,
59 PLUGIN_BROWSER_SORT_LAST_USED,
60 PLUGIN_BROWSER_SORT_MOST_USED,
61};
62
70using PluginBrowserWidget = struct _PluginBrowserWidget
71{
72 GtkWidget parent_instance;
73
74 GtkPaned * paned;
75
77 AdwViewSwitcher * stack_switcher;
78 GtkBox * stack_switcher_box;
79
82 AdwViewStack * stack;
83
84 /* The stack pages for each list view */
85 GtkBox * collection_box;
86 GtkBox * author_box;
87 GtkBox * category_box;
88 GtkBox * protocol_box;
89 GtkScrolledWindow * plugin_scroll;
90
91 /* The tree views */
92 GtkListView * collection_list_view;
93 GtkListView * author_list_view;
94 GtkListView * category_list_view;
95 GtkListView * protocol_list_view;
96
97 GtkSearchEntry * plugin_search_entry;
98 GtkListView * plugin_list_view;
99
101 GtkBox * browser_bot;
102
103 /* The toolbar to toggle visibility of
104 * modulators/effects/instruments/midi modifiers */
105 GtkBox * plugin_toolbar;
106
107 GtkToggleButton * toggle_instruments;
108 GtkToggleButton * toggle_effects;
109 GtkToggleButton * toggle_modulators;
110 GtkToggleButton * toggle_midi_modifiers;
111
112 GtkToggleButton * alpha_sort_btn;
113 GtkToggleButton * last_used_sort_btn;
114 GtkToggleButton * most_used_sort_btn;
115
118 GtkLabel * plugin_author_label;
119 GtkLabel * plugin_type_label;
120 GtkLabel * plugin_audio_label;
121 GtkLabel * plugin_midi_label;
122 GtkLabel * plugin_ctrl_label;
123 GtkLabel * plugin_cv_label;
124
126 std::vector<uint32_t> selected_authors;
127
129 std::vector<zrythm::plugins::ZPluginCategory> selected_categories;
130
132 std::vector<zrythm::plugins::PluginProtocol> selected_protocols;
133
136 std::vector<zrythm::plugins::PluginCollection *> selected_collections;
137
139 GtkCustomFilter * plugin_filter;
140 GtkFilterListModel * plugin_filter_model;
141 GtkCustomSorter * plugin_sorter;
142 GtkSortListModel * plugin_sort_model;
143
145 ItemFactoryPtrVector item_factories;
146
155 int start_saving_pos;
156 int first_time_position_set;
157 gint64 first_time_position_set_time;
158
160 char * current_search;
161
163 Symap * symap;
164
166 GtkPopoverMenu * popover_menu;
167};
168
174
175void
176plugin_browser_widget_refresh_collections (PluginBrowserWidget * self);
177
181
182#endif
Item factory for column views.
A string interner (Symbol Map).
Definition symap.h:46
struct _PluginBrowserWidget { GtkWidget parent_instance; GtkPaned *paned; AdwViewSwitcher *stack_switcher; GtkBox * stack_switcher_box; AdwViewStack *stack; GtkBox * collection_box; GtkBox * author_box; GtkBox * category_box; GtkBox * protocol_box; GtkScrolledWindow *plugin_scroll; GtkListView *collection_list_view; GtkListView *author_list_view; GtkListView *category_list_view; GtkListView *protocol_list_view; GtkSearchEntry *plugin_search_entry; GtkListView * plugin_list_view; GtkBox *browser_bot; GtkBox *plugin_toolbar; GtkToggleButton *toggle_instruments; GtkToggleButton *toggle_effects; GtkToggleButton *toggle_modulators; GtkToggleButton *toggle_midi_modifiers; GtkToggleButton *alpha_sort_btn; GtkToggleButton *last_used_sort_btn; GtkToggleButton *most_used_sort_btn; GtkLabel *plugin_author_label; GtkLabel *plugin_type_label; GtkLabel *plugin_audio_label; GtkLabel *plugin_midi_label; GtkLabel *plugin_ctrl_label; GtkLabel *plugin_cv_label; std::vector< uint32_t > selected_authors; std::vector< zrythm::plugins::ZPluginCategory > selected_categories; std::vector< zrythm::plugins::PluginProtocol > selected_protocols; std::vector< zrythm::plugins::PluginCollection * > selected_collections; GtkCustomFilter * plugin_filter; GtkFilterListModel *plugin_filter_model; GtkCustomSorter * plugin_sorter; GtkSortListModel * plugin_sort_model; ItemFactoryPtrVector item_factories; int start_saving_pos; int first_time_position_set; gint64 first_time_position_set_time; char *current_search; Symap *symap; GtkPopoverMenu *popover_menu;} PluginBrowserWidget
The plugin browser allows to browse and filter available Plugin's on the system.
PluginBrowserWidget * plugin_browser_widget_new(void)
Instantiates a new PluginBrowserWidget.