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 "utils/types.h"
14
15#include <adwaita.h>
16#include <gtk/gtk.h>
17
18#include <zix/sem.h>
19
20#define ZRYTHM_APP_TYPE (zrythm_app_get_type ())
21G_DECLARE_FINAL_TYPE (ZrythmApp, zrythm_app, ZRYTHM, APP, GtkApplication)
22
23#define ZRYTHM_APP_IS_GTK_THREAD \
24 (zrythm_app && zrythm_app->gtk_thread == g_thread_self ())
25
26TYPEDEF_STRUCT_UNDERSCORED (MainWindowWidget);
27TYPEDEF_STRUCT_UNDERSCORED (BugReportDialogWidget);
28TYPEDEF_STRUCT_UNDERSCORED (GreeterWidget);
29TYPEDEF_STRUCT (Zrythm);
30TYPEDEF_STRUCT (UiCaches);
31
41typedef struct ZrythmAppUiMessage
42{
43 GtkMessageType type;
44 char * msg;
46
48zrythm_app_ui_message_new (GtkMessageType type, const char * msg);
49
50void
51zrythm_app_ui_message_free (ZrythmAppUiMessage * self);
52
60{
61 GtkApplication parent;
62
67 GtkSettings * default_settings;
68
71
78 GThread * gtk_thread;
79
80 UiCaches * ui_caches;
81
85
88
95
96 bool have_svg_loader;
97
101
105
108
112
115 /* FIXME delete this. it does the same thing as
116 * the queue below */
117 char * startup_errors[24];
118 int num_startup_errors;
119
122
125
127 int argc;
128 char ** argv;
129
132
136
142
144 BugReportDialogWidget * bug_report_dialog;
145
146 guint project_autosave_source_id;
147};
148
152extern ZrythmApp * zrythm_app;
153
159ZrythmApp *
160zrythm_app_new (int argc, const char ** argv);
161
162void
163zrythm_app_set_font_scale (ZrythmApp * self, double font_scale);
164
169void
171
178int
180
184ZrythmApp **
186
192bool
194
195void *
196zrythm_app_init_thread (ZrythmApp * self);
197
203void
204zrythm_app_install_action_accel (
205 ZrythmApp * self,
206 const char * primary,
207 const char * secondary,
208 const char * action_name);
209
213char *
214zrythm_app_get_primary_accel_for_action (
215 ZrythmApp * self,
216 const char * action_name);
217
221void
222zrythm_exit_response_callback (AdwDialog * dialog, gpointer user_data);
223
228#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:48
Caches.
Definition ui.h:149
UI message for the message queue.
Definition zrythm_app.h:42
To be used throughout the program.
Definition zrythm.h:188
The global struct.
Definition zrythm_app.h:60
char * startup_errors[24]
Messages to show when the main window is shown.
Definition zrythm_app.h:117
bool is_first_run
True if this is the first time Zrythm is runh.
Definition zrythm_app.h:94
char * midi_backend
MIDI backend passed with –audio-backend=, if any.
Definition zrythm_app.h:104
GtkSettings * default_settings
Default settings (got from gtk_settings_get_default()).
Definition zrythm_app.h:67
char * appimage_runtime_path
AppImage runtime path, if AppImage build.
Definition zrythm_app.h:131
GThread * gtk_thread
The GTK thread where the main GUI loop runs.
Definition zrythm_app.h:78
int buf_size
Buffer size passed with –buf-size=, if any.
Definition zrythm_app.h:107
char * output_file
Output file passed with –output.
Definition zrythm_app.h:121
bool rt_priority_message_shown
Flag used to only show the RT priority message once.
Definition zrythm_app.h:135
GAsyncQueue * project_load_message_queue
Queue for messages to be shown when the project loads.
Definition zrythm_app.h:141
bool pretty_print
Whether to pretty-print.
Definition zrythm_app.h:124
GreeterWidget * greeter
Greeter screen.
Definition zrythm_app.h:87
bool init_finished
Flag to set when initialization has finished.
Definition zrythm_app.h:84
BugReportDialogWidget * bug_report_dialog
Currently opened bug report dialog.
Definition zrythm_app.h:144
MainWindowWidget * main_window
Main window.
Definition zrythm_app.h:70
int argc
CLI args.
Definition zrythm_app.h:127
int samplerate
Samplerate passed with –samplerate=, if any.
Definition zrythm_app.h:111
char * audio_backend
Audio backend passed with –audio-backend=, if any.
Definition zrythm_app.h:100
Custom types.