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 <QDateTime>
7#include <QObject>
8#include <QtQmlIntegration/qqmlintegration.h>
9
10namespace zrythm::gui
11{
12
13class ProjectInfo : public QObject
14{
15 Q_OBJECT
16 QML_ELEMENT
17
18 Q_PROPERTY (QString name READ getName WRITE setName NOTIFY nameChanged FINAL)
19 Q_PROPERTY (QString path READ getPath WRITE setPath NOTIFY pathChanged FINAL)
20 Q_PROPERTY (QDateTime lastSavedAt READ getLastSavedAt CONSTANT FINAL)
21
22public:
23 explicit ProjectInfo (QObject * parent = nullptr);
24
31 ProjectInfo (const std::filesystem::path &path, QObject * parent = nullptr);
32
33 QString getName () const;
34 QString getPath () const;
35 QDateTime getLastSavedAt () const;
36
37 void setPath (const QString &path);
38 void setName (const QString &name);
39
43 Q_INVOKABLE bool exists () const;
44
45Q_SIGNALS:
46 void nameChanged ();
47 void pathChanged ();
48
49private:
50 QString name_;
51 std::filesystem::path path_;
52 QDateTime last_saved_at_;
53};
54
55} // namespace zrythm::gui
ProjectInfo(const std::filesystem::path &path, QObject *parent=nullptr)
Construct a new Project Info object from a path.
Q_INVOKABLE bool exists() const
Whether the project exists on disk.