amuse/Editor/EditorWidget.hpp

47 lines
1.1 KiB
C++
Raw Normal View History

#ifndef AMUSE_EDITOR_WIDGET_HPP
#define AMUSE_EDITOR_WIDGET_HPP
#include <QWidget>
#include <QUndoCommand>
#include <QApplication>
2018-07-18 07:39:26 +00:00
#include "ProjectModel.hpp"
class EditorWidget : public QWidget
{
Q_OBJECT
public:
explicit EditorWidget(QWidget* parent = Q_NULLPTR);
2018-07-18 07:39:26 +00:00
virtual bool valid() const { return true; }
virtual void unloadData() {}
2018-07-28 04:34:29 +00:00
virtual ProjectModel::INode* currentNode() const { return nullptr; }
};
class EditorUndoCommand : public QUndoCommand
{
protected:
2018-07-30 06:20:03 +00:00
amuse::ObjToken<ProjectModel::INode> m_node;
enum class Id
{
SMChangeVal,
2018-08-03 03:45:48 +00:00
SampLoop,
2018-08-04 02:07:34 +00:00
SampPitch,
ADSRAttack,
ADSRDecay,
ADSRSustain,
ADSRAttackAndDecay,
ADSRDecayAndSustain,
ADSRRelease,
ADSRDLS,
ADSRVelToAttack,
ADSRKeyToDecay
};
public:
2018-07-30 06:20:03 +00:00
EditorUndoCommand(amuse::ObjToken<ProjectModel::INode> node,
const QString& text, QUndoCommand* parent = nullptr)
: QUndoCommand(text, parent), m_node(node) {}
void undo();
void redo();
};
#endif //AMUSE_EDITOR_WIDGET_HPP