Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
ZrythmApp Class Referencefinal

The Zrythm GTK application. More...

#include <src/gui/backend/gtk_widgets/zrythm_app.h>

Inheritance diagram for ZrythmApp:
Collaboration diagram for ZrythmApp:

Public Member Functions

 ZrythmApp (int argc, const char **argv)
 Creates the application.
void set_font_scale (double font_scale)
void check_for_updates ()
 Handles the logic for checking for updates on startup.
int prompt_for_project_func ()
 Unlike the init thread, this will run in the main GTK thread.
bool check_and_show_trial_limit_error ()
 Shows the trial limitation error message.
void init_recent_projects ()
 Initializes the array of recent projects in Zrythm app.
void install_action_accel (const std::string &primary, const std::string &secondary, const std::string &action_name)
 Install accelerator for an action.
std::string get_primary_accel_for_action (const std::string &action_name)
 Get the primary accelerator for an action.
void on_plugin_scan_finished ()

Static Public Member Functions

static void exit_response_callback (AdwDialog *dialog, gpointer user_data)
 To be used to exit Zrythm using the "response" signal on a message dialog.

Data Fields

Glib::RefPtr< Gtk::Settings > default_settings_
 Default settings (got from gtk_settings_get_default()).
MainWindowWidgetmain_window_ = nullptr
 Main window.
unsigned int gtk_thread_id_ = std::numeric_limits<unsigned int>::max ()
 The GTK thread where the main GUI loop runs.
std::unique_ptr< UiCaches > ui_caches_
bool init_finished_ = false
 Flag to set when initialization has finished.
GreeterWidgetgreeter_ = nullptr
 Greeter screen.
bool is_first_run_ = false
 True if this is the first time Zrythm is runh.
bool have_svg_loader_ = false
std::string audio_backend_
 Audio backend passed with –audio-backend=, if any.
std::string midi_backend_
 MIDI backend passed with –audio-backend=, if any.
int buf_size_ = 0
 Buffer size passed with –buf-size=, if any.
int samplerate_ = 0
 Samplerate passed with –samplerate=, if any.
std::queue< std::string > startup_error_queue_
 Messages to show when the main window is shown.
std::mutex startup_error_queue_mutex_
std::string output_file_
 Output file passed with –output.
bool pretty_print_ = false
 Whether to pretty-print.
int argc_ = 0
 CLI args.
char ** argv_ = nullptr
std::string appimage_runtime_path_
 AppImage runtime path, if AppImage build.
bool rt_priority_message_shown_ = false
 Flag used to only show the RT priority message once.
std::queue< ZrythmAppUiMessageproject_load_message_queue_
 Queue for messages to be shown when the project loads.
std::mutex queue_mutex_
BugReportDialogWidget * bug_report_dialog_ = nullptr
 Currently opened bug report dialog.
std::unique_ptr< ProjectInitFlowManagerproject_init_flow_mgr_
guint project_autosave_source_id_ = 0

Protected Member Functions

void on_startup () override
 First function that gets called afted CLI args are parsed and processed.
void on_activate () override
void on_open (const Gio::Application::type_vec_files &files, const Glib::ustring &hint) override
 Called when a filename is passed to the command line instead of activate.
void on_shutdown () override
 Called immediately after the main GTK loop terminates.

Detailed Description

The Zrythm GTK application.

Contains data that is only relevant to the GUI or command line.

Definition at line 49 of file zrythm_app.h.

Constructor & Destructor Documentation

◆ ZrythmApp()

ZrythmApp::ZrythmApp ( int argc,
const char ** argv )

Creates the application.

This also initializes the Zrythm class.

Parameters
argc
argv

Member Function Documentation

◆ check_and_show_trial_limit_error()

bool ZrythmApp::check_and_show_trial_limit_error ( )

Shows the trial limitation error message.

Returns
Whether the limit was reached.

◆ on_open()

void ZrythmApp::on_open ( const Gio::Application::type_vec_files & files,
const Glib::ustring & hint )
overrideprotected

Called when a filename is passed to the command line instead of activate.

Always gets called after startup and before the tasks.

◆ on_shutdown()

void ZrythmApp::on_shutdown ( )
overrideprotected

Called immediately after the main GTK loop terminates.

This is also called manually on SIGINT.

◆ on_startup()

void ZrythmApp::on_startup ( )
overrideprotected

First function that gets called afted CLI args are parsed and processed.

This gets called before open or activate.

◆ prompt_for_project_func()

int ZrythmApp::prompt_for_project_func ( )

Unlike the init thread, this will run in the main GTK thread.

Do not put expensive logic here.

This should be ran after the expensive initialization has finished.

Field Documentation

◆ appimage_runtime_path_

std::string ZrythmApp::appimage_runtime_path_

AppImage runtime path, if AppImage build.

Definition at line 246 of file zrythm_app.h.

◆ argc_

int ZrythmApp::argc_ = 0

CLI args.

Definition at line 242 of file zrythm_app.h.

◆ argv_

char** ZrythmApp::argv_ = nullptr

Definition at line 243 of file zrythm_app.h.

◆ audio_backend_

std::string ZrythmApp::audio_backend_

Audio backend passed with –audio-backend=, if any.

Definition at line 219 of file zrythm_app.h.

◆ buf_size_

int ZrythmApp::buf_size_ = 0

Buffer size passed with –buf-size=, if any.

Definition at line 226 of file zrythm_app.h.

◆ bug_report_dialog_

BugReportDialogWidget* ZrythmApp::bug_report_dialog_ = nullptr

Currently opened bug report dialog.

Definition at line 258 of file zrythm_app.h.

◆ default_settings_

Glib::RefPtr<Gtk::Settings> ZrythmApp::default_settings_

Default settings (got from gtk_settings_get_default()).

Definition at line 187 of file zrythm_app.h.

◆ greeter_

GreeterWidget* ZrythmApp::greeter_ = nullptr

Greeter screen.

Definition at line 206 of file zrythm_app.h.

◆ gtk_thread_id_

unsigned int ZrythmApp::gtk_thread_id_ = std::numeric_limits<unsigned int>::max ()

The GTK thread where the main GUI loop runs.

This is stored for identification purposes in other threads.

Definition at line 198 of file zrythm_app.h.

◆ have_svg_loader_

bool ZrythmApp::have_svg_loader_ = false

Definition at line 215 of file zrythm_app.h.

◆ init_finished_

bool ZrythmApp::init_finished_ = false

Flag to set when initialization has finished.

Definition at line 203 of file zrythm_app.h.

◆ is_first_run_

bool ZrythmApp::is_first_run_ = false

True if this is the first time Zrythm is runh.

This remains true even after setting the corresponding GSettings value.

Definition at line 213 of file zrythm_app.h.

◆ main_window_

MainWindowWidget* ZrythmApp::main_window_ = nullptr

Main window.

Definition at line 190 of file zrythm_app.h.

◆ midi_backend_

std::string ZrythmApp::midi_backend_

MIDI backend passed with –audio-backend=, if any.

Definition at line 223 of file zrythm_app.h.

◆ output_file_

std::string ZrythmApp::output_file_

Output file passed with –output.

Definition at line 236 of file zrythm_app.h.

◆ pretty_print_

bool ZrythmApp::pretty_print_ = false

Whether to pretty-print.

Definition at line 239 of file zrythm_app.h.

◆ project_autosave_source_id_

guint ZrythmApp::project_autosave_source_id_ = 0

Definition at line 262 of file zrythm_app.h.

◆ project_init_flow_mgr_

std::unique_ptr<ProjectInitFlowManager> ZrythmApp::project_init_flow_mgr_

Definition at line 260 of file zrythm_app.h.

◆ project_load_message_queue_

std::queue<ZrythmAppUiMessage> ZrythmApp::project_load_message_queue_

Queue for messages to be shown when the project loads.

Definition at line 254 of file zrythm_app.h.

◆ queue_mutex_

std::mutex ZrythmApp::queue_mutex_

Definition at line 255 of file zrythm_app.h.

◆ rt_priority_message_shown_

bool ZrythmApp::rt_priority_message_shown_ = false

Flag used to only show the RT priority message once.

Definition at line 249 of file zrythm_app.h.

◆ samplerate_

int ZrythmApp::samplerate_ = 0

Samplerate passed with –samplerate=, if any.

Definition at line 229 of file zrythm_app.h.

◆ startup_error_queue_

std::queue<std::string> ZrythmApp::startup_error_queue_

Messages to show when the main window is shown.

Definition at line 232 of file zrythm_app.h.

◆ startup_error_queue_mutex_

std::mutex ZrythmApp::startup_error_queue_mutex_

Definition at line 233 of file zrythm_app.h.

◆ ui_caches_

std::unique_ptr<UiCaches> ZrythmApp::ui_caches_

Definition at line 200 of file zrythm_app.h.


The documentation for this class was generated from the following file: