Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
project_info.h
1// SPDX-FileCopyrightText: © 2024 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "utils/types.h"
7
8#include <QObject>
9#include <QtQmlIntegration>
10
11namespace zrythm::gui
12{
13
14class ProjectInfo : public QObject
15{
16 Q_OBJECT
17 QML_ELEMENT
18
19 Q_PROPERTY (QString name READ getName WRITE setName NOTIFY nameChanged FINAL)
20 Q_PROPERTY (QString path READ getPath WRITE setPath NOTIFY pathChanged FINAL)
21 Q_PROPERTY (QDateTime lastSavedAt READ getLastSavedAt CONSTANT FINAL)
22
23public:
24 explicit ProjectInfo (QObject * parent = nullptr);
25
32 ProjectInfo (const fs::path &path, QObject * parent = nullptr);
33
34 QString getName () const;
35 QString getPath () const;
36 QDateTime getLastSavedAt () const;
37
38 void setPath (const QString &path);
39 void setName (const QString &name);
40
44 Q_INVOKABLE bool exists () const;
45
46Q_SIGNALS:
47 void nameChanged ();
48 void pathChanged ();
49
50private:
51 QString name_;
52 fs::path path_;
53 QDateTime last_saved_at_;
54};
55
56} // namespace zrythm::gui
Q_INVOKABLE bool exists() const
Whether the project exists on disk.
ProjectInfo(const fs::path &path, QObject *parent=nullptr)
Construct a new Project Info object from a path.