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 * 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 * zrythm () const
22 {
23 return ::zrythm::Zrythm::getInstance ();
24 }
25 zrythm::gui::ZrythmApplication * application () const
26 {
27 return qobject_cast<zrythm::gui::ZrythmApplication *> (qApp);
28 }
29};
To be used throughout the program.
Definition zrythm.h:46