Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm_app.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2019-2024 Alexandros Theodotou <alex@zrythm.org>
2/* SPDX-License-Identifier: LicenseRef-ZrythmLicense */
3
10#ifndef __ZRYTHM_APP_H__
11#define __ZRYTHM_APP_H__
12
13#include "zrythm-config.h"
14
15#include <memory>
16
17#include "utils/types.h"
18
19#include <adwaita.h>
20
21#include "gtk_wrapper.h"
22#include <zix/sem.h>
23
24#define ZRYTHM_APP_TYPE (zrythm_app_get_type ())
25G_DECLARE_FINAL_TYPE (ZrythmApp, zrythm_app, ZRYTHM, APP, GtkApplication)
26
27#define ZRYTHM_APP_IS_GTK_THREAD \
28 (zrythm_app && zrythm_app->gtk_thread == g_thread_self ())
29
30TYPEDEF_STRUCT_UNDERSCORED (MainWindowWidget);
31TYPEDEF_STRUCT_UNDERSCORED (BugReportDialogWidget);
32TYPEDEF_STRUCT_UNDERSCORED (GreeterWidget);
33TYPEDEF_STRUCT (UiCaches);
35
45typedef struct ZrythmAppUiMessage
46{
47 GtkMessageType type;
48 char * msg;
50
52zrythm_app_ui_message_new (GtkMessageType type, const char * msg);
53
54void
55zrythm_app_ui_message_free (ZrythmAppUiMessage * self);
56
64{
65 GtkApplication parent;
66
71 GtkSettings * default_settings;
72
75
82 GThread * gtk_thread;
83
84 UiCaches * ui_caches;
85
89
92
99
100 bool have_svg_loader;
101
105
109
112
116
119 /* FIXME delete this. it does the same thing as
120 * the queue below */
121 char * startup_errors[24];
122 int num_startup_errors;
123
126
129
131 int argc;
132 char ** argv;
133
136
140
146
148 BugReportDialogWidget * bug_report_dialog;
149
150 guint project_autosave_source_id;
151};
152
156extern ZrythmApp * zrythm_app;
157
163ZrythmApp *
164zrythm_app_new (int argc, const char ** argv);
165
166void
167zrythm_app_set_font_scale (ZrythmApp * self, double font_scale);
168
173void
175
182int
184
188ZrythmApp **
190
196bool
198
199void *
200zrythm_app_init_thread (ZrythmApp * self);
201
207void
208zrythm_app_install_action_accel (
209 ZrythmApp * self,
210 const char * primary,
211 const char * secondary,
212 const char * action_name);
213
217char *
218zrythm_app_get_primary_accel_for_action (
219 ZrythmApp * self,
220 const char * action_name);
221
225void
226zrythm_exit_response_callback (AdwDialog * dialog, gpointer user_data);
227
232#endif /* __ZRYTHM_APP_H__ */
ZrythmApp ** zrythm_app_get(void)
Returns a pointer to the global zrythm_app.
void zrythm_app_check_for_updates(ZrythmApp *self)
Handles the logic for checking for updates on startup.
ZrythmApp * zrythm_app_new(int argc, const char **argv)
Creates the Zrythm GApplication.
int zrythm_app_prompt_for_project_func(ZrythmApp *self)
Unlike the init thread, this will run in the main GTK thread.
bool zrythm_app_check_and_show_trial_limit_error(ZrythmApp *self)
Shows the trial limitation error message.
void zrythm_exit_response_callback(AdwDialog *dialog, gpointer user_data)
To be used to exit Zrythm using the "response" signal on a message dialog.
ZrythmApp * zrythm_app
Global variable, should be available to all files.
This widget handles the UI part of the initialization of Zrythm and presents a project selector when ...
Definition greeter.h:46
The main window of Zrythm.
Definition main_window.h:49
Caches.
Definition ui.h:148
UI message for the message queue.
Definition zrythm_app.h:46
The global struct.
Definition zrythm_app.h:64
char * startup_errors[24]
Messages to show when the main window is shown.
Definition zrythm_app.h:121
bool is_first_run
True if this is the first time Zrythm is runh.
Definition zrythm_app.h:98
char * midi_backend
MIDI backend passed with –audio-backend=, if any.
Definition zrythm_app.h:108
GtkSettings * default_settings
Default settings (got from gtk_settings_get_default()).
Definition zrythm_app.h:71
char * appimage_runtime_path
AppImage runtime path, if AppImage build.
Definition zrythm_app.h:135
GThread * gtk_thread
The GTK thread where the main GUI loop runs.
Definition zrythm_app.h:82
int buf_size
Buffer size passed with –buf-size=, if any.
Definition zrythm_app.h:111
char * output_file
Output file passed with –output.
Definition zrythm_app.h:125
bool rt_priority_message_shown
Flag used to only show the RT priority message once.
Definition zrythm_app.h:139
GAsyncQueue * project_load_message_queue
Queue for messages to be shown when the project loads.
Definition zrythm_app.h:145
bool pretty_print
Whether to pretty-print.
Definition zrythm_app.h:128
GreeterWidget * greeter
Greeter screen.
Definition zrythm_app.h:91
bool init_finished
Flag to set when initialization has finished.
Definition zrythm_app.h:88
BugReportDialogWidget * bug_report_dialog
Currently opened bug report dialog.
Definition zrythm_app.h:148
MainWindowWidget * main_window
Main window.
Definition zrythm_app.h:74
int argc
CLI args.
Definition zrythm_app.h:131
int samplerate
Samplerate passed with –samplerate=, if any.
Definition zrythm_app.h:115
char * audio_backend
Audio backend passed with –audio-backend=, if any.
Definition zrythm_app.h:104
Custom types.