Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
global_state.h
1// SPDX-FileCopyrightText: © 2024-2025 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "gui/backend/backend/zrythm.h"
7#include "gui/backend/zrythm_application.h"
8
9class GlobalState : public QObject
10{
11 Q_OBJECT
12 QML_ELEMENT
13 QML_SINGLETON
14public:
15 Q_PROPERTY (Zrythm * zrythm READ zrythm CONSTANT FINAL)
16 Q_PROPERTY (
17 zrythm::gui::ZrythmApplication * application READ application CONSTANT FINAL)
18
19public:
20 GlobalState (QObject * parent = nullptr) : QObject (parent) { }
21 Zrythm * zrythm () const { return Zrythm::getInstance (); }
22 gui::ZrythmApplication * application () const
23 {
24 return qobject_cast<gui::ZrythmApplication *> (qApp);
25 }
26};
To be used throughout the program.
Definition zrythm.h:40