8#include "utils/monotonic_time_provider.h"
9#include "utils/networking.h"
11#include "utils/types.h"
12#include "utils/version.h"
14#include <QtQmlIntegration/QtQmlIntegration>
16#include <juce_core/juce_core.h>
31#define MAX_RECENT_PROJECTS 20
32#define DEBUGGING (Q_UNLIKELY (gZrythm && gZrythm->debug_))
33#define ZRYTHM_BENCHMARKING (gZrythm && gZrythm->benchmarking_)
34#define ZRYTHM_GENERATING_PROJECT (gZrythm->generating_project_)
35#define ZRYTHM_HAVE_UI (gZrythm && gZrythm->have_ui_)
36#define ZRYTHM_BREAK_ON_ERROR (gZrythm && gZrythm->break_on_error_)
38#define ZRYTHM_USE_OPTIMIZED_DSP (Q_LIKELY (gZrythm->use_optimized_dsp_))
49 Q_PROPERTY (QString version READ getVersion CONSTANT FINAL)
63 std::optional<std::filesystem::path> exe_path,
69 QString getVersion ()
const {
return get_version (
false).to_qstring (); }
97 networking::URL::GetContentsAsyncCallback callback);
216 JUCE_DECLARE_SINGLETON_SINGLETHREADED (Zrythm,
false)
218 JUCE_HEAVYWEIGHT_LEAK_DETECTOR (Zrythm)
223#define gZrythm (::zrythm::Zrythm::getInstanceWithoutCreating ())
Chord preset pack manager.
A string interner (Symbol Map).
Lightweight UTF-8 string wrapper with safe conversions.
static bool is_latest_release(const char *remote_latest_release)
Returns whether the given release string is the latest release.
std::unique_ptr< DspContextRAII > lsp_dsp_context_
LSP DSP context for the main thread.
static bool is_release(bool official)
Returns whether the current Zrythm version is a release version.
void init_user_dirs_and_files()
Initializes/creates the default dirs/files in the user directory.
bool use_optimized_dsp_
Whether to use optimized DSP when available.
bool debug_
In debug mode or not (determined by GSetting).
bool use_pipewire_in_tests_
Whether to use pipewire in tests.
bool open_newer_backup_
Whether to open a newer backup if found.
ProcessId pipewire_pid_
Process ID for pipewire (used in tests).
bool break_on_error_
Whether to abort() on an error log message.
int undo_stack_len_
Undo stack length, used during tests.
bool creating_project_
Whether creating a new project, either from a template or blank.
std::unique_ptr< Settings > settings_
Application settings.
static void fetch_latest_release_ver_async(networking::URL::GetContentsAsyncCallback callback)
std::filesystem::path open_filename_
Filename to open passed through the command line.
static void get_version_with_capabilities(char *buf, bool include_system_info)
Returns the version and the capabilities.
Symap symap_
String interner for internal things.
bool benchmarking_
Whether currently running under the benchmarker.
static utils::Utf8String get_system_info()
Returns system info (mainly used for bug reports).
void pre_init(std::optional< std::filesystem::path > exe_path, bool have_ui, bool optimized_dsp)
Called before init().
std::unique_ptr< ChordPresetPackManager > chord_preset_pack_manager_
Chord preset pack manager.
static utils::Utf8String get_version(bool with_v)
Returns the version string.
static utils::Version get_app_version()
Returns the application version as a Version struct.
bool generating_project_
Whether this is a dummy instance used when generating projects.
std::filesystem::path exe_path_
argv[0].
std::filesystem::path create_project_path_
Path to create a project in, including its title.
bool opening_template_
Whether the open file is a template to be used to create a new project from.
bool have_ui_
1 if Zrythm has a UI, 0 if headless (eg, when unit-testing).
qint64 ProcessId
GPid equivalent.
Represents a semantic version with major, minor, and optional patch.
API for Symap, a basic symbol map (string interner).