diff --git a/Editor/ADSREditor.cpp b/Editor/ADSREditor.cpp index 48b40e4..543226e 100644 --- a/Editor/ADSREditor.cpp +++ b/Editor/ADSREditor.cpp @@ -1,8 +1,11 @@ #include "ADSREditor.hpp" #include "MainWindow.hpp" -#include -#include + +#include +#include #include +#include +#include const QColor Red = QColor(255, 127, 127); const QColor Green = QColor(127, 255, 127); @@ -217,6 +220,8 @@ ADSRView::ADSRView(QWidget* parent) : QWidget(parent) { m_gridFont.setPointSize(8); } +ADSRView::~ADSRView() = default; + ADSREditor* ADSRControls::getEditor() const { return qobject_cast(parentWidget()); } void ADSRControls::loadData() { @@ -945,6 +950,8 @@ ADSRControls::ADSRControls(QWidget* parent) : QFrame(parent) { setLayout(mainLayout); } +ADSRControls::~ADSRControls() = default; + bool ADSREditor::loadData(ProjectModel::ADSRNode* node) { m_adsrView->loadData(node); m_controls->loadData(); @@ -966,3 +973,5 @@ ADSREditor::ADSREditor(QWidget* parent) : EditorWidget(parent), m_adsrView(new A layout->addWidget(m_controls); setLayout(layout); } + +ADSREditor::~ADSREditor() = default; diff --git a/Editor/ADSREditor.hpp b/Editor/ADSREditor.hpp index 1e7597e..59726cc 100644 --- a/Editor/ADSREditor.hpp +++ b/Editor/ADSREditor.hpp @@ -1,15 +1,22 @@ #pragma once -#include "EditorWidget.hpp" +#include +#include + #include -#include -#include -#include -#include #include +#include "EditorWidget.hpp" +#include "ProjectModel.hpp" + +#include + class ADSREditor; +class QCheckBox; +class QDoubleSpinBox; +class QLabel; + class ADSRView : public QWidget { Q_OBJECT friend class ADSRControls; @@ -23,6 +30,8 @@ class ADSRView : public QWidget { public: explicit ADSRView(QWidget* parent = Q_NULLPTR); + ~ADSRView() override; + void loadData(ProjectModel::ADSRNode* node); void unloadData(); ProjectModel::INode* currentNode() const; @@ -53,8 +62,11 @@ class ADSRControls : public QFrame { public: explicit ADSRControls(QWidget* parent = Q_NULLPTR); + ~ADSRControls() override; + void loadData(); void unloadData(); + public slots: void attackChanged(double val); void decayChanged(double val); @@ -74,6 +86,8 @@ class ADSREditor : public EditorWidget { public: explicit ADSREditor(QWidget* parent = Q_NULLPTR); + ~ADSREditor() override; + bool loadData(ProjectModel::ADSRNode* node); void unloadData() override; ProjectModel::INode* currentNode() const override; diff --git a/Editor/Common.cpp b/Editor/Common.cpp index c2cab93..440d644 100644 --- a/Editor/Common.cpp +++ b/Editor/Common.cpp @@ -1,8 +1,11 @@ #include "Common.hpp" #include "MainWindow.hpp" + +#include #include #include #include +#include boo::SystemString QStringToSysString(const QString& str) { #ifdef _WIN32 diff --git a/Editor/Common.hpp b/Editor/Common.hpp index 4e97596..2126592 100644 --- a/Editor/Common.hpp +++ b/Editor/Common.hpp @@ -1,13 +1,19 @@ #pragma once -#include "boo/System.hpp" -#include -#include +#include + #include +#include + +#include class MainWindow; extern MainWindow* g_MainWindow; +class QDir; +class QRectF; +class QTransform; + class UIMessenger : public QObject { Q_OBJECT public: diff --git a/Editor/CurveEditor.cpp b/Editor/CurveEditor.cpp index bea9130..0203cc0 100644 --- a/Editor/CurveEditor.cpp +++ b/Editor/CurveEditor.cpp @@ -7,9 +7,12 @@ #include #include +#include +#include #include #include #include +#include class CurveEditUndoCommand : public EditorUndoCommand { public: @@ -163,6 +166,8 @@ CurveView::CurveView(QWidget* parent) : QWidget(parent) { m_gridFont.setPointSize(8); } +CurveView::~CurveView() = default; + CurveEditor* CurveControls::getEditor() const { return qobject_cast(parentWidget()); } void CurveControls::loadData() { @@ -270,6 +275,8 @@ CurveControls::CurveControls(QWidget* parent) : QFrame(parent) { m_lineEdit->setToolTip(docStr); } +CurveControls::~CurveControls() = default; + bool CurveEditor::loadData(ProjectModel::CurveNode* node) { m_curveView->loadData(node); m_controls->loadData(); @@ -292,3 +299,5 @@ CurveEditor::CurveEditor(QWidget* parent) layout->addWidget(m_controls); setLayout(layout); } + +CurveEditor::~CurveEditor() = default; diff --git a/Editor/CurveEditor.hpp b/Editor/CurveEditor.hpp index 3b656e5..4b1317d 100644 --- a/Editor/CurveEditor.hpp +++ b/Editor/CurveEditor.hpp @@ -2,16 +2,21 @@ #include -#include "EditorWidget.hpp" #include -#include -#include -#include -#include #include +#include + +#include "EditorWidget.hpp" +#include "ProjectModel.hpp" + +#include class CurveEditor; +class QLabel; +class QLineEdit; +class QPushButton; + class CurveView : public QWidget { Q_OBJECT friend class CurveControls; @@ -23,6 +28,8 @@ class CurveView : public QWidget { public: explicit CurveView(QWidget* parent = Q_NULLPTR); + ~CurveView() override; + void loadData(ProjectModel::CurveNode* node); void unloadData(); ProjectModel::INode* currentNode() const; @@ -43,9 +50,12 @@ class CurveControls : public QFrame { public: explicit CurveControls(QWidget* parent = Q_NULLPTR); + ~CurveControls() override; + void loadData(); void unloadData(); void resizeEvent(QResizeEvent* ev) override; + public slots: void exprCommit(); }; @@ -59,6 +69,8 @@ class CurveEditor : public EditorWidget { public: explicit CurveEditor(QWidget* parent = Q_NULLPTR); + ~CurveEditor() override; + bool loadData(ProjectModel::CurveNode* node); void unloadData() override; ProjectModel::INode* currentNode() const override; diff --git a/Editor/EditorWidget.cpp b/Editor/EditorWidget.cpp index ad0271d..e6ef335 100644 --- a/Editor/EditorWidget.cpp +++ b/Editor/EditorWidget.cpp @@ -5,6 +5,8 @@ EditorWidget::EditorWidget(QWidget* parent) : QWidget(parent) {} +EditorWidget::~EditorWidget() = default; + void EditorUndoCommand::undo() { g_MainWindow->openEditor(m_node.get()); } void EditorUndoCommand::redo() { g_MainWindow->openEditor(m_node.get()); } @@ -92,6 +94,8 @@ FieldProjectNode::FieldProjectNode(ProjectModel::CollectionNode* collection, QWi setCollection(collection); } +FieldProjectNode::~FieldProjectNode() = default; + void FieldProjectNode::setCollection(ProjectModel::CollectionNode* collection) { m_collection = collection; @@ -153,6 +157,8 @@ FieldPageObjectNode::FieldPageObjectNode(ProjectModel::GroupNode* group, QWidget setGroup(group); } +FieldPageObjectNode::~FieldPageObjectNode() = default; + void FieldPageObjectNode::setGroup(ProjectModel::GroupNode* group) { m_group = group; diff --git a/Editor/EditorWidget.hpp b/Editor/EditorWidget.hpp index 6e0e7cd..0841e92 100644 --- a/Editor/EditorWidget.hpp +++ b/Editor/EditorWidget.hpp @@ -1,29 +1,34 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include -#include #include -#include +#include +#include #include #include +#include +#include #include +#include +#include +#include +#include + #include "ProjectModel.hpp" +#include + class EditorWidget : public QWidget { Q_OBJECT public: explicit EditorWidget(QWidget* parent = Q_NULLPTR); + ~EditorWidget() override; + virtual bool valid() const { return true; } virtual void unloadData() {} virtual ProjectModel::INode* currentNode() const { return nullptr; } virtual void setEditorEnabled(bool en) { setEnabled(en); } virtual AmuseItemEditFlags itemEditFlags() const { return AmuseItemNone; } + public slots: virtual void itemCutAction() {} virtual void itemCopyAction() {} @@ -130,6 +135,8 @@ class FieldProjectNode : public QWidget { public: explicit FieldProjectNode(ProjectModel::CollectionNode* collection = Q_NULLPTR, QWidget* parent = Q_NULLPTR); + ~FieldProjectNode() override; + void setCollection(ProjectModel::CollectionNode* collection); ProjectModel::CollectionNode* collection() const { return m_collection; } int currentIndex() const { return m_comboBox.currentIndex(); } @@ -137,10 +144,13 @@ public: void showPopup() { m_comboBox.showPopup(); } ProjectModel::BasePoolObjectNode* currentNode() const; bool event(QEvent* ev) override; + private slots: void _currentIndexChanged(int); + public slots: void openCurrent(); + signals: void currentIndexChanged(int); }; @@ -153,6 +163,8 @@ class FieldPageObjectNode : public QWidget { public: explicit FieldPageObjectNode(ProjectModel::GroupNode* group = Q_NULLPTR, QWidget* parent = Q_NULLPTR); + ~FieldPageObjectNode() override; + void setGroup(ProjectModel::GroupNode* group); ProjectModel::GroupNode* group() const { return m_group; } int currentIndex() const { return m_comboBox.currentIndex(); } @@ -161,10 +173,13 @@ public: void showPopup() { m_comboBox.showPopup(); } ProjectModel::BasePoolObjectNode* currentNode() const; bool event(QEvent* ev) override; + private slots: void _currentIndexChanged(int); + public slots: void openCurrent(); + signals: void currentIndexChanged(int); }; diff --git a/Editor/KeyboardWidget.cpp b/Editor/KeyboardWidget.cpp index 203a442..c472a3a 100644 --- a/Editor/KeyboardWidget.cpp +++ b/Editor/KeyboardWidget.cpp @@ -1,10 +1,14 @@ #include "KeyboardWidget.hpp" + +#include #include -#include #include #include -#include #include +#include + +#include "Common.hpp" +#include "StatusBarWidget.hpp" const QString NaturalKeyNames[] = {QStringLiteral("C"), QStringLiteral("D"), QStringLiteral("E"), QStringLiteral("F"), QStringLiteral("G"), QStringLiteral("A"), QStringLiteral("B")}; @@ -70,6 +74,8 @@ KeyboardWidget::KeyboardWidget(QWidget* parent) : QWidget(parent) { setMouseTracking(true); } +KeyboardWidget::~KeyboardWidget() = default; + std::pair KeyboardWidget::_getOctaveAndKey(QMouseEvent* event) const { for (KeyboardOctave* oct : m_widgets) { QPoint localPos = oct->mapFromParent(event->pos()); @@ -144,6 +150,8 @@ void KeyboardWidget::showEvent(QShowEvent* event) { KeyboardSlider::KeyboardSlider(QWidget* parent) : QSlider(parent) {} +KeyboardSlider::~KeyboardSlider() = default; + void KeyboardSlider::enterEvent(QEvent* event) { if (m_statusFocus) m_statusFocus->enter(); diff --git a/Editor/KeyboardWidget.hpp b/Editor/KeyboardWidget.hpp index 82a9928..8347179 100644 --- a/Editor/KeyboardWidget.hpp +++ b/Editor/KeyboardWidget.hpp @@ -1,11 +1,10 @@ #pragma once -#include -#include #include +#include +#include #include -#include "StatusBarWidget.hpp" -#include "Common.hpp" +#include extern const QString NaturalKeyNames[7]; extern const QString SharpKeyNames[5]; @@ -14,6 +13,7 @@ extern const int NaturalKeyNumbers[7]; extern const int SharpKeyNumbers[5]; class KeyboardWidget; +class StatusBarFocus; class KeyboardOctave : public QSvgWidget { Q_OBJECT @@ -45,6 +45,8 @@ class KeyboardWidget : public QWidget { public: explicit KeyboardWidget(QWidget* parent = Q_NULLPTR); + ~KeyboardWidget() override; + void setStatusFocus(StatusBarFocus* statusFocus) { m_statusFocus = statusFocus; } void mouseMoveEvent(QMouseEvent* event) override; @@ -68,6 +70,8 @@ protected: public: explicit KeyboardSlider(QWidget* parent = Q_NULLPTR); + ~KeyboardSlider() override; + void enterEvent(QEvent* event) override; void leaveEvent(QEvent* event) override; void setStatusFocus(StatusBarFocus* statusFocus); diff --git a/Editor/KeymapEditor.cpp b/Editor/KeymapEditor.cpp index d3e2955..268bdc8 100644 --- a/Editor/KeymapEditor.cpp +++ b/Editor/KeymapEditor.cpp @@ -2,8 +2,11 @@ #include +#include #include +#include #include +#include #include #include "KeyboardWidget.hpp" @@ -182,6 +185,8 @@ KeymapView::KeymapView(QWidget* parent) m_widgetToSvg = RectToRect(QRect(0, 0, 280, 200), m_octaveRenderer.viewBoxF()); } +KeymapView::~KeymapView() = default; + KeymapEditor* KeymapControls::getEditor() const { return qobject_cast(parentWidget()); } void KeymapControls::setPaintIdx(int idx) { @@ -356,6 +361,8 @@ KeymapControls::KeymapControls(QWidget* parent) : QFrame(parent) { setLayout(mainLayout); } +KeymapControls::~KeymapControls() = default; + void KeymapEditor::_touch() { if (m_controlKeymap.macro.id == 0xffff) m_controls->setPaintIdx(-1); @@ -514,3 +521,5 @@ KeymapEditor::KeymapEditor(QWidget* parent) layout->addWidget(m_controls); setLayout(layout); } + +KeymapEditor::~KeymapEditor() = default; diff --git a/Editor/KeymapEditor.hpp b/Editor/KeymapEditor.hpp index d56c6b7..50ef6e0 100644 --- a/Editor/KeymapEditor.hpp +++ b/Editor/KeymapEditor.hpp @@ -1,20 +1,25 @@ #pragma once -#include "EditorWidget.hpp" - #include #include +#include +#include -#include #include -#include #include -#include #include -#include #include +#include "EditorWidget.hpp" +#include "ProjectModel.hpp" + +#include +#include + class KeymapEditor; +class QCheckBox; +class QScrollArea; +class QSpinBox; class PaintButton : public QPushButton { Q_OBJECT @@ -48,6 +53,8 @@ class KeymapView : public QWidget { public: explicit KeymapView(QWidget* parent = Q_NULLPTR); + ~KeymapView() override; + void loadData(ProjectModel::KeymapNode* node); void unloadData(); ProjectModel::INode* currentNode() const; @@ -75,8 +82,11 @@ class KeymapControls : public QFrame { public: explicit KeymapControls(QWidget* parent = Q_NULLPTR); + ~KeymapControls() override; + void loadData(ProjectModel::KeymapNode* node); void unloadData(); + public slots: void controlChanged(); void paintButtonPressed(); @@ -103,6 +113,8 @@ class KeymapEditor : public EditorWidget { public: explicit KeymapEditor(QWidget* parent = Q_NULLPTR); + ~KeymapEditor() override; + bool loadData(ProjectModel::KeymapNode* node); void unloadData() override; ProjectModel::INode* currentNode() const override; diff --git a/Editor/LayersEditor.cpp b/Editor/LayersEditor.cpp index f816837..5209e64 100644 --- a/Editor/LayersEditor.cpp +++ b/Editor/LayersEditor.cpp @@ -100,6 +100,8 @@ public: SoundMacroDelegate::SoundMacroDelegate(QObject* parent) : BaseObjectDelegate(parent) {} +SoundMacroDelegate::~SoundMacroDelegate() = default; + ProjectModel::INode* SoundMacroDelegate::getNode(const QAbstractItemModel* __model, const QModelIndex& index) const { const LayersModel* model = static_cast(__model); const amuse::LayerMapping& layer = (*model->m_node->m_obj)[index.row()]; @@ -507,6 +509,8 @@ amuse::LayerMapping LayersModel::_removeRow(int row) { LayersModel::LayersModel(QObject* parent) : QAbstractTableModel(parent) {} +LayersModel::~LayersModel() = default; + void LayersTableView::deleteSelection() { const QModelIndexList list = selectionModel()->selectedRows(); if (list.isEmpty()) { @@ -566,6 +570,8 @@ LayersTableView::LayersTableView(QWidget* parent) : QTableView(parent) { setItemDelegateForColumn(7, &m_unsignedDelegate); } +LayersTableView::~LayersTableView() = default; + bool LayersEditor::loadData(ProjectModel::LayersNode* node) { m_model.loadData(node); return true; @@ -626,3 +632,5 @@ LayersEditor::LayersEditor(QWidget* parent) m_addRemoveButtons.removeAction()->setToolTip(tr("Remove selected layer mappings")); connect(m_addRemoveButtons.removeAction(), &QAction::triggered, this, &LayersEditor::itemDeleteAction); } + +LayersEditor::~LayersEditor() = default; diff --git a/Editor/LayersEditor.hpp b/Editor/LayersEditor.hpp index a36f02b..deee52b 100644 --- a/Editor/LayersEditor.hpp +++ b/Editor/LayersEditor.hpp @@ -1,11 +1,15 @@ #pragma once -#include "EditorWidget.hpp" #include -#include #include -#include #include +#include + +#include "EditorWidget.hpp" +#include "ProjectModel.hpp" + +#include +#include class SoundMacroDelegate : public BaseObjectDelegate { Q_OBJECT @@ -14,9 +18,12 @@ protected: public: explicit SoundMacroDelegate(QObject* parent = Q_NULLPTR); + ~SoundMacroDelegate() override; + QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const override; void setEditorData(QWidget* editor, const QModelIndex& index) const override; void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override; + private slots: void smIndexChanged(); }; @@ -30,6 +37,8 @@ class LayersModel : public QAbstractTableModel { public: explicit LayersModel(QObject* parent = Q_NULLPTR); + ~LayersModel() override; + void loadData(ProjectModel::LayersNode* node); void unloadData(); @@ -62,6 +71,8 @@ class LayersTableView : public QTableView { public: explicit LayersTableView(QWidget* parent = Q_NULLPTR); + ~LayersTableView() override; + void setModel(QAbstractItemModel* model) override; void deleteSelection(); }; @@ -75,11 +86,14 @@ class LayersEditor : public EditorWidget { public: explicit LayersEditor(QWidget* parent = Q_NULLPTR); + ~LayersEditor() override; + bool loadData(ProjectModel::LayersNode* node); void unloadData() override; ProjectModel::INode* currentNode() const override; void resizeEvent(QResizeEvent* ev) override; AmuseItemEditFlags itemEditFlags() const override; + private slots: void rowsInserted(const QModelIndex& parent, int first, int last); void rowsMoved(const QModelIndex& parent, int start, int end, const QModelIndex& destination, int row); diff --git a/Editor/MIDIReader.cpp b/Editor/MIDIReader.cpp index e935901..5a190db 100644 --- a/Editor/MIDIReader.cpp +++ b/Editor/MIDIReader.cpp @@ -1,6 +1,9 @@ #include "MIDIReader.hpp" + #include "MainWindow.hpp" +#include + MIDIReader::MIDIReader(amuse::Engine& engine, bool useLock) : amuse::BooBackendMIDIReader(engine, useLock) {} void MIDIReader::noteOff(uint8_t chan, uint8_t key, uint8_t velocity) { diff --git a/Editor/MIDIReader.hpp b/Editor/MIDIReader.hpp index 294ef4f..27474a1 100644 --- a/Editor/MIDIReader.hpp +++ b/Editor/MIDIReader.hpp @@ -1,10 +1,18 @@ #pragma once -#include "amuse/Voice.hpp" -#include "amuse/BooBackend.hpp" -#include "amuse/Common.hpp" +#include +#include +#include #include +#include +#include +#include + +namespace amuse { +class Engine; +} + class MIDIReader : public amuse::BooBackendMIDIReader { std::unordered_map> m_chanVoxs; std::unordered_set> m_keyoffVoxs; diff --git a/Editor/MainWindow.cpp b/Editor/MainWindow.cpp index 73ed5b0..64f49a8 100644 --- a/Editor/MainWindow.cpp +++ b/Editor/MainWindow.cpp @@ -1,24 +1,33 @@ #include "MainWindow.hpp" -#include -#include -#include -#include -#include -#include + #include +#include +#include +#include +#include +#include +#include #include -#include "amuse/ContainerRegistry.hpp" +#include + +#include "ADSREditor.hpp" #include "Common.hpp" +#include "CurveEditor.hpp" +#include "KeymapEditor.hpp" +#include "LayersEditor.hpp" +#include "MIDIReader.hpp" +#include "NewSoundMacroDialog.hpp" +#include "SampleEditor.hpp" #include "SongGroupEditor.hpp" #include "SoundGroupEditor.hpp" #include "SoundGroupEditor.hpp" #include "SoundMacroEditor.hpp" -#include "ADSREditor.hpp" -#include "CurveEditor.hpp" -#include "KeymapEditor.hpp" -#include "LayersEditor.hpp" -#include "SampleEditor.hpp" -#include "NewSoundMacroDialog.hpp" +#include "StudioSetupWidget.hpp" + +#include +#include +#include +#include MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent) diff --git a/Editor/MainWindow.hpp b/Editor/MainWindow.hpp index a4fb6e2..96302b1 100644 --- a/Editor/MainWindow.hpp +++ b/Editor/MainWindow.hpp @@ -1,37 +1,53 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include + #include -#include "ui_MainWindow.h" -#include "amuse/Engine.hpp" -#include "amuse/BooBackend.hpp" -#include "boo/audiodev/IAudioVoiceEngine.hpp" -#include "ProjectModel.hpp" +#include +#include +#include +#include +#include + #include "EditorWidget.hpp" -#include "MIDIReader.hpp" -#include "StudioSetupWidget.hpp" +#include "ProjectModel.hpp" + +#include "ui_MainWindow.h" + +#include +#include +#include #define MaxRecentFiles 4 +namespace amuse { +class Engine; +} + +namespace boo { +struct IAudioVoiceEngine; +} + namespace Ui { class MainWindow; } -class MainWindow; -class SongGroupEditor; -class SoundGroupEditor; -class SoundMacroEditor; class ADSREditor; class CurveEditor; class KeymapEditor; class LayersEditor; +class MainWindow; class SampleEditor; +class SongGroupEditor; +class SoundGroupEditor; +class SoundMacroEditor; +class StudioSetupWidget; +class VoiceAllocator; + +class QProgressDialog; +class QUndoStack; enum BackgroundTaskId { TaskOpen, TaskImport, TaskExport, TaskReloadSamples }; diff --git a/Editor/NewSoundMacroDialog.cpp b/Editor/NewSoundMacroDialog.cpp index 2420eb3..522753f 100644 --- a/Editor/NewSoundMacroDialog.cpp +++ b/Editor/NewSoundMacroDialog.cpp @@ -155,3 +155,5 @@ NewSoundMacroDialog::NewSoundMacroDialog(const QString& groupName, QWidget* pare setLayout(layout); } + +NewSoundMacroDialog::~NewSoundMacroDialog() = default; diff --git a/Editor/NewSoundMacroDialog.hpp b/Editor/NewSoundMacroDialog.hpp index 471a19d..b4240cb 100644 --- a/Editor/NewSoundMacroDialog.hpp +++ b/Editor/NewSoundMacroDialog.hpp @@ -1,9 +1,12 @@ #pragma once -#include -#include +#include +#include + #include +#include #include +#include struct SoundMacroTemplateEntry { const char* m_name; @@ -19,6 +22,8 @@ class NewSoundMacroDialog : public QDialog { public: explicit NewSoundMacroDialog(const QString& groupName, QWidget* parent = Q_NULLPTR); + ~NewSoundMacroDialog() override; + QString getName() const { return m_le.text(); } const SoundMacroTemplateEntry* getSelectedTemplate() const; }; diff --git a/Editor/SampleEditor.cpp b/Editor/SampleEditor.cpp index 8651f77..1e16b23 100644 --- a/Editor/SampleEditor.cpp +++ b/Editor/SampleEditor.cpp @@ -1,11 +1,15 @@ #include "SampleEditor.hpp" -#include "MainWindow.hpp" -#include "amuse/DSPCodec.hpp" -#include -#include -#include -#include + #include +#include +#include +#include +#include +#include + +#include "MainWindow.hpp" + +#include SampleEditor* SampleView::getEditor() const { return qobject_cast(parentWidget()->parentWidget()->parentWidget()); @@ -389,6 +393,8 @@ SampleView::SampleView(QWidget* parent) : QWidget(parent) { m_rulerFont.setPointSize(8); } +SampleView::~SampleView() = default; + void SampleControls::zoomSliderChanged(int val) { SampleEditor* editor = qobject_cast(parentWidget()); editor->m_sampleView->setZoom(val); @@ -740,6 +746,8 @@ SampleControls::SampleControls(QWidget* parent) : QFrame(parent) { setLayout(mainLayout); } +SampleControls::~SampleControls() = default; + bool SampleEditor::loadData(ProjectModel::SampleNode* node) { m_controls->loadData(m_sampleView->loadData(node)); return true; @@ -770,3 +778,5 @@ SampleEditor::SampleEditor(QWidget* parent) layout->addWidget(m_controls); setLayout(layout); } + +SampleEditor::~SampleEditor() = default; diff --git a/Editor/SampleEditor.hpp b/Editor/SampleEditor.hpp index 6a3ba7f..795dc3c 100644 --- a/Editor/SampleEditor.hpp +++ b/Editor/SampleEditor.hpp @@ -1,14 +1,25 @@ #pragma once +#include +#include + +#include +#include + #include "EditorWidget.hpp" #include "ProjectModel.hpp" -#include -#include -#include -#include + +#include +#include +#include class SampleEditor; +class QCheckBox; +class QPushButton; +class QScrollArea; +class QSlider; + class SampleView : public QWidget { Q_OBJECT friend class SampleControls; @@ -33,6 +44,8 @@ class SampleView : public QWidget { public: explicit SampleView(QWidget* parent = Q_NULLPTR); + ~SampleView() override; + bool loadData(ProjectModel::SampleNode* node); void unloadData(); ProjectModel::INode* currentNode() const; @@ -67,6 +80,8 @@ class SampleControls : public QFrame { public: explicit SampleControls(QWidget* parent = Q_NULLPTR); + ~SampleControls() override; + void doFileWrite(); void setFileWrite(bool w); void updateFileState(); @@ -74,6 +89,7 @@ public: void setLoopEndSample(int sample) { m_loopEnd->setValue(sample); } void loadData(bool reset); void unloadData(); + public slots: void zoomSliderChanged(int val); void loopStateChanged(int state); @@ -97,6 +113,8 @@ class SampleEditor : public EditorWidget { public: explicit SampleEditor(QWidget* parent = Q_NULLPTR); + ~SampleEditor() override; + bool loadData(ProjectModel::SampleNode* node); void unloadData() override; ProjectModel::INode* currentNode() const override; diff --git a/Editor/SongGroupEditor.cpp b/Editor/SongGroupEditor.cpp index 54f99ae..9af9adc 100644 --- a/Editor/SongGroupEditor.cpp +++ b/Editor/SongGroupEditor.cpp @@ -248,6 +248,8 @@ public: PageObjectDelegate::PageObjectDelegate(QObject* parent) : BaseObjectDelegate(parent) {} +PageObjectDelegate::~PageObjectDelegate() = default; + ProjectModel::INode* PageObjectDelegate::getNode(const QAbstractItemModel* __model, const QModelIndex& index) const { const PageModel* model = static_cast(__model); auto entry = model->m_sorted[index.row()]; @@ -329,6 +331,8 @@ MIDIFileFieldWidget::MIDIFileFieldWidget(QWidget* parent) m_dialog.setAcceptMode(QFileDialog::AcceptOpen); } +MIDIFileFieldWidget::~MIDIFileFieldWidget() = default; + QWidget* MIDIFileDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const { MIDIFileFieldWidget* field = new MIDIFileFieldWidget(parent); @@ -507,6 +511,8 @@ MIDIFileDelegate::MIDIFileDelegate(SetupTableView* parent) , m_fileDialogMid(parent, tr("Export MIDI"), {}, tr("MIDI(*.mid)")) , m_fileDialogSng(parent, tr("Export Song"), {}, tr("Song(*.sng)")) {} +MIDIFileDelegate::~MIDIFileDelegate() = default; + std::unordered_map& PageModel::_getMap() const { return m_drum ? m_node->m_index->m_drumPages : m_node->m_index->m_normPages; } @@ -769,6 +775,8 @@ std::pair PageModel::_removeRow(uint8 PageModel::PageModel(bool drum, QObject* parent) : QAbstractTableModel(parent), m_drum(drum) {} +PageModel::~PageModel() = default; + std::unordered_map>& SetupListModel::_getMap() const { return m_node->m_index->m_midiSetups; } @@ -1024,6 +1032,8 @@ SetupListModel::_removeRow(amuse::SongId id) { SetupListModel::SetupListModel(QObject* parent) : QAbstractTableModel(parent) {} +SetupListModel::~SetupListModel() = default; + void SetupModel::loadData(std::pair>* data) { beginResetModel(); m_data = data; @@ -1151,6 +1161,8 @@ Qt::ItemFlags SetupModel::flags(const QModelIndex& index) const { return Qt::Ite SetupModel::SetupModel(QObject* parent) : QAbstractTableModel(parent) {} +SetupModel::~SetupModel() = default; + void PageTableView::deleteSelection() { const QModelIndexList list = selectionModel()->selectedRows(); if (list.isEmpty()) { @@ -1196,6 +1208,8 @@ PageTableView::PageTableView(QWidget* parent) : QTableView(parent) { setItemDelegateForColumn(3, &m_255Delegate); } +PageTableView::~PageTableView() = default; + void SetupTableView::setModel(QAbstractItemModel* list, QAbstractItemModel* table) { { m_listView->setModel(list); @@ -1256,6 +1270,8 @@ SetupTableView::SetupTableView(QWidget* parent) m_tableView->setItemDelegateForColumn(4, &m_127Delegate); } +SetupTableView::~SetupTableView() = default; + void ColoredTabBarStyle::drawControl(QStyle::ControlElement element, const QStyleOption* option, QPainter* painter, const QWidget* widget) const { if (qobject_cast(widget) && element == QStyle::CE_TabBarTab) { @@ -1591,3 +1607,5 @@ SongGroupEditor::SongGroupEditor(QWidget* parent) m_tabs.setCurrentIndex(0); } + +SongGroupEditor::~SongGroupEditor() = default; diff --git a/Editor/SongGroupEditor.hpp b/Editor/SongGroupEditor.hpp index 3a4c807..845b800 100644 --- a/Editor/SongGroupEditor.hpp +++ b/Editor/SongGroupEditor.hpp @@ -1,18 +1,29 @@ #pragma once -#include "EditorWidget.hpp" +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include "amuse/Sequencer.hpp" + +#include "EditorWidget.hpp" +#include "ProjectModel.hpp" + +#include +#include +#include class SetupTableView; @@ -23,9 +34,12 @@ protected: public: explicit PageObjectDelegate(QObject* parent = Q_NULLPTR); + ~PageObjectDelegate() override; + QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const override; void setEditorData(QWidget* editor, const QModelIndex& index) const override; void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override; + private slots: void objIndexChanged(); }; @@ -38,11 +52,15 @@ class MIDIFileFieldWidget : public QWidget { public: explicit MIDIFileFieldWidget(QWidget* parent = Q_NULLPTR); + ~MIDIFileFieldWidget() override; + QString path() const { return m_le.text(); } void setPath(const QString& path) { m_le.setText(path); } + public slots: void buttonPressed(); void fileDialogOpened(const QString& path); + signals: void pathChanged(); }; @@ -54,17 +72,21 @@ class MIDIFileDelegate : public QStyledItemDelegate { public: explicit MIDIFileDelegate(SetupTableView* parent = Q_NULLPTR); + ~MIDIFileDelegate() override; + QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const override; void destroyEditor(QWidget* editor, const QModelIndex& index) const override; void setEditorData(QWidget* editor, const QModelIndex& index) const override; void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override; bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index) override; + private slots: void doExportMIDI(); void _doExportMIDI(const QString& path); void doExportSNG(); void _doExportSNG(const QString& path); + public slots: void pathChanged(); }; @@ -92,6 +114,8 @@ class PageModel : public QAbstractTableModel { public: explicit PageModel(bool drum, QObject* parent = Q_NULLPTR); + ~PageModel() override; + void loadData(ProjectModel::SongGroupNode* node); void unloadData(); @@ -138,6 +162,8 @@ class SetupListModel : public QAbstractTableModel { public: explicit SetupListModel(QObject* parent = Q_NULLPTR); + ~SetupListModel() override; + void loadData(ProjectModel::SongGroupNode* node); void unloadData(); @@ -159,6 +185,8 @@ class SetupModel : public QAbstractTableModel { public: explicit SetupModel(QObject* parent = Q_NULLPTR); + ~SetupModel() override; + void loadData(std::pair>* data); void unloadData(); @@ -180,6 +208,8 @@ class PageTableView : public QTableView { public: explicit PageTableView(QWidget* parent = Q_NULLPTR); + ~PageTableView() override; + void setModel(QAbstractItemModel* model) override; void deleteSelection(); }; @@ -197,6 +227,8 @@ class SetupTableView : public QSplitter { public: explicit SetupTableView(QWidget* parent = Q_NULLPTR); + ~SetupTableView() override; + void setModel(QAbstractItemModel* list, QAbstractItemModel* table); void deleteSelection(); void showEvent(QShowEvent* event) override; @@ -264,6 +296,8 @@ class SongGroupEditor : public EditorWidget { public: explicit SongGroupEditor(QWidget* parent = Q_NULLPTR); + ~SongGroupEditor() override; + bool loadData(ProjectModel::SongGroupNode* node); void unloadData() override; ProjectModel::INode* currentNode() const override; @@ -271,6 +305,7 @@ public: void resizeEvent(QResizeEvent* ev) override; QTableView* getSetupListView() const { return m_setupTable->m_listView; } AmuseItemEditFlags itemEditFlags() const override; + private slots: void doAdd(); void doSelectionChanged(); diff --git a/Editor/SoundGroupEditor.cpp b/Editor/SoundGroupEditor.cpp index 95238b9..076f30b 100644 --- a/Editor/SoundGroupEditor.cpp +++ b/Editor/SoundGroupEditor.cpp @@ -115,6 +115,8 @@ public: SFXObjectDelegate::SFXObjectDelegate(QObject* parent) : BaseObjectDelegate(parent) {} +SFXObjectDelegate::~SFXObjectDelegate() = default; + ProjectModel::INode* SFXObjectDelegate::getNode(const QAbstractItemModel* __model, const QModelIndex& index) const { const SFXModel* model = static_cast(__model); auto entry = model->m_sorted[index.row()]; @@ -458,6 +460,8 @@ std::tuple SFXModel:: SFXModel::SFXModel(QObject* parent) : QAbstractTableModel(parent) {} +SFXModel::~SFXModel() = default; + void SFXTableView::deleteSelection() { QModelIndexList list = selectionModel()->selectedRows(); if (list.isEmpty()) @@ -507,6 +511,8 @@ SFXTableView::SFXTableView(QWidget* parent) : QTableView(parent) { setItemDelegateForColumn(6, &m_127Delegate); } +SFXTableView::~SFXTableView() = default; + void SFXPlayerWidget::clicked() { if (!m_vox) { m_vox = g_MainWindow->startSFX(m_groupId, m_sfxId); @@ -634,3 +640,5 @@ SoundGroupEditor::SoundGroupEditor(QWidget* parent) m_addRemoveButtons.removeAction()->setToolTip(tr("Remove selected SFX entries")); connect(m_addRemoveButtons.removeAction(), &QAction::triggered, this, &SoundGroupEditor::itemDeleteAction); } + +SoundGroupEditor::~SoundGroupEditor() = default; diff --git a/Editor/SoundGroupEditor.hpp b/Editor/SoundGroupEditor.hpp index 92e7655..e274135 100644 --- a/Editor/SoundGroupEditor.hpp +++ b/Editor/SoundGroupEditor.hpp @@ -1,9 +1,20 @@ #pragma once -#include "EditorWidget.hpp" +#include +#include +#include + +#include #include #include -#include "amuse/Voice.hpp" +#include + +#include "EditorWidget.hpp" +#include "ProjectModel.hpp" + +#include +#include +#include class SFXObjectDelegate : public BaseObjectDelegate { Q_OBJECT @@ -12,9 +23,12 @@ protected: public: explicit SFXObjectDelegate(QObject* parent = Q_NULLPTR); + ~SFXObjectDelegate() override; + QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const override; void setEditorData(QWidget* editor, const QModelIndex& index) const override; void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override; + private slots: void objIndexChanged(); }; @@ -50,6 +64,8 @@ class SFXModel : public QAbstractTableModel { public: explicit SFXModel(QObject* parent = Q_NULLPTR); + ~SFXModel() override; + void loadData(ProjectModel::SoundGroupNode* node); void unloadData(); @@ -73,6 +89,8 @@ class SFXTableView : public QTableView { public: explicit SFXTableView(QWidget* parent = Q_NULLPTR); + ~SFXTableView() override; + void setModel(QAbstractItemModel* model) override; void deleteSelection(); }; @@ -108,6 +126,8 @@ class SoundGroupEditor : public EditorWidget { public: explicit SoundGroupEditor(QWidget* parent = Q_NULLPTR); + ~SoundGroupEditor() override; + bool loadData(ProjectModel::SoundGroupNode* node); void unloadData() override; ProjectModel::INode* currentNode() const override; @@ -115,6 +135,7 @@ public: void resizeEvent(QResizeEvent* ev) override; QTableView* getSFXListView() const { return m_sfxTable; } AmuseItemEditFlags itemEditFlags() const override; + private slots: void rowsInserted(const QModelIndex& parent, int first, int last); void rowsMoved(const QModelIndex& parent, int start, int end, const QModelIndex& destination, int row); diff --git a/Editor/SoundMacroEditor.cpp b/Editor/SoundMacroEditor.cpp index a71cb31..d99f4fa 100644 --- a/Editor/SoundMacroEditor.cpp +++ b/Editor/SoundMacroEditor.cpp @@ -1,14 +1,17 @@ #include "SoundMacroEditor.hpp" -#include "MainWindow.hpp" + +#include +#include +#include +#include #include #include -#include -#include -#include #include #include -#include -#include +#include +#include + +#include "MainWindow.hpp" TargetButton::TargetButton(QWidget* parent) : QPushButton(parent) { QIcon targetIcon(QStringLiteral(":/icons/IconSoundMacroTarget.svg")); @@ -267,6 +270,8 @@ CommandWidget::CommandWidget(QWidget* parent, amuse::SoundMacro::ICmd* cmd, Soun CommandWidget::CommandWidget(QWidget* parent, amuse::SoundMacro::CmdOp op, SoundMacroListing* listing) : CommandWidget(parent, nullptr, op, listing) {} +CommandWidget::~CommandWidget() = default; + class ValChangedUndoCommand : public EditorUndoCommand { amuse::SoundMacro::ICmd* m_cmd; const amuse::SoundMacro::CmdIntrospection::Field& m_field; @@ -500,6 +505,8 @@ CommandWidgetContainer::CommandWidgetContainer(QWidget* parent, _Args&&... args) setLayout(outerLayout); } +CommandWidgetContainer::~CommandWidgetContainer() = default; + void SoundMacroListing::startAutoscroll(QWidget* source, QMouseEvent* event, int delta) { if (m_autoscrollTimer == -1) m_autoscrollTimer = startTimer(50); @@ -781,6 +788,8 @@ SoundMacroListing::SoundMacroListing(QWidget* parent) : QWidget(parent), m_layou reindex(); } +SoundMacroListing::~SoundMacroListing() = default; + CatalogueItem::CatalogueItem(amuse::SoundMacro::CmdOp op, const QString& name, const QString& doc, QWidget* parent) : QWidget(parent), m_op(op), m_label(name) { QHBoxLayout* layout = new QHBoxLayout; @@ -809,6 +818,8 @@ CatalogueItem::CatalogueItem(const CatalogueItem& other, QWidget* parent) : QWid setLayout(layout); } +CatalogueItem::~CatalogueItem() = default; + static const char* CategoryStrings[] = { QT_TRANSLATE_NOOP("SoundMacroCatalogue", "Control"), QT_TRANSLATE_NOOP("SoundMacroCatalogue", "Pitch"), QT_TRANSLATE_NOOP("SoundMacroCatalogue", "Sample"), QT_TRANSLATE_NOOP("SoundMacroCatalogue", "Setup"), @@ -1045,3 +1056,5 @@ SoundMacroEditor::SoundMacroEditor(QWidget* parent) layout->addWidget(m_splitter); setLayout(layout); } + +SoundMacroEditor::~SoundMacroEditor() = default; diff --git a/Editor/SoundMacroEditor.hpp b/Editor/SoundMacroEditor.hpp index fd0f85f..49415ef 100644 --- a/Editor/SoundMacroEditor.hpp +++ b/Editor/SoundMacroEditor.hpp @@ -1,20 +1,25 @@ #pragma once -#include "EditorWidget.hpp" -#include -#include -#include -#include #include #include -#include -#include -#include #include +#include +#include +#include "EditorWidget.hpp" +#include "ProjectModel.hpp" + +#include +#include + +class CatalogueItem; class SoundMacroEditor; class SoundMacroListing; -class CatalogueItem; + +class QLayoutItem; +class QPropertyAnimation; +class QSplitter; +class QVBoxLayout; class TargetButton : public QPushButton { Q_OBJECT @@ -72,6 +77,8 @@ private: public: CommandWidget(QWidget* parent, amuse::SoundMacro::ICmd* cmd, SoundMacroListing* listing); CommandWidget(QWidget* parent, amuse::SoundMacro::CmdOp op, SoundMacroListing* listing); + ~CommandWidget() override; + void paintEvent(QPaintEvent* event) override; QString getText() const { return m_titleLabel.text(); } }; @@ -85,12 +92,14 @@ class CommandWidgetContainer : public QWidget { void animateClosed(); void snapOpen(); void snapClosed(); + private slots: void animationDestroyed(); public: template CommandWidgetContainer(QWidget* parent, _Args&&... args); + ~CommandWidgetContainer() override; }; class SoundMacroListing : public QWidget { @@ -123,6 +132,8 @@ class SoundMacroListing : public QWidget { public: explicit SoundMacroListing(QWidget* parent = Q_NULLPTR); + ~SoundMacroListing() override; + bool loadData(ProjectModel::SoundMacroNode* node); void unloadData(); ProjectModel::INode* currentNode() const; @@ -139,6 +150,8 @@ public: explicit CatalogueItem(amuse::SoundMacro::CmdOp op, const QString& name, const QString& doc, QWidget* parent = Q_NULLPTR); explicit CatalogueItem(const CatalogueItem& other, QWidget* parent = Q_NULLPTR); + ~CatalogueItem() override; + amuse::SoundMacro::CmdOp getCmdOp() const { return m_op; } QString getText() const { return m_label.text(); } }; @@ -171,6 +184,8 @@ class SoundMacroEditor : public EditorWidget { public: explicit SoundMacroEditor(QWidget* parent = Q_NULLPTR); + ~SoundMacroEditor() override; + bool loadData(ProjectModel::SoundMacroNode* node); void unloadData() override; ProjectModel::INode* currentNode() const override; diff --git a/Editor/StatusBarWidget.cpp b/Editor/StatusBarWidget.cpp index 5cb0fc0..572fa70 100644 --- a/Editor/StatusBarWidget.cpp +++ b/Editor/StatusBarWidget.cpp @@ -49,6 +49,8 @@ StatusBarWidget::StatusBarWidget(QWidget* parent) addPermanentWidget(&m_volumeSlider); } +StatusBarWidget::~StatusBarWidget() = default; + void StatusBarWidget::setVoiceCount(int voices) { if (voices != m_cachedVoiceCount) { m_voiceCount.setText(QString::number(voices)); diff --git a/Editor/StatusBarWidget.hpp b/Editor/StatusBarWidget.hpp index 9750513..2bbee56 100644 --- a/Editor/StatusBarWidget.hpp +++ b/Editor/StatusBarWidget.hpp @@ -1,11 +1,10 @@ #pragma once -#include #include +#include #include #include -#include -#include +#include class StatusBarFocus; @@ -43,6 +42,8 @@ class StatusBarWidget : public QStatusBar { public: explicit StatusBarWidget(QWidget* parent = Q_NULLPTR); + ~StatusBarWidget() override; + void setNormalMessage(const QString& message) { m_normalMessage.setText(message); } void setVoiceCount(int voices); diff --git a/Editor/StudioSetupWidget.cpp b/Editor/StudioSetupWidget.cpp index cc49aad..f8fda5f 100644 --- a/Editor/StudioSetupWidget.cpp +++ b/Editor/StudioSetupWidget.cpp @@ -1,11 +1,17 @@ #include "StudioSetupWidget.hpp" -#include "amuse/EffectChorus.hpp" -#include "amuse/EffectDelay.hpp" -#include "amuse/EffectReverb.hpp" + +#include #include #include #include +#include +#include +#include +#include +#include +#include + using namespace std::literals; static const EffectIntrospection ReverbStdIntrospective = { @@ -159,6 +165,8 @@ Uint32X8Popup::Uint32X8Popup(int min, int max, QWidget* parent) : QFrame(parent, setLayout(layout); } +Uint32X8Popup::~Uint32X8Popup() = default; + void Uint32X8Popup::setValue(int chanIdx, int val) { m_sliders[chanIdx]->setValue(val); } void Uint32X8Popup::doValueChanged(int val) { @@ -172,6 +180,8 @@ Uint32X8Button::Uint32X8Button(int min, int max, QWidget* parent) connect(this, &Uint32X8Button::pressed, this, &Uint32X8Button::onPressed); } +Uint32X8Button::~Uint32X8Button() = default; + void Uint32X8Button::paintEvent(QPaintEvent*) { QStylePainter painter(this); painter.setPen(palette().color(QPalette::Text)); @@ -291,6 +301,8 @@ EffectWidget::EffectWidget(QWidget* parent, amuse::EffectBaseTypeless* effect, a setLayout(mainLayout); } +EffectWidget::~EffectWidget() = default; + void EffectWidget::paintEvent(QPaintEvent* event) { /* Rounded frame */ QPainter painter(this); @@ -398,6 +410,8 @@ EffectWidgetContainer::EffectWidgetContainer(QWidget* parent, _Args&&... args) setLayout(outerLayout); } +EffectWidgetContainer::~EffectWidgetContainer() = default; + void EffectListing::startAutoscroll(QWidget* source, QMouseEvent* event, int delta) { if (m_autoscrollTimer == -1) m_autoscrollTimer = startTimer(50); @@ -624,6 +638,8 @@ EffectListing::EffectListing(QWidget* parent) : QWidget(parent), m_layout(new QV reindex(); } +EffectListing::~EffectListing() = default; + EffectCatalogueItem::EffectCatalogueItem(amuse::EffectType type, const QString& name, const QString& doc, QWidget* parent) : QWidget(parent), m_type(type), m_iconLab(this), m_label(name, this) { @@ -654,6 +670,8 @@ EffectCatalogueItem::EffectCatalogueItem(const EffectCatalogueItem& other, QWidg setLayout(layout); } +EffectCatalogueItem::~EffectCatalogueItem() = default; + static const char* EffectStrings[] = { QT_TRANSLATE_NOOP("EffectCatalogue", "Reverb Standard"), QT_TRANSLATE_NOOP("EffectCatalogue", "Reverb High"), QT_TRANSLATE_NOOP("EffectCatalogue", "Delay"), QT_TRANSLATE_NOOP("EffectCatalogue", "Chorus")}; @@ -875,3 +893,5 @@ StudioSetupWidget::StudioSetupWidget(QWidget* parent) layout->addWidget(m_splitter); setLayout(layout); } + +StudioSetupWidget::~StudioSetupWidget() = default; diff --git a/Editor/StudioSetupWidget.hpp b/Editor/StudioSetupWidget.hpp index 86f9d06..998f3b0 100644 --- a/Editor/StudioSetupWidget.hpp +++ b/Editor/StudioSetupWidget.hpp @@ -1,19 +1,31 @@ #pragma once -#include "EditorWidget.hpp" -#include -#include +#include + #include -#include #include -#include +#include #include +#include #include #include -#include "amuse/Studio.hpp" +#include +#include +#include +#include + +#include "EditorWidget.hpp" class EffectListing; +namespace amuse { +class EffectBaseTypeless; +class Studio; +class Submix; + +enum class EffectType; +} // namespace amuse + struct EffectIntrospection { struct Field { enum class Type { Invalid, UInt32, UInt32x8, Float }; @@ -33,9 +45,13 @@ class Uint32X8Popup : public QFrame { public: explicit Uint32X8Popup(int min, int max, QWidget* parent = Q_NULLPTR); + ~Uint32X8Popup() override; + void setValue(int chanIdx, int val); + private slots: void doValueChanged(int val); + signals: void valueChanged(int chanIdx, int val); }; @@ -46,9 +62,12 @@ class Uint32X8Button : public QPushButton { public: explicit Uint32X8Button(int min, int max, QWidget* parent = Q_NULLPTR); + ~Uint32X8Button() override; + void paintEvent(QPaintEvent* event) override; Uint32X8Popup* popup() const { return m_popup; } QStyleOptionComboBox comboStyleOption() const; + private slots: void onPressed(); }; @@ -64,6 +83,7 @@ class EffectWidget : public QWidget { amuse::EffectBaseTypeless* m_effect; const EffectIntrospection* m_introspection; void setIndex(int index); + private slots: void numChanged(int); void numChanged(double); @@ -72,6 +92,7 @@ private slots: private: explicit EffectWidget(QWidget* parent, amuse::EffectBaseTypeless* effect, amuse::EffectType type); + ~EffectWidget() override; public: EffectListing* getParent() const; @@ -96,6 +117,7 @@ private slots: public: template EffectWidgetContainer(QWidget* parent, _Args&&... args); + ~EffectWidgetContainer() override; }; class EffectListing : public QWidget { @@ -128,6 +150,8 @@ class EffectListing : public QWidget { public: explicit EffectListing(QWidget* parent = Q_NULLPTR); + ~EffectListing() override; + bool loadData(amuse::Submix* submix); void unloadData(); void timerEvent(QTimerEvent* event) override; @@ -143,6 +167,8 @@ public: explicit EffectCatalogueItem(amuse::EffectType type, const QString& name, const QString& doc, QWidget* parent = Q_NULLPTR); explicit EffectCatalogueItem(const EffectCatalogueItem& other, QWidget* parent = Q_NULLPTR); + ~EffectCatalogueItem() override; + amuse::EffectType getType() const { return m_type; } QString getText() const { return m_label.text(); } }; @@ -173,6 +199,8 @@ class StudioSetupWidget : public QWidget { public: explicit StudioSetupWidget(QWidget* parent = Q_NULLPTR); + ~StudioSetupWidget() override; + bool loadData(amuse::Studio* studio); void unloadData();