Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
project_templates_model.h
1// SPDX-FileCopyrightText: © 2024 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "project_info.h"
7
8#include <QAbstractListModel>
9#include <QQmlEngine>
10#include <QStringList>
11#include <QtQmlIntegration>
12
13namespace zrythm::gui
14{
15
16class ProjectTemplatesModel : public QAbstractListModel
17{
18 Q_OBJECT
19 QML_ELEMENT
20
21public:
22 enum ProjectTemplateRoles
23 {
24 NameRole = Qt::UserRole + 1,
25 PathRole,
26 IsBlankRole,
27 };
28
29 explicit ProjectTemplatesModel (QObject * parent = nullptr);
30
31 int rowCount (const QModelIndex &parent = QModelIndex ()) const override;
32 QVariant
33 data (const QModelIndex &index, int role = Qt::DisplayRole) const override;
34 QHash<int, QByteArray> roleNames () const override;
35
36private:
37 static std::vector<std::unique_ptr<ProjectInfo>> get_templates ();
38};
39
40} // namespace zrythm::gui