Merge pull request #30 from lioncash/include

Editor: Amend includes of ProjectModel.hpp
This commit is contained in:
Phillip Stephens 2019-08-28 22:30:35 -07:00 committed by GitHub
commit 9b482ba013
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 36 deletions

View File

@ -9,6 +9,7 @@
#include <QSpinBox> #include <QSpinBox>
#include <QVBoxLayout> #include <QVBoxLayout>
#include "Common.hpp"
#include "KeyboardWidget.hpp" #include "KeyboardWidget.hpp"
#include "MainWindow.hpp" #include "MainWindow.hpp"

View File

@ -11,6 +11,7 @@
#include <QStyledItemDelegate> #include <QStyledItemDelegate>
#include <QThread> #include <QThread>
#include "Common.hpp"
#include "EditorWidget.hpp" #include "EditorWidget.hpp"
#include "ProjectModel.hpp" #include "ProjectModel.hpp"

View File

@ -1,16 +1,21 @@
#include <athena/FileWriter.hpp>
#include <athena/FileReader.hpp>
#include "ProjectModel.hpp" #include "ProjectModel.hpp"
#include "Common.hpp"
#include "athena/YAMLDocWriter.hpp" #include <QClipboard>
#include "athena/VectorWriter.hpp"
#include "MainWindow.hpp"
#include "EditorWidget.hpp"
#include "amuse/SongConverter.hpp"
#include "amuse/ContainerRegistry.hpp"
#include <QDate> #include <QDate>
#include <QMimeData> #include <QMimeData>
#include <QClipboard>
#include "Common.hpp"
#include "EditorWidget.hpp"
#include "MainWindow.hpp"
#include "NewSoundMacroDialog.hpp"
#include <amuse/ContainerRegistry.hpp>
#include <amuse/SongConverter.hpp>
#include <athena/FileWriter.hpp>
#include <athena/FileReader.hpp>
#include <athena/YAMLDocWriter.hpp>
#include <athena/VectorWriter.hpp>
QIcon ProjectModel::GroupNode::Icon; QIcon ProjectModel::GroupNode::Icon;
QIcon ProjectModel::SongGroupNode::Icon; QIcon ProjectModel::SongGroupNode::Icon;
@ -497,6 +502,8 @@ ProjectModel::ProjectModel(const QString& path, QObject* parent)
SoundGroupNode::Icon = QIcon(QStringLiteral(":/icons/IconSoundGroup.svg")); SoundGroupNode::Icon = QIcon(QStringLiteral(":/icons/IconSoundGroup.svg"));
} }
ProjectModel::~ProjectModel() = default;
bool ProjectModel::clearProjectData() { bool ProjectModel::clearProjectData() {
m_projectDatabase = amuse::ProjectDatabase(); m_projectDatabase = amuse::ProjectDatabase();
m_groups.clear(); m_groups.clear();
@ -1333,25 +1340,17 @@ ProjectModel::SongGroupNode* ProjectModel::newSongGroup(GroupNode* group, QStrin
constexpr ProjectModel::INode::Type GetINodeType(ProjectModel::SoundMacroNode*) { constexpr ProjectModel::INode::Type GetINodeType(ProjectModel::SoundMacroNode*) {
return ProjectModel::INode::Type::SoundMacro; return ProjectModel::INode::Type::SoundMacro;
} }
constexpr ProjectModel::INode::Type GetINodeType(ProjectModel::ADSRNode*) { constexpr ProjectModel::INode::Type GetINodeType(ProjectModel::ADSRNode*) { return ProjectModel::INode::Type::ADSR; }
return ProjectModel::INode::Type::ADSR; constexpr ProjectModel::INode::Type GetINodeType(ProjectModel::CurveNode*) { return ProjectModel::INode::Type::Curve; }
}
constexpr ProjectModel::INode::Type GetINodeType(ProjectModel::CurveNode*) {
return ProjectModel::INode::Type::Curve;
}
constexpr ProjectModel::INode::Type GetINodeType(ProjectModel::KeymapNode*) { constexpr ProjectModel::INode::Type GetINodeType(ProjectModel::KeymapNode*) {
return ProjectModel::INode::Type::Keymap; return ProjectModel::INode::Type::Keymap;
} }
constexpr ProjectModel::INode::Type GetINodeType(ProjectModel::LayersNode*) { constexpr ProjectModel::INode::Type GetINodeType(ProjectModel::LayersNode*) { return ProjectModel::INode::Type::Layer; }
return ProjectModel::INode::Type::Layer;
}
constexpr ProjectModel::INode::Type GetINodeType(ProjectModel::SampleNode*) { constexpr ProjectModel::INode::Type GetINodeType(ProjectModel::SampleNode*) {
return ProjectModel::INode::Type::Sample; return ProjectModel::INode::Type::Sample;
} }
constexpr amuse::NameDB::Type GetNameDBType(ProjectModel::SoundMacroNode*) { constexpr amuse::NameDB::Type GetNameDBType(ProjectModel::SoundMacroNode*) { return amuse::NameDB::Type::SoundMacro; }
return amuse::NameDB::Type::SoundMacro;
}
constexpr amuse::NameDB::Type GetNameDBType(ProjectModel::ADSRNode*) { return amuse::NameDB::Type::Table; } constexpr amuse::NameDB::Type GetNameDBType(ProjectModel::ADSRNode*) { return amuse::NameDB::Type::Table; }
constexpr amuse::NameDB::Type GetNameDBType(ProjectModel::CurveNode*) { return amuse::NameDB::Type::Table; } constexpr amuse::NameDB::Type GetNameDBType(ProjectModel::CurveNode*) { return amuse::NameDB::Type::Table; }
constexpr amuse::NameDB::Type GetNameDBType(ProjectModel::KeymapNode*) { return amuse::NameDB::Type::Keymap; } constexpr amuse::NameDB::Type GetNameDBType(ProjectModel::KeymapNode*) { return amuse::NameDB::Type::Keymap; }
@ -2121,6 +2120,4 @@ amuse::SongId ProjectModel::exchangeSongId(amuse::SongId oldId, std::string_view
return newId; return newId;
} }
void ProjectModel::setIdDatabases(INode* context) const { void ProjectModel::setIdDatabases(INode* context) const { m_projectDatabase.setIdDatabases(); }
m_projectDatabase.setIdDatabases();
}

View File

@ -1,21 +1,30 @@
#pragma once #pragma once
#include <memory>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include <QAbstractItemModel> #include <QAbstractItemModel>
#include <QIdentityProxyModel>
#include <QSortFilterProxyModel>
#include <QDir> #include <QDir>
#include <QIcon> #include <QIcon>
#include <map> #include <QIdentityProxyModel>
#include "Common.hpp" #include <QSortFilterProxyModel>
#include "NewSoundMacroDialog.hpp"
#include "amuse/AudioGroup.hpp" #include "Common.hpp"
#include "amuse/AudioGroupData.hpp"
#include "amuse/AudioGroupProject.hpp" #include <amuse/AudioGroup.hpp>
#include "amuse/AudioGroupPool.hpp" #include <amuse/AudioGroupData.hpp>
#include "amuse/AudioGroupSampleDirectory.hpp" #include <amuse/AudioGroupProject.hpp>
#include <amuse/AudioGroupPool.hpp>
#include <amuse/AudioGroupSampleDirectory.hpp>
#include <amuse/Common.hpp>
class ProjectModel;
class EditorUndoCommand; class EditorUndoCommand;
class ProjectModel;
struct SoundMacroTemplateEntry;
enum AmuseItemEditFlags { enum AmuseItemEditFlags {
AmuseItemNone = 0, AmuseItemNone = 0,
@ -373,6 +382,7 @@ public:
public: public:
explicit ProjectModel(const QString& path, QObject* parent = Q_NULLPTR); explicit ProjectModel(const QString& path, QObject* parent = Q_NULLPTR);
~ProjectModel() override;
bool clearProjectData(); bool clearProjectData();
bool openGroupData(QString groupName, UIMessenger& messenger); bool openGroupData(QString groupName, UIMessenger& messenger);