Zrythm
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
11#ifndef __GUI_WIDGETS_PLUGIN_BROWSER_H__
12#define __GUI_WIDGETS_PLUGIN_BROWSER_H__
13
14#include "plugins/plugin.h"
15#include "utils/symap.h"
16
17#include <gtk/gtk.h>
18
19#define PLUGIN_BROWSER_WIDGET_TYPE (plugin_browser_widget_get_type ())
20G_DECLARE_FINAL_TYPE (
22 plugin_browser_widget,
23 Z,
24 PLUGIN_BROWSER_WIDGET,
25 GtkWidget);
26
27TYPEDEF_STRUCT_UNDERSCORED (ExpanderBoxWidget);
28TYPEDEF_STRUCT (PluginCollection);
29TYPEDEF_STRUCT (ItemFactory);
30
37#define MW_PLUGIN_BROWSER MW_RIGHT_DOCK_EDGE->plugin_browser
38
39typedef enum
40{
41 PLUGIN_BROWSER_TAB_COLLECTION,
42 PLUGIN_BROWSER_TAB_AUTHOR,
43 PLUGIN_BROWSER_TAB_CATEGORY,
44 PLUGIN_BROWSER_TAB_PROTOCOL,
45} PluginBrowserTab;
46
47typedef enum
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} PluginBrowserFilter;
55
56typedef enum
57{
58 PLUGIN_BROWSER_SORT_ALPHA,
59 PLUGIN_BROWSER_SORT_LAST_USED,
60 PLUGIN_BROWSER_SORT_MOST_USED,
61} PluginBrowserSortStyle;
62
70typedef 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
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
127
130
133
137
139 GtkCustomFilter * plugin_filter;
140 GtkFilterListModel * plugin_filter_model;
141 GtkCustomSorter * plugin_sorter;
142 GtkSortListModel * plugin_sort_model;
143
145 GPtrArray * item_factories;
146
156 int first_time_position_set;
157 gint64 first_time_position_set_time;
158
161
164
166 GtkPopoverMenu * popover_menu;
168
174
175void
176plugin_browser_widget_refresh_collections (PluginBrowserWidget * self);
177
182#endif
PluginBrowserWidget * plugin_browser_widget_new(void)
Instantiates a new PluginBrowserWidget.
Base plugin.
Item factory for column views.
The plugin browser allows to browse and filter available Plugin's on the system.
int start_saving_pos
A little hack to get the paned position to get set from the gsettings when first created.
GPtrArray * item_factories
Array of ItemFactory.
GArray * selected_authors
Symbol IDs (for quick comparison) of selected authors.
AdwViewStack * stack
The stack containing collection/category/ protocol.
GPtrArray * selected_collections
Pointers to the collections (PluginCollection instances) from PluginManager.collections that must not...
GtkPopoverMenu * popover_menu
Popover to be reused for context menus.
GArray * selected_categories
Selected categories (ZPluginCategory).
char * current_search
Current search string.
AdwViewSwitcher * stack_switcher
The stack switcher.
GtkCustomFilter * plugin_filter
List view -> selection model -> filter model.
GtkBox * browser_bot
Browser bot.
GtkLabel * plugin_author_label
A label to show info about the currently selected Plugin.
GArray * selected_protocols
Selected protocols (ZPluginProtocol).
Symap * symap
Symbol map for string interning.
Plugin collection used in the plugin browser.
Definition collection.h:28
Definition symap.h:36
API for Symap, a basic symbol map (string interner).