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