mirror of https://github.com/AxioDL/amuse.git
General: Make use of override where applicable
Continues the use of override.
This commit is contained in:
parent
529efa72b4
commit
67c64a2d4e
|
@ -271,7 +271,7 @@ class ADSRAttackUndoCommand : public EditorUndoCommand {
|
|||
public:
|
||||
ADSRAttackUndoCommand(double redoVal, amuse::ObjToken<ProjectModel::ADSRNode> node)
|
||||
: EditorUndoCommand(node.get(), ADSRControls::tr("Change Attack")), m_redoVal(redoVal) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
amuse::ITable& table = **m_node.cast<ProjectModel::ADSRNode>()->m_obj;
|
||||
if (table.Isa() == amuse::ITable::Type::ADSRDLS) {
|
||||
|
@ -283,7 +283,7 @@ public:
|
|||
}
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
amuse::ITable& table = **m_node.cast<ProjectModel::ADSRNode>()->m_obj;
|
||||
if (table.Isa() == amuse::ITable::Type::ADSRDLS) {
|
||||
amuse::ADSRDLS& adsr = static_cast<amuse::ADSRDLS&>(table);
|
||||
|
@ -297,14 +297,14 @@ public:
|
|||
if (m_undid)
|
||||
EditorUndoCommand::redo();
|
||||
}
|
||||
bool mergeWith(const QUndoCommand* other) {
|
||||
bool mergeWith(const QUndoCommand* other) override {
|
||||
if (other->id() == id()) {
|
||||
m_redoVal = static_cast<const ADSRAttackUndoCommand*>(other)->m_redoVal;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
int id() const { return int(Id::ADSRAttack); }
|
||||
int id() const override { return int(Id::ADSRAttack); }
|
||||
};
|
||||
|
||||
void ADSRControls::attackChanged(double val) {
|
||||
|
@ -322,7 +322,7 @@ class ADSRDecayUndoCommand : public EditorUndoCommand {
|
|||
public:
|
||||
ADSRDecayUndoCommand(double redoVal, amuse::ObjToken<ProjectModel::ADSRNode> node)
|
||||
: EditorUndoCommand(node.get(), ADSRControls::tr("Change Decay")), m_redoVal(redoVal) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
amuse::ITable& table = **m_node.cast<ProjectModel::ADSRNode>()->m_obj;
|
||||
if (table.Isa() == amuse::ITable::Type::ADSRDLS) {
|
||||
|
@ -334,7 +334,7 @@ public:
|
|||
}
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
amuse::ITable& table = **m_node.cast<ProjectModel::ADSRNode>()->m_obj;
|
||||
if (table.Isa() == amuse::ITable::Type::ADSRDLS) {
|
||||
amuse::ADSRDLS& adsr = static_cast<amuse::ADSRDLS&>(table);
|
||||
|
@ -348,14 +348,14 @@ public:
|
|||
if (m_undid)
|
||||
EditorUndoCommand::redo();
|
||||
}
|
||||
bool mergeWith(const QUndoCommand* other) {
|
||||
bool mergeWith(const QUndoCommand* other) override {
|
||||
if (other->id() == id()) {
|
||||
m_redoVal = static_cast<const ADSRDecayUndoCommand*>(other)->m_redoVal;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
int id() const { return int(Id::ADSRDecay); }
|
||||
int id() const override { return int(Id::ADSRDecay); }
|
||||
};
|
||||
|
||||
void ADSRControls::decayChanged(double val) {
|
||||
|
@ -373,7 +373,7 @@ class ADSRSustainUndoCommand : public EditorUndoCommand {
|
|||
public:
|
||||
ADSRSustainUndoCommand(double redoVal, amuse::ObjToken<ProjectModel::ADSRNode> node)
|
||||
: EditorUndoCommand(node.get(), ADSRControls::tr("Change Sustain")), m_redoVal(redoVal) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
amuse::ITable& table = **m_node.cast<ProjectModel::ADSRNode>()->m_obj;
|
||||
if (table.Isa() == amuse::ITable::Type::ADSRDLS) {
|
||||
|
@ -385,7 +385,7 @@ public:
|
|||
}
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
amuse::ITable& table = **m_node.cast<ProjectModel::ADSRNode>()->m_obj;
|
||||
if (table.Isa() == amuse::ITable::Type::ADSRDLS) {
|
||||
amuse::ADSRDLS& adsr = static_cast<amuse::ADSRDLS&>(table);
|
||||
|
@ -399,14 +399,14 @@ public:
|
|||
if (m_undid)
|
||||
EditorUndoCommand::redo();
|
||||
}
|
||||
bool mergeWith(const QUndoCommand* other) {
|
||||
bool mergeWith(const QUndoCommand* other) override {
|
||||
if (other->id() == id()) {
|
||||
m_redoVal = static_cast<const ADSRSustainUndoCommand*>(other)->m_redoVal;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
int id() const { return int(Id::ADSRSustain); }
|
||||
int id() const override { return int(Id::ADSRSustain); }
|
||||
};
|
||||
|
||||
void ADSRControls::sustainChanged(double val) {
|
||||
|
@ -430,7 +430,7 @@ public:
|
|||
, m_redoAttack(redoAttack)
|
||||
, m_redoDecay(redoDecay)
|
||||
, m_cycleCount(cycleCount) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
amuse::ITable& table = **m_node.cast<ProjectModel::ADSRNode>()->m_obj;
|
||||
if (table.Isa() == amuse::ITable::Type::ADSRDLS) {
|
||||
|
@ -444,7 +444,7 @@ public:
|
|||
}
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
amuse::ITable& table = **m_node.cast<ProjectModel::ADSRNode>()->m_obj;
|
||||
if (table.Isa() == amuse::ITable::Type::ADSRDLS) {
|
||||
amuse::ADSRDLS& adsr = static_cast<amuse::ADSRDLS&>(table);
|
||||
|
@ -462,7 +462,7 @@ public:
|
|||
if (m_undid)
|
||||
EditorUndoCommand::redo();
|
||||
}
|
||||
bool mergeWith(const QUndoCommand* other) {
|
||||
bool mergeWith(const QUndoCommand* other) override {
|
||||
if (other->id() == id() && m_cycleCount == static_cast<const ADSRAttackAndDecayUndoCommand*>(other)->m_cycleCount) {
|
||||
m_redoAttack = static_cast<const ADSRAttackAndDecayUndoCommand*>(other)->m_redoAttack;
|
||||
m_redoDecay = static_cast<const ADSRAttackAndDecayUndoCommand*>(other)->m_redoDecay;
|
||||
|
@ -470,7 +470,7 @@ public:
|
|||
}
|
||||
return false;
|
||||
}
|
||||
int id() const { return int(Id::ADSRAttackAndDecay); }
|
||||
int id() const override { return int(Id::ADSRAttackAndDecay); }
|
||||
};
|
||||
|
||||
void ADSRControls::setAttackAndDecay(double attack, double decay, uint64_t cycleCount) {
|
||||
|
@ -498,7 +498,7 @@ public:
|
|||
, m_redoDecay(redoDecay)
|
||||
, m_redoSustain(redoSustain)
|
||||
, m_cycleCount(cycleCount) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
amuse::ITable& table = **m_node.cast<ProjectModel::ADSRNode>()->m_obj;
|
||||
if (table.Isa() == amuse::ITable::Type::ADSRDLS) {
|
||||
|
@ -512,7 +512,7 @@ public:
|
|||
}
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
amuse::ITable& table = **m_node.cast<ProjectModel::ADSRNode>()->m_obj;
|
||||
if (table.Isa() == amuse::ITable::Type::ADSRDLS) {
|
||||
amuse::ADSRDLS& adsr = static_cast<amuse::ADSRDLS&>(table);
|
||||
|
@ -530,7 +530,7 @@ public:
|
|||
if (m_undid)
|
||||
EditorUndoCommand::redo();
|
||||
}
|
||||
bool mergeWith(const QUndoCommand* other) {
|
||||
bool mergeWith(const QUndoCommand* other) override {
|
||||
if (other->id() == id() &&
|
||||
m_cycleCount == static_cast<const ADSRDecayAndSustainUndoCommand*>(other)->m_cycleCount) {
|
||||
m_redoDecay = static_cast<const ADSRDecayAndSustainUndoCommand*>(other)->m_redoDecay;
|
||||
|
@ -539,7 +539,7 @@ public:
|
|||
}
|
||||
return false;
|
||||
}
|
||||
int id() const { return int(Id::ADSRDecayAndSustain); }
|
||||
int id() const override { return int(Id::ADSRDecayAndSustain); }
|
||||
};
|
||||
|
||||
void ADSRControls::setDecayAndSustain(double decay, double sustain, uint64_t cycleCount) {
|
||||
|
@ -562,7 +562,7 @@ class ADSRReleaseUndoCommand : public EditorUndoCommand {
|
|||
public:
|
||||
ADSRReleaseUndoCommand(double redoVal, uint64_t cycleCount, amuse::ObjToken<ProjectModel::ADSRNode> node)
|
||||
: EditorUndoCommand(node.get(), ADSRControls::tr("Change Release")), m_redoVal(redoVal), m_cycleCount(cycleCount) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
amuse::ITable& table = **m_node.cast<ProjectModel::ADSRNode>()->m_obj;
|
||||
if (table.Isa() == amuse::ITable::Type::ADSRDLS) {
|
||||
|
@ -574,7 +574,7 @@ public:
|
|||
}
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
amuse::ITable& table = **m_node.cast<ProjectModel::ADSRNode>()->m_obj;
|
||||
if (table.Isa() == amuse::ITable::Type::ADSRDLS) {
|
||||
amuse::ADSRDLS& adsr = static_cast<amuse::ADSRDLS&>(table);
|
||||
|
@ -588,14 +588,14 @@ public:
|
|||
if (m_undid)
|
||||
EditorUndoCommand::redo();
|
||||
}
|
||||
bool mergeWith(const QUndoCommand* other) {
|
||||
bool mergeWith(const QUndoCommand* other) override {
|
||||
if (other->id() == id() && m_cycleCount == static_cast<const ADSRReleaseUndoCommand*>(other)->m_cycleCount) {
|
||||
m_redoVal = static_cast<const ADSRReleaseUndoCommand*>(other)->m_redoVal;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
int id() const { return int(Id::ADSRRelease); }
|
||||
int id() const override { return int(Id::ADSRRelease); }
|
||||
};
|
||||
|
||||
void ADSRControls::setRelease(double release, uint64_t cycleCount) {
|
||||
|
@ -648,7 +648,7 @@ public:
|
|||
, m_redoVal(redoVal)
|
||||
, m_redoVelToAttack(redoVelToAttack)
|
||||
, m_redoKeyToDecay(redoKeyToDecay) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
std::unique_ptr<amuse::ITable>& table = *m_node.cast<ProjectModel::ADSRNode>()->m_obj;
|
||||
if ((table->Isa() == amuse::ITable::Type::ADSRDLS && !m_redoVal) ||
|
||||
|
@ -666,7 +666,7 @@ public:
|
|||
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
std::unique_ptr<amuse::ITable>& table = *m_node.cast<ProjectModel::ADSRNode>()->m_obj;
|
||||
if ((table->Isa() == amuse::ITable::Type::ADSRDLS && m_redoVal) ||
|
||||
(table->Isa() == amuse::ITable::Type::ADSR && !m_redoVal))
|
||||
|
@ -688,7 +688,7 @@ public:
|
|||
if (m_undid)
|
||||
EditorUndoCommand::redo();
|
||||
}
|
||||
bool mergeWith(const QUndoCommand* other) {
|
||||
bool mergeWith(const QUndoCommand* other) override {
|
||||
if (other->id() == id()) {
|
||||
m_redoVal = static_cast<const ADSRDLSUndoCommand*>(other)->m_redoVal;
|
||||
m_redoVelToAttack = static_cast<const ADSRDLSUndoCommand*>(other)->m_redoVelToAttack;
|
||||
|
@ -697,7 +697,7 @@ public:
|
|||
}
|
||||
return false;
|
||||
}
|
||||
int id() const { return int(Id::ADSRDLS); }
|
||||
int id() const override { return int(Id::ADSRDLS); }
|
||||
};
|
||||
|
||||
void ADSRControls::dlsStateChanged(int state) {
|
||||
|
@ -721,7 +721,7 @@ class ADSRVelToAttackUndoCommand : public EditorUndoCommand {
|
|||
public:
|
||||
ADSRVelToAttackUndoCommand(double redoVal, amuse::ObjToken<ProjectModel::ADSRNode> node)
|
||||
: EditorUndoCommand(node.get(), ADSRControls::tr("Change Vel To Attack")), m_redoVal(redoVal) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
amuse::ITable& table = **m_node.cast<ProjectModel::ADSRNode>()->m_obj;
|
||||
if (table.Isa() == amuse::ITable::Type::ADSRDLS) {
|
||||
|
@ -730,7 +730,7 @@ public:
|
|||
}
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
amuse::ITable& table = **m_node.cast<ProjectModel::ADSRNode>()->m_obj;
|
||||
if (table.Isa() == amuse::ITable::Type::ADSRDLS) {
|
||||
amuse::ADSRDLS& adsr = static_cast<amuse::ADSRDLS&>(table);
|
||||
|
@ -740,14 +740,14 @@ public:
|
|||
if (m_undid)
|
||||
EditorUndoCommand::redo();
|
||||
}
|
||||
bool mergeWith(const QUndoCommand* other) {
|
||||
bool mergeWith(const QUndoCommand* other) override {
|
||||
if (other->id() == id()) {
|
||||
m_redoVal = static_cast<const ADSRVelToAttackUndoCommand*>(other)->m_redoVal;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
int id() const { return int(Id::ADSRVelToAttack); }
|
||||
int id() const override { return int(Id::ADSRVelToAttack); }
|
||||
};
|
||||
|
||||
void ADSRControls::velToAttackChanged(double val) {
|
||||
|
@ -765,7 +765,7 @@ class ADSRKeyToDecayUndoCommand : public EditorUndoCommand {
|
|||
public:
|
||||
ADSRKeyToDecayUndoCommand(double redoVal, amuse::ObjToken<ProjectModel::ADSRNode> node)
|
||||
: EditorUndoCommand(node.get(), ADSRControls::tr("Change Key To Decay")), m_redoVal(redoVal) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
amuse::ITable& table = **m_node.cast<ProjectModel::ADSRNode>()->m_obj;
|
||||
if (table.Isa() == amuse::ITable::Type::ADSRDLS) {
|
||||
|
@ -774,7 +774,7 @@ public:
|
|||
}
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
amuse::ITable& table = **m_node.cast<ProjectModel::ADSRNode>()->m_obj;
|
||||
if (table.Isa() == amuse::ITable::Type::ADSRDLS) {
|
||||
amuse::ADSRDLS& adsr = static_cast<amuse::ADSRDLS&>(table);
|
||||
|
@ -784,14 +784,14 @@ public:
|
|||
if (m_undid)
|
||||
EditorUndoCommand::redo();
|
||||
}
|
||||
bool mergeWith(const QUndoCommand* other) {
|
||||
bool mergeWith(const QUndoCommand* other) override {
|
||||
if (other->id() == id()) {
|
||||
m_redoVal = static_cast<const ADSRKeyToDecayUndoCommand*>(other)->m_redoVal;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
int id() const { return int(Id::ADSRKeyToDecay); }
|
||||
int id() const override { return int(Id::ADSRKeyToDecay); }
|
||||
};
|
||||
|
||||
void ADSRControls::keyToDecayChanged(double val) {
|
||||
|
|
|
@ -27,10 +27,10 @@ public:
|
|||
void unloadData();
|
||||
ProjectModel::INode* currentNode() const;
|
||||
|
||||
void paintEvent(QPaintEvent* ev);
|
||||
void mousePressEvent(QMouseEvent* ev);
|
||||
void mouseReleaseEvent(QMouseEvent* ev);
|
||||
void mouseMoveEvent(QMouseEvent* ev);
|
||||
void paintEvent(QPaintEvent* ev) override;
|
||||
void mousePressEvent(QMouseEvent* ev) override;
|
||||
void mouseReleaseEvent(QMouseEvent* ev) override;
|
||||
void mouseMoveEvent(QMouseEvent* ev) override;
|
||||
};
|
||||
|
||||
class ADSRControls : public QFrame {
|
||||
|
@ -75,6 +75,6 @@ class ADSREditor : public EditorWidget {
|
|||
public:
|
||||
explicit ADSREditor(QWidget* parent = Q_NULLPTR);
|
||||
bool loadData(ProjectModel::ADSRNode* node);
|
||||
void unloadData();
|
||||
ProjectModel::INode* currentNode() const;
|
||||
void unloadData() override;
|
||||
ProjectModel::INode* currentNode() const override;
|
||||
};
|
||||
|
|
|
@ -17,7 +17,7 @@ public:
|
|||
: EditorUndoCommand(node.get(), CurveControls::tr("Edit Curve")), m_usedExpr(usedExpr) {
|
||||
std::memcpy(m_redoData, redoData, 128);
|
||||
}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
amuse::ITable& table = **m_node.cast<ProjectModel::CurveNode>()->m_obj;
|
||||
if (table.Isa() == amuse::ITable::Type::Curve) {
|
||||
|
@ -27,7 +27,7 @@ public:
|
|||
}
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
amuse::ITable& table = **m_node.cast<ProjectModel::CurveNode>()->m_obj;
|
||||
if (table.Isa() == amuse::ITable::Type::Curve) {
|
||||
amuse::Curve& curve = static_cast<amuse::Curve&>(table);
|
||||
|
@ -38,14 +38,14 @@ public:
|
|||
if (m_undid)
|
||||
EditorUndoCommand::redo();
|
||||
}
|
||||
bool mergeWith(const QUndoCommand* other) {
|
||||
bool mergeWith(const QUndoCommand* other) override {
|
||||
if (other->id() == id() && !m_usedExpr && !static_cast<const CurveEditUndoCommand*>(other)->m_usedExpr) {
|
||||
std::memcpy(m_redoData, static_cast<const CurveEditUndoCommand*>(other)->m_redoData, 128);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
int id() const { return int(Id::CurveEdit); }
|
||||
int id() const override { return int(Id::CurveEdit); }
|
||||
};
|
||||
|
||||
CurveEditor* CurveView::getEditor() const { return qobject_cast<CurveEditor*>(parentWidget()); }
|
||||
|
|
|
@ -25,9 +25,9 @@ public:
|
|||
void unloadData();
|
||||
ProjectModel::INode* currentNode() const;
|
||||
|
||||
void paintEvent(QPaintEvent* ev);
|
||||
void mousePressEvent(QMouseEvent* ev);
|
||||
void mouseMoveEvent(QMouseEvent* ev);
|
||||
void paintEvent(QPaintEvent* ev) override;
|
||||
void mousePressEvent(QMouseEvent* ev) override;
|
||||
void mouseMoveEvent(QMouseEvent* ev) override;
|
||||
};
|
||||
|
||||
class CurveControls : public QFrame {
|
||||
|
@ -43,7 +43,7 @@ public:
|
|||
explicit CurveControls(QWidget* parent = Q_NULLPTR);
|
||||
void loadData();
|
||||
void unloadData();
|
||||
void resizeEvent(QResizeEvent* ev);
|
||||
void resizeEvent(QResizeEvent* ev) override;
|
||||
public slots:
|
||||
void exprCommit();
|
||||
};
|
||||
|
@ -58,6 +58,6 @@ class CurveEditor : public EditorWidget {
|
|||
public:
|
||||
explicit CurveEditor(QWidget* parent = Q_NULLPTR);
|
||||
bool loadData(ProjectModel::CurveNode* node);
|
||||
void unloadData();
|
||||
ProjectModel::INode* currentNode() const;
|
||||
void unloadData() override;
|
||||
ProjectModel::INode* currentNode() const override;
|
||||
};
|
||||
|
|
|
@ -53,8 +53,8 @@ protected:
|
|||
public:
|
||||
EditorUndoCommand(amuse::ObjToken<ProjectModel::INode> node, const QString& text, QUndoCommand* parent = nullptr)
|
||||
: QUndoCommand(text, parent), m_node(node) {}
|
||||
void undo();
|
||||
void redo();
|
||||
void undo() override;
|
||||
void redo() override;
|
||||
};
|
||||
|
||||
class FieldSpinBox : public QSpinBox {
|
||||
|
@ -63,7 +63,7 @@ public:
|
|||
explicit FieldSpinBox(QWidget* parent = Q_NULLPTR) : QSpinBox(parent) {}
|
||||
|
||||
/* Don't scroll */
|
||||
void wheelEvent(QWheelEvent* event) { event->ignore(); }
|
||||
void wheelEvent(QWheelEvent* event) override { event->ignore(); }
|
||||
};
|
||||
|
||||
class FieldSlider : public QWidget {
|
||||
|
@ -75,7 +75,7 @@ public:
|
|||
explicit FieldSlider(QWidget* parent = Q_NULLPTR);
|
||||
|
||||
/* Don't scroll */
|
||||
void wheelEvent(QWheelEvent* event) { event->ignore(); }
|
||||
void wheelEvent(QWheelEvent* event) override { event->ignore(); }
|
||||
|
||||
int value() const { return m_slider.value(); }
|
||||
void setValue(int value) {
|
||||
|
@ -101,7 +101,7 @@ public:
|
|||
explicit FieldDoubleSlider(QWidget* parent = Q_NULLPTR);
|
||||
|
||||
/* Don't scroll */
|
||||
void wheelEvent(QWheelEvent* event) { event->ignore(); }
|
||||
void wheelEvent(QWheelEvent* event) override { event->ignore(); }
|
||||
|
||||
double value() const;
|
||||
void setValue(double value);
|
||||
|
@ -119,7 +119,7 @@ public:
|
|||
explicit FieldComboBox(QWidget* parent = Q_NULLPTR) : QComboBox(parent) {}
|
||||
|
||||
/* Don't scroll */
|
||||
void wheelEvent(QWheelEvent* event) { event->ignore(); }
|
||||
void wheelEvent(QWheelEvent* event) override { event->ignore(); }
|
||||
};
|
||||
|
||||
class FieldProjectNode : public QWidget {
|
||||
|
@ -136,7 +136,7 @@ public:
|
|||
void setCurrentIndex(int index) { m_comboBox.setCurrentIndex(index); }
|
||||
void showPopup() { m_comboBox.showPopup(); }
|
||||
ProjectModel::BasePoolObjectNode* currentNode() const;
|
||||
bool event(QEvent* ev);
|
||||
bool event(QEvent* ev) override;
|
||||
private slots:
|
||||
void _currentIndexChanged(int);
|
||||
public slots:
|
||||
|
@ -160,7 +160,7 @@ public:
|
|||
QModelIndex rootModelIndex() const { return m_comboBox.rootModelIndex(); }
|
||||
void showPopup() { m_comboBox.showPopup(); }
|
||||
ProjectModel::BasePoolObjectNode* currentNode() const;
|
||||
bool event(QEvent* ev);
|
||||
bool event(QEvent* ev) override;
|
||||
private slots:
|
||||
void _currentIndexChanged(int);
|
||||
public slots:
|
||||
|
@ -188,7 +188,7 @@ using EditorFieldPageObjectNode = EditorFieldNode<FieldPageObjectNode>;
|
|||
template <int MIN, int MAX>
|
||||
class RangedValueFactory : public QItemEditorFactory {
|
||||
public:
|
||||
QWidget* createEditor(int userType, QWidget* parent) const {
|
||||
QWidget* createEditor(int userType, QWidget* parent) const override {
|
||||
QSpinBox* sb = new QSpinBox(parent);
|
||||
sb->setFrame(false);
|
||||
sb->setMinimum(MIN);
|
||||
|
@ -214,13 +214,13 @@ class ListingDeleteButton : public QPushButton {
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit ListingDeleteButton(QWidget* parent = Q_NULLPTR);
|
||||
void enterEvent(QEvent* event);
|
||||
void leaveEvent(QEvent* event);
|
||||
void enterEvent(QEvent* event) override;
|
||||
void leaveEvent(QEvent* event) override;
|
||||
};
|
||||
|
||||
class ContextMenu : public QMenu {
|
||||
public:
|
||||
void hideEvent(QHideEvent* ev) {
|
||||
void hideEvent(QHideEvent* ev) override {
|
||||
QMenu::hideEvent(ev);
|
||||
deleteLater();
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ protected:
|
|||
public:
|
||||
explicit BaseObjectDelegate(QObject* parent = Q_NULLPTR) : QStyledItemDelegate(parent) {}
|
||||
bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option,
|
||||
const QModelIndex& index);
|
||||
const QModelIndex& index) override;
|
||||
private slots:
|
||||
void doOpenEditor();
|
||||
void doFindUsages();
|
||||
|
|
|
@ -26,7 +26,7 @@ public:
|
|||
explicit KeyboardOctave(int octave, const QString& svgPath, QWidget* parent = Q_NULLPTR);
|
||||
int getOctave() const { return m_octave; }
|
||||
int getKey(const QPoint& localPos) const;
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
void resizeEvent(QResizeEvent* event) override;
|
||||
};
|
||||
|
||||
class KeyboardWidget : public QWidget {
|
||||
|
@ -47,13 +47,13 @@ public:
|
|||
explicit KeyboardWidget(QWidget* parent = Q_NULLPTR);
|
||||
void setStatusFocus(StatusBarFocus* statusFocus) { m_statusFocus = statusFocus; }
|
||||
|
||||
void mouseMoveEvent(QMouseEvent* event);
|
||||
void mousePressEvent(QMouseEvent* event);
|
||||
void mouseReleaseEvent(QMouseEvent* event);
|
||||
void enterEvent(QEvent* event);
|
||||
void leaveEvent(QEvent* event);
|
||||
void wheelEvent(QWheelEvent* event);
|
||||
void showEvent(QShowEvent* event);
|
||||
void mouseMoveEvent(QMouseEvent* event) override;
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
void mouseReleaseEvent(QMouseEvent* event) override;
|
||||
void enterEvent(QEvent* event) override;
|
||||
void leaveEvent(QEvent* event) override;
|
||||
void wheelEvent(QWheelEvent* event) override;
|
||||
void showEvent(QShowEvent* event) override;
|
||||
|
||||
signals:
|
||||
void notePressed(int key);
|
||||
|
@ -68,15 +68,15 @@ protected:
|
|||
|
||||
public:
|
||||
explicit KeyboardSlider(QWidget* parent = Q_NULLPTR);
|
||||
void enterEvent(QEvent* event);
|
||||
void leaveEvent(QEvent* event);
|
||||
void enterEvent(QEvent* event) override;
|
||||
void leaveEvent(QEvent* event) override;
|
||||
void setStatusFocus(StatusBarFocus* statusFocus);
|
||||
void sliderChange(SliderChange change);
|
||||
void sliderChange(SliderChange change) override;
|
||||
};
|
||||
|
||||
class VelocitySlider : public KeyboardSlider {
|
||||
Q_OBJECT
|
||||
QString stringOfValue(int value) const;
|
||||
QString stringOfValue(int value) const override;
|
||||
|
||||
public:
|
||||
explicit VelocitySlider(QWidget* parent = Q_NULLPTR);
|
||||
|
@ -84,7 +84,7 @@ public:
|
|||
|
||||
class ModulationSlider : public KeyboardSlider {
|
||||
Q_OBJECT
|
||||
QString stringOfValue(int value) const;
|
||||
QString stringOfValue(int value) const override;
|
||||
|
||||
public:
|
||||
explicit ModulationSlider(QWidget* parent = Q_NULLPTR);
|
||||
|
@ -92,10 +92,10 @@ public:
|
|||
|
||||
class PitchSlider : public KeyboardSlider {
|
||||
Q_OBJECT
|
||||
QString stringOfValue(int value) const;
|
||||
QString stringOfValue(int value) const override;
|
||||
|
||||
public:
|
||||
explicit PitchSlider(QWidget* parent = Q_NULLPTR);
|
||||
void mouseReleaseEvent(QMouseEvent* ev);
|
||||
void wheelEvent(QWheelEvent* ev) { ev->ignore(); }
|
||||
void mouseReleaseEvent(QMouseEvent* ev) override;
|
||||
void wheelEvent(QWheelEvent* ev) override { ev->ignore(); }
|
||||
};
|
||||
|
|
|
@ -17,10 +17,10 @@ class PaintButton : public QPushButton {
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit PaintButton(QWidget* parent = Q_NULLPTR);
|
||||
void mouseReleaseEvent(QMouseEvent* event) { event->ignore(); }
|
||||
void mouseMoveEvent(QMouseEvent* event) { event->ignore(); }
|
||||
void focusOutEvent(QFocusEvent* event) { event->ignore(); }
|
||||
void keyPressEvent(QKeyEvent* event) { event->ignore(); }
|
||||
void mouseReleaseEvent(QMouseEvent* event) override { event->ignore(); }
|
||||
void mouseMoveEvent(QMouseEvent* event) override { event->ignore(); }
|
||||
void focusOutEvent(QFocusEvent* event) override { event->ignore(); }
|
||||
void keyPressEvent(QKeyEvent* event) override { event->ignore(); }
|
||||
};
|
||||
|
||||
class KeymapView : public QWidget {
|
||||
|
@ -47,10 +47,10 @@ public:
|
|||
void unloadData();
|
||||
ProjectModel::INode* currentNode() const;
|
||||
|
||||
void paintEvent(QPaintEvent* ev);
|
||||
void mousePressEvent(QMouseEvent* ev);
|
||||
void mouseMoveEvent(QMouseEvent* ev);
|
||||
void wheelEvent(QWheelEvent* event);
|
||||
void paintEvent(QPaintEvent* ev) override;
|
||||
void mousePressEvent(QMouseEvent* ev) override;
|
||||
void mouseMoveEvent(QMouseEvent* ev) override;
|
||||
void wheelEvent(QWheelEvent* event) override;
|
||||
};
|
||||
|
||||
class KeymapControls : public QFrame {
|
||||
|
@ -99,7 +99,7 @@ class KeymapEditor : public EditorWidget {
|
|||
public:
|
||||
explicit KeymapEditor(QWidget* parent = Q_NULLPTR);
|
||||
bool loadData(ProjectModel::KeymapNode* node);
|
||||
void unloadData();
|
||||
ProjectModel::INode* currentNode() const;
|
||||
void keyPressEvent(QKeyEvent* event);
|
||||
void unloadData() override;
|
||||
ProjectModel::INode* currentNode() const override;
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
};
|
||||
|
|
|
@ -13,7 +13,7 @@ public:
|
|||
explicit LayerDataChangeUndoCommand(ProjectModel::LayersNode* node, const QString& text, QModelIndex index,
|
||||
int redoVal)
|
||||
: EditorUndoCommand(node, text), m_index(index), m_redoVal(redoVal) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
amuse::LayerMapping& layer = (*static_cast<ProjectModel::LayersNode*>(m_node.get())->m_obj)[m_index.row()];
|
||||
|
||||
|
@ -48,7 +48,7 @@ public:
|
|||
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
amuse::LayerMapping& layer = (*static_cast<ProjectModel::LayersNode*>(m_node.get())->m_obj)[m_index.row()];
|
||||
|
||||
switch (m_index.column()) {
|
||||
|
@ -301,7 +301,7 @@ public:
|
|||
explicit LayerRowMoveCommand(ProjectModel::LayersNode* node, const QString& text, LayersTableView* view, int undoPos,
|
||||
int redoPos, int count)
|
||||
: EditorUndoCommand(node, text), m_view(view), m_undoPos(undoPos), m_redoPos(redoPos), m_count(count) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
EditorUndoCommand::undo();
|
||||
if (m_redoPos > m_undoPos)
|
||||
|
@ -309,7 +309,7 @@ public:
|
|||
else
|
||||
m_view->model()->moveRows(QModelIndex(), m_redoPos, m_count, QModelIndex(), m_undoPos + 1);
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
if (m_undid)
|
||||
EditorUndoCommand::redo();
|
||||
m_view->model()->moveRows(QModelIndex(), m_undoPos, m_count, QModelIndex(), m_redoPos);
|
||||
|
@ -385,11 +385,11 @@ protected:
|
|||
it->first = static_cast<LayersModel*>(m_view->model())->_removeRow(it->second);
|
||||
}
|
||||
}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
if (m_undid)
|
||||
EditorUndoCommand::redo();
|
||||
}
|
||||
|
@ -407,11 +407,11 @@ public:
|
|||
explicit LayerRowAddUndoCommand(ProjectModel::LayersNode* node, const QString& text, LayersTableView* view,
|
||||
std::vector<std::pair<amuse::LayerMapping, int>>&& data)
|
||||
: LayerRowUndoCommand(node, text, view, std::move(data)) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
base::undo();
|
||||
base::del();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
base::redo();
|
||||
base::add();
|
||||
}
|
||||
|
@ -424,11 +424,11 @@ public:
|
|||
explicit LayerRowDelUndoCommand(ProjectModel::LayersNode* node, const QString& text, LayersTableView* view,
|
||||
std::vector<std::pair<amuse::LayerMapping, int>>&& data)
|
||||
: LayerRowUndoCommand(node, text, view, std::move(data)) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
base::undo();
|
||||
base::add();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
base::redo();
|
||||
base::del();
|
||||
}
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
class SoundMacroDelegate : public BaseObjectDelegate {
|
||||
Q_OBJECT
|
||||
protected:
|
||||
ProjectModel::INode* getNode(const QAbstractItemModel* model, const QModelIndex& index) const;
|
||||
ProjectModel::INode* getNode(const QAbstractItemModel* model, const QModelIndex& index) const override;
|
||||
|
||||
public:
|
||||
explicit SoundMacroDelegate(QObject* parent = Q_NULLPTR);
|
||||
QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const;
|
||||
void setEditorData(QWidget* editor, const QModelIndex& index) const;
|
||||
void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const;
|
||||
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();
|
||||
};
|
||||
|
@ -33,20 +33,21 @@ public:
|
|||
void loadData(ProjectModel::LayersNode* node);
|
||||
void unloadData();
|
||||
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
|
||||
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
Qt::ItemFlags flags(const QModelIndex& index) const;
|
||||
Qt::DropActions supportedDropActions() const;
|
||||
Qt::DropActions supportedDragActions() const;
|
||||
bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent);
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
||||
Qt::ItemFlags flags(const QModelIndex& index) const override;
|
||||
Qt::DropActions supportedDropActions() const override;
|
||||
Qt::DropActions supportedDragActions() const override;
|
||||
bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column,
|
||||
const QModelIndex& parent) override;
|
||||
|
||||
bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex());
|
||||
bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex()) override;
|
||||
bool moveRows(const QModelIndex& sourceParent, int sourceRow, int count, const QModelIndex& destinationParent,
|
||||
int destinationChild);
|
||||
bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex());
|
||||
int destinationChild) override;
|
||||
bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()) override;
|
||||
|
||||
void _insertRow(int row, const amuse::LayerMapping& data);
|
||||
amuse::LayerMapping _removeRow(int row);
|
||||
|
@ -61,7 +62,7 @@ class LayersTableView : public QTableView {
|
|||
|
||||
public:
|
||||
explicit LayersTableView(QWidget* parent = Q_NULLPTR);
|
||||
void setModel(QAbstractItemModel* model);
|
||||
void setModel(QAbstractItemModel* model) override;
|
||||
void deleteSelection();
|
||||
};
|
||||
|
||||
|
@ -75,14 +76,14 @@ class LayersEditor : public EditorWidget {
|
|||
public:
|
||||
explicit LayersEditor(QWidget* parent = Q_NULLPTR);
|
||||
bool loadData(ProjectModel::LayersNode* node);
|
||||
void unloadData();
|
||||
ProjectModel::INode* currentNode() const;
|
||||
void resizeEvent(QResizeEvent* ev);
|
||||
AmuseItemEditFlags itemEditFlags() const;
|
||||
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);
|
||||
void doAdd();
|
||||
void doSelectionChanged();
|
||||
void itemDeleteAction();
|
||||
void itemDeleteAction() override;
|
||||
};
|
||||
|
|
|
@ -13,36 +13,36 @@ class MIDIReader : public amuse::BooBackendMIDIReader {
|
|||
public:
|
||||
MIDIReader(amuse::Engine& engine, bool useLock);
|
||||
|
||||
void noteOff(uint8_t chan, uint8_t key, uint8_t velocity);
|
||||
void noteOn(uint8_t chan, uint8_t key, uint8_t velocity);
|
||||
void notePressure(uint8_t chan, uint8_t key, uint8_t pressure);
|
||||
void controlChange(uint8_t chan, uint8_t control, uint8_t value);
|
||||
void programChange(uint8_t chan, uint8_t program);
|
||||
void channelPressure(uint8_t chan, uint8_t pressure);
|
||||
void pitchBend(uint8_t chan, int16_t pitch);
|
||||
void noteOff(uint8_t chan, uint8_t key, uint8_t velocity) override;
|
||||
void noteOn(uint8_t chan, uint8_t key, uint8_t velocity) override;
|
||||
void notePressure(uint8_t chan, uint8_t key, uint8_t pressure) override;
|
||||
void controlChange(uint8_t chan, uint8_t control, uint8_t value) override;
|
||||
void programChange(uint8_t chan, uint8_t program) override;
|
||||
void channelPressure(uint8_t chan, uint8_t pressure) override;
|
||||
void pitchBend(uint8_t chan, int16_t pitch) override;
|
||||
|
||||
void allSoundOff(uint8_t chan);
|
||||
void resetAllControllers(uint8_t chan);
|
||||
void localControl(uint8_t chan, bool on);
|
||||
void allNotesOff(uint8_t chan);
|
||||
void omniMode(uint8_t chan, bool on);
|
||||
void polyMode(uint8_t chan, bool on);
|
||||
void allSoundOff(uint8_t chan) override;
|
||||
void resetAllControllers(uint8_t chan) override;
|
||||
void localControl(uint8_t chan, bool on) override;
|
||||
void allNotesOff(uint8_t chan) override;
|
||||
void omniMode(uint8_t chan, bool on) override;
|
||||
void polyMode(uint8_t chan, bool on) override;
|
||||
|
||||
void sysex(const void* data, size_t len);
|
||||
void timeCodeQuarterFrame(uint8_t message, uint8_t value);
|
||||
void songPositionPointer(uint16_t pointer);
|
||||
void songSelect(uint8_t song);
|
||||
void tuneRequest();
|
||||
void sysex(const void* data, size_t len) override;
|
||||
void timeCodeQuarterFrame(uint8_t message, uint8_t value) override;
|
||||
void songPositionPointer(uint16_t pointer) override;
|
||||
void songSelect(uint8_t song) override;
|
||||
void tuneRequest() override;
|
||||
|
||||
void startSeq();
|
||||
void continueSeq();
|
||||
void stopSeq();
|
||||
void startSeq() override;
|
||||
void continueSeq() override;
|
||||
void stopSeq() override;
|
||||
|
||||
void reset();
|
||||
void reset() override;
|
||||
};
|
||||
|
||||
class VoiceAllocator : public amuse::BooBackendVoiceAllocator {
|
||||
public:
|
||||
VoiceAllocator(boo::IAudioVoiceEngine& booEngine);
|
||||
std::unique_ptr<amuse::IMIDIReader> allocateMIDIReader(amuse::Engine& engine);
|
||||
std::unique_ptr<amuse::IMIDIReader> allocateMIDIReader(amuse::Engine& engine) override;
|
||||
};
|
||||
|
|
|
@ -75,7 +75,7 @@ public:
|
|||
: QStyledItemDelegate(parent), m_window(window) {}
|
||||
|
||||
bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option,
|
||||
const QModelIndex& index);
|
||||
const QModelIndex& index) override;
|
||||
public slots:
|
||||
void doExportGroup();
|
||||
void doFindUsages();
|
||||
|
@ -153,10 +153,10 @@ class MainWindow : public QMainWindow {
|
|||
bool setProjectPath(const QString& path);
|
||||
void refreshAudioIO();
|
||||
void refreshMIDIIO();
|
||||
void timerEvent(QTimerEvent* ev);
|
||||
void timerEvent(QTimerEvent* ev) override;
|
||||
void setSustain(bool sustain);
|
||||
void keyPressEvent(QKeyEvent* ev);
|
||||
void keyReleaseEvent(QKeyEvent* ev);
|
||||
void keyPressEvent(QKeyEvent* ev) override;
|
||||
void keyReleaseEvent(QKeyEvent* ev) override;
|
||||
|
||||
void startBackgroundTask(int id, const QString& windowTitle, const QString& label,
|
||||
std::function<void(BackgroundTask&)>&& task);
|
||||
|
@ -165,7 +165,7 @@ class MainWindow : public QMainWindow {
|
|||
|
||||
public:
|
||||
explicit MainWindow(QWidget* parent = Q_NULLPTR);
|
||||
~MainWindow();
|
||||
~MainWindow() override;
|
||||
|
||||
bool openProject(const QString& path);
|
||||
|
||||
|
@ -190,8 +190,8 @@ public:
|
|||
void updateFocus();
|
||||
void aboutToDeleteNode(ProjectModel::INode* node);
|
||||
bool askAboutSave();
|
||||
void closeEvent(QCloseEvent* ev);
|
||||
void showEvent(QShowEvent* ev);
|
||||
void closeEvent(QCloseEvent* ev) override;
|
||||
void showEvent(QShowEvent* ev) override;
|
||||
|
||||
QString getGroupName(ProjectModel::GroupNode* group) const;
|
||||
ProjectModel::GroupNode* getSelectedGroupNode() const;
|
||||
|
|
|
@ -1019,8 +1019,8 @@ class RenameNodeUndoCommand : public EditorUndoCommand {
|
|||
public:
|
||||
RenameNodeUndoCommand(const QString& text, ProjectModel::INode* node, const QString& redoVal)
|
||||
: EditorUndoCommand(node, text.arg(node->name())), m_redoVal(redoVal) {}
|
||||
void undo() { g_MainWindow->projectModel()->_renameNode(m_node.get(), m_undoVal); }
|
||||
void redo() {
|
||||
void undo() override { g_MainWindow->projectModel()->_renameNode(m_node.get(), m_undoVal); }
|
||||
void redo() override {
|
||||
m_undoVal = m_node->name();
|
||||
g_MainWindow->projectModel()->_renameNode(m_node.get(), m_redoVal);
|
||||
}
|
||||
|
@ -1160,8 +1160,8 @@ public:
|
|||
explicit GroupNodeAddUndoCommand(const QString& text, std::unique_ptr<amuse::AudioGroupDatabase>&& data,
|
||||
ProjectModel::GroupNode* node)
|
||||
: GroupNodeUndoCommand(text, std::move(data), node) {}
|
||||
void undo() { base::del(); }
|
||||
void redo() { base::add(); }
|
||||
void undo() override { base::del(); }
|
||||
void redo() override { base::add(); }
|
||||
};
|
||||
|
||||
class GroupNodeDelUndoCommand : public GroupNodeUndoCommand {
|
||||
|
@ -1170,8 +1170,8 @@ class GroupNodeDelUndoCommand : public GroupNodeUndoCommand {
|
|||
public:
|
||||
explicit GroupNodeDelUndoCommand(const QString& text, ProjectModel::GroupNode* node)
|
||||
: GroupNodeUndoCommand(text, {}, node) {}
|
||||
void undo() { base::add(); }
|
||||
void redo() { base::del(); }
|
||||
void undo() override { base::add(); }
|
||||
void redo() override { base::del(); }
|
||||
};
|
||||
|
||||
void ProjectModel::_addNode(GroupNode* node, std::unique_ptr<amuse::AudioGroupDatabase>&& data,
|
||||
|
@ -1235,8 +1235,8 @@ class NodeAddUndoCommand : public NodeUndoCommand<NT> {
|
|||
public:
|
||||
explicit NodeAddUndoCommand(const QString& text, NT* node, ProjectModel::GroupNode* parent)
|
||||
: NodeUndoCommand<NT>(text, node, parent) {}
|
||||
void undo() { base::del(); }
|
||||
void redo() { base::add(); }
|
||||
void undo() override { base::del(); }
|
||||
void redo() override { base::add(); }
|
||||
};
|
||||
|
||||
template <class NT>
|
||||
|
@ -1246,8 +1246,8 @@ class NodeDelUndoCommand : public NodeUndoCommand<NT> {
|
|||
public:
|
||||
explicit NodeDelUndoCommand(const QString& text, NT* node)
|
||||
: NodeUndoCommand<NT>(text, node, g_MainWindow->projectModel()->getGroupNode(node)) {}
|
||||
void undo() { base::add(); }
|
||||
void redo() { base::del(); }
|
||||
void undo() override { base::add(); }
|
||||
void redo() override { base::del(); }
|
||||
};
|
||||
|
||||
template <class NT, class T>
|
||||
|
|
|
@ -35,31 +35,31 @@ public:
|
|||
explicit OutlineFilterProxyModel(ProjectModel* source);
|
||||
public slots:
|
||||
void setFilterRegExp(const QString& pattern);
|
||||
bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const;
|
||||
bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const override;
|
||||
};
|
||||
|
||||
class NullItemProxyModel : public QIdentityProxyModel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit NullItemProxyModel(ProjectModel* source);
|
||||
QModelIndex mapFromSource(const QModelIndex& sourceIndex) const;
|
||||
QModelIndex mapToSource(const QModelIndex& proxyIndex) const;
|
||||
int rowCount(const QModelIndex& parent) const;
|
||||
QModelIndex index(int row, int column, const QModelIndex& parent) const;
|
||||
QVariant data(const QModelIndex& proxyIndex, int role) const;
|
||||
QModelIndex mapFromSource(const QModelIndex& sourceIndex) const override;
|
||||
QModelIndex mapToSource(const QModelIndex& proxyIndex) const override;
|
||||
int rowCount(const QModelIndex& parent) const override;
|
||||
QModelIndex index(int row, int column, const QModelIndex& parent) const override;
|
||||
QVariant data(const QModelIndex& proxyIndex, int role) const override;
|
||||
};
|
||||
|
||||
class PageObjectProxyModel : public QIdentityProxyModel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PageObjectProxyModel(ProjectModel* source);
|
||||
QModelIndex mapFromSource(const QModelIndex& sourceIndex) const;
|
||||
QModelIndex mapToSource(const QModelIndex& proxyIndex) const;
|
||||
QModelIndex parent(const QModelIndex& child) const;
|
||||
int rowCount(const QModelIndex& parent) const;
|
||||
QModelIndex index(int row, int column, const QModelIndex& parent) const;
|
||||
QVariant data(const QModelIndex& proxyIndex, int role) const;
|
||||
Qt::ItemFlags flags(const QModelIndex& proxyIndex) const;
|
||||
QModelIndex mapFromSource(const QModelIndex& sourceIndex) const override;
|
||||
QModelIndex mapToSource(const QModelIndex& proxyIndex) const override;
|
||||
QModelIndex parent(const QModelIndex& child) const override;
|
||||
int rowCount(const QModelIndex& parent) const override;
|
||||
QModelIndex index(int row, int column, const QModelIndex& parent) const override;
|
||||
QVariant data(const QModelIndex& proxyIndex, int role) const override;
|
||||
Qt::ItemFlags flags(const QModelIndex& proxyIndex) const override;
|
||||
};
|
||||
|
||||
class ProjectModel : public QAbstractItemModel {
|
||||
|
@ -124,7 +124,7 @@ public:
|
|||
amuse::IObjToken<INode> m_nullChild;
|
||||
|
||||
public:
|
||||
virtual ~INode() = default;
|
||||
~INode() override = default;
|
||||
INode(const QString& name);
|
||||
INode(INode* parent) : m_parent(parent), m_row(0) { /* ONLY USED BY NULL NODE! */
|
||||
}
|
||||
|
@ -221,17 +221,17 @@ public:
|
|||
struct NullNode final : INode {
|
||||
NullNode(INode* parent) : INode(parent) {}
|
||||
|
||||
Type type() const { return Type::Null; }
|
||||
QString text() const { return {}; }
|
||||
QIcon icon() const { return {}; }
|
||||
Type type() const override { return Type::Null; }
|
||||
QString text() const override { return {}; }
|
||||
QIcon icon() const override { return {}; }
|
||||
};
|
||||
struct RootNode final : INode {
|
||||
RootNode() : INode(QStringLiteral("<root>")) {}
|
||||
|
||||
Type type() const { return Type::Root; }
|
||||
QString text() const { return {}; }
|
||||
QIcon icon() const { return {}; }
|
||||
Qt::ItemFlags flags() const { return Qt::ItemIsEnabled; }
|
||||
Type type() const override { return Type::Root; }
|
||||
QString text() const override { return {}; }
|
||||
QIcon icon() const override { return {}; }
|
||||
Qt::ItemFlags flags() const override { return Qt::ItemIsEnabled; }
|
||||
};
|
||||
struct CollectionNode;
|
||||
struct BasePoolObjectNode;
|
||||
|
@ -241,14 +241,14 @@ public:
|
|||
GroupNode(std::unordered_map<QString, std::unique_ptr<amuse::AudioGroupDatabase>>::iterator it)
|
||||
: INode(it->first), m_it(it) {}
|
||||
|
||||
int hypotheticalIndex(const QString& name) const;
|
||||
void _sortChildren();
|
||||
int hypotheticalIndex(const QString& name) const override;
|
||||
void _sortChildren() override;
|
||||
|
||||
static QIcon Icon;
|
||||
Type type() const { return Type::Group; }
|
||||
QString text() const { return m_name; }
|
||||
QIcon icon() const { return Icon; }
|
||||
AmuseItemEditFlags editFlags() const { return AmuseItemNoCut; }
|
||||
Type type() const override { return Type::Group; }
|
||||
QString text() const override { return m_name; }
|
||||
QIcon icon() const override { return Icon; }
|
||||
AmuseItemEditFlags editFlags() const override { return AmuseItemNoCut; }
|
||||
|
||||
CollectionNode* getCollectionOfType(Type tp) const;
|
||||
amuse::AudioGroupDatabase* getAudioGroup() const { return m_it->second.get(); }
|
||||
|
@ -262,19 +262,19 @@ public:
|
|||
: INode(amuse::GroupId::CurNameDB->resolveNameFromId(id).data()), m_id(id), m_index(index) {}
|
||||
|
||||
static QIcon Icon;
|
||||
Type type() const { return Type::SongGroup; }
|
||||
QString text() const { return m_name; }
|
||||
QIcon icon() const { return Icon; }
|
||||
AmuseItemEditFlags editFlags() const { return AmuseItemAll; }
|
||||
Type type() const override { return Type::SongGroup; }
|
||||
QString text() const override { return m_name; }
|
||||
QIcon icon() const override { return Icon; }
|
||||
AmuseItemEditFlags editFlags() const override { return AmuseItemAll; }
|
||||
|
||||
amuse::NameDB* getNameDb() const { return amuse::GroupId::CurNameDB; }
|
||||
amuse::NameDB* getNameDb() const override { return amuse::GroupId::CurNameDB; }
|
||||
|
||||
void registerNames(const NameUndoRegistry& registry) const {
|
||||
void registerNames(const NameUndoRegistry& registry) const override {
|
||||
amuse::GroupId::CurNameDB->registerPair(text().toUtf8().data(), m_id);
|
||||
for (auto& p : m_index->m_midiSetups)
|
||||
registry.registerSongName(p.first);
|
||||
}
|
||||
void unregisterNames(NameUndoRegistry& registry) const {
|
||||
void unregisterNames(NameUndoRegistry& registry) const override {
|
||||
amuse::GroupId::CurNameDB->remove(m_id);
|
||||
for (auto& p : m_index->m_midiSetups)
|
||||
registry.unregisterSongName(p.first);
|
||||
|
@ -288,19 +288,19 @@ public:
|
|||
: INode(amuse::GroupId::CurNameDB->resolveNameFromId(id).data()), m_id(id), m_index(index) {}
|
||||
|
||||
static QIcon Icon;
|
||||
Type type() const { return Type::SoundGroup; }
|
||||
QString text() const { return m_name; }
|
||||
QIcon icon() const { return Icon; }
|
||||
AmuseItemEditFlags editFlags() const { return AmuseItemAll; }
|
||||
Type type() const override { return Type::SoundGroup; }
|
||||
QString text() const override { return m_name; }
|
||||
QIcon icon() const override { return Icon; }
|
||||
AmuseItemEditFlags editFlags() const override { return AmuseItemAll; }
|
||||
|
||||
amuse::NameDB* getNameDb() const { return amuse::GroupId::CurNameDB; }
|
||||
amuse::NameDB* getNameDb() const override { return amuse::GroupId::CurNameDB; }
|
||||
|
||||
void registerNames(const NameUndoRegistry& registry) const {
|
||||
void registerNames(const NameUndoRegistry& registry) const override {
|
||||
amuse::GroupId::CurNameDB->registerPair(text().toUtf8().data(), m_id);
|
||||
for (auto& p : m_index->m_sfxEntries)
|
||||
registry.registerSFXName(p.first);
|
||||
}
|
||||
void unregisterNames(NameUndoRegistry& registry) const {
|
||||
void unregisterNames(NameUndoRegistry& registry) const override {
|
||||
amuse::GroupId::CurNameDB->remove(m_id);
|
||||
for (auto& p : m_index->m_sfxEntries)
|
||||
registry.unregisterSFXName(p.first);
|
||||
|
@ -312,10 +312,10 @@ public:
|
|||
CollectionNode(const QString& name, const QIcon& icon, Type collectionType)
|
||||
: INode(name), m_icon(icon), m_collectionType(collectionType) {}
|
||||
|
||||
Type type() const { return Type::Collection; }
|
||||
QString text() const { return m_name; }
|
||||
QIcon icon() const { return m_icon; }
|
||||
Qt::ItemFlags flags() const { return Qt::ItemIsEnabled; }
|
||||
Type type() const override { return Type::Collection; }
|
||||
QString text() const override { return m_name; }
|
||||
QIcon icon() const override { return m_icon; }
|
||||
Qt::ItemFlags flags() const override { return Qt::ItemIsEnabled; }
|
||||
|
||||
Type collectionType() const { return m_collectionType; }
|
||||
int indexOfId(amuse::ObjectId id) const;
|
||||
|
@ -328,8 +328,8 @@ public:
|
|||
BasePoolObjectNode(const QString& name) : INode(name) {}
|
||||
BasePoolObjectNode(amuse::ObjectId id, const QString& name) : INode(name), m_id(id) {}
|
||||
amuse::ObjectId id() const { return m_id; }
|
||||
QString text() const { return m_name; }
|
||||
QIcon icon() const { return {}; }
|
||||
QString text() const override { return m_name; }
|
||||
QIcon icon() const override { return {}; }
|
||||
};
|
||||
template <class ID, class T, INode::Type TP>
|
||||
struct PoolObjectNode final : BasePoolObjectNode {
|
||||
|
@ -338,14 +338,14 @@ public:
|
|||
PoolObjectNode(ID id, amuse::ObjToken<T> obj)
|
||||
: BasePoolObjectNode(id, ID::CurNameDB->resolveNameFromId(id).data()), m_obj(obj) {}
|
||||
|
||||
Type type() const { return TP; }
|
||||
AmuseItemEditFlags editFlags() const { return TP == INode::Type::Sample ? AmuseItemNoCut : AmuseItemAll; }
|
||||
Type type() const override { return TP; }
|
||||
AmuseItemEditFlags editFlags() const override { return TP == INode::Type::Sample ? AmuseItemNoCut : AmuseItemAll; }
|
||||
|
||||
void registerNames(const NameUndoRegistry& registry) const {
|
||||
void registerNames(const NameUndoRegistry& registry) const override {
|
||||
ID::CurNameDB->registerPair(text().toUtf8().data(), m_id);
|
||||
}
|
||||
void unregisterNames(NameUndoRegistry& registry) const { ID::CurNameDB->remove(m_id); }
|
||||
amuse::NameDB* getNameDb() const { return ID::CurNameDB; }
|
||||
void unregisterNames(NameUndoRegistry& registry) const override { ID::CurNameDB->remove(m_id); }
|
||||
amuse::NameDB* getNameDb() const override { return ID::CurNameDB; }
|
||||
};
|
||||
using SoundMacroNode = PoolObjectNode<amuse::SoundMacroId, amuse::SoundMacro, INode::Type::SoundMacro>;
|
||||
using ADSRNode = PoolObjectNode<amuse::TableId, std::unique_ptr<amuse::ITable>, INode::Type::ADSR>;
|
||||
|
@ -385,14 +385,14 @@ public:
|
|||
bool ensureModelData();
|
||||
|
||||
QModelIndex proxyCreateIndex(int arow, int acolumn, void* adata) const;
|
||||
QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const;
|
||||
QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
|
||||
QModelIndex index(INode* node) const;
|
||||
QModelIndex parent(const QModelIndex& child) const;
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
|
||||
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
|
||||
Qt::ItemFlags flags(const QModelIndex& index) const;
|
||||
QModelIndex parent(const QModelIndex& child) const override;
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
|
||||
Qt::ItemFlags flags(const QModelIndex& index) const override;
|
||||
INode* node(const QModelIndex& index) const;
|
||||
GroupNode* getGroupNode(INode* node) const;
|
||||
AmuseItemEditFlags editFlags(const QModelIndex& index) const;
|
||||
|
@ -439,9 +439,10 @@ public:
|
|||
template <class NT>
|
||||
void loadMimeData(const QMimeData* data, const QString& mimeType, GroupNode* gn);
|
||||
|
||||
QStringList mimeTypes() const;
|
||||
QMimeData* mimeData(const QModelIndexList& indexes) const;
|
||||
bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent);
|
||||
QStringList mimeTypes() const override;
|
||||
QMimeData* mimeData(const QModelIndexList& indexes) const override;
|
||||
bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column,
|
||||
const QModelIndex& parent) override;
|
||||
|
||||
void cut(const QModelIndex& index);
|
||||
void copy(const QModelIndex& index);
|
||||
|
|
|
@ -406,7 +406,7 @@ public:
|
|||
, m_redoStartVal(redoStart)
|
||||
, m_redoEndVal(redoEnd)
|
||||
, m_fieldIdx(fieldIdx) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
amuse::SampleEntryData* data = m_node.cast<ProjectModel::SampleNode>()->m_obj->m_data.get();
|
||||
data->setLoopStartSample(m_undoStartVal);
|
||||
|
@ -415,7 +415,7 @@ public:
|
|||
if (SampleEditor* e = static_cast<SampleEditor*>(g_MainWindow->getEditorWidget()))
|
||||
e->m_controls->doFileWrite();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
amuse::SampleEntryData* data = m_node.cast<ProjectModel::SampleNode>()->m_obj->m_data.get();
|
||||
m_undoStartVal = data->getLoopStartSample();
|
||||
m_undoEndVal = data->getLoopEndSample();
|
||||
|
@ -427,7 +427,7 @@ public:
|
|||
e->m_controls->doFileWrite();
|
||||
}
|
||||
}
|
||||
bool mergeWith(const QUndoCommand* other) {
|
||||
bool mergeWith(const QUndoCommand* other) override {
|
||||
if (other->id() == id() && static_cast<const SampLoopUndoCommand*>(other)->m_fieldIdx == m_fieldIdx) {
|
||||
m_redoStartVal = static_cast<const SampLoopUndoCommand*>(other)->m_redoStartVal;
|
||||
m_redoEndVal = static_cast<const SampLoopUndoCommand*>(other)->m_redoEndVal;
|
||||
|
@ -435,7 +435,7 @@ public:
|
|||
}
|
||||
return false;
|
||||
}
|
||||
int id() const { return int(Id::SampLoop); }
|
||||
int id() const override { return int(Id::SampLoop); }
|
||||
};
|
||||
|
||||
void SampleControls::loopStateChanged(int state) {
|
||||
|
@ -508,7 +508,7 @@ class SampPitchUndoCommand : public EditorUndoCommand {
|
|||
public:
|
||||
SampPitchUndoCommand(atUint8 redoPitch, amuse::ObjToken<ProjectModel::SampleNode> node)
|
||||
: EditorUndoCommand(node.get(), SampleControls::tr("Change Base Pitch")), m_redoPitchVal(redoPitch) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
amuse::SampleEntryData* data = m_node.cast<ProjectModel::SampleNode>()->m_obj->m_data.get();
|
||||
data->m_pitch = m_undoPitchVal;
|
||||
|
@ -516,7 +516,7 @@ public:
|
|||
if (SampleEditor* e = static_cast<SampleEditor*>(g_MainWindow->getEditorWidget()))
|
||||
e->m_controls->doFileWrite();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
amuse::SampleEntryData* data = m_node.cast<ProjectModel::SampleNode>()->m_obj->m_data.get();
|
||||
m_undoPitchVal = data->m_pitch;
|
||||
data->m_pitch = m_redoPitchVal;
|
||||
|
@ -526,14 +526,14 @@ public:
|
|||
e->m_controls->doFileWrite();
|
||||
}
|
||||
}
|
||||
bool mergeWith(const QUndoCommand* other) {
|
||||
bool mergeWith(const QUndoCommand* other) override {
|
||||
if (other->id() == id()) {
|
||||
m_redoPitchVal = static_cast<const SampPitchUndoCommand*>(other)->m_redoPitchVal;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
int id() const { return int(Id::SampPitch); }
|
||||
int id() const override { return int(Id::SampPitch); }
|
||||
};
|
||||
|
||||
void SampleControls::pitchValueChanged(int val) {
|
||||
|
|
|
@ -41,14 +41,14 @@ public:
|
|||
void setSamplePos(int pos);
|
||||
void updateSampleRange(int oldSamp, int newSamp);
|
||||
|
||||
void paintEvent(QPaintEvent* ev);
|
||||
void paintEvent(QPaintEvent* ev) override;
|
||||
void resetZoom();
|
||||
void setZoom(int zVal);
|
||||
void showEvent(QShowEvent* ev);
|
||||
void mousePressEvent(QMouseEvent* ev);
|
||||
void mouseReleaseEvent(QMouseEvent* ev);
|
||||
void mouseMoveEvent(QMouseEvent* ev);
|
||||
void wheelEvent(QWheelEvent* ev);
|
||||
void showEvent(QShowEvent* ev) override;
|
||||
void mousePressEvent(QMouseEvent* ev) override;
|
||||
void mouseReleaseEvent(QMouseEvent* ev) override;
|
||||
void mouseMoveEvent(QMouseEvent* ev) override;
|
||||
void wheelEvent(QWheelEvent* ev) override;
|
||||
};
|
||||
|
||||
class SampleControls : public QFrame {
|
||||
|
@ -98,10 +98,10 @@ class SampleEditor : public EditorWidget {
|
|||
public:
|
||||
explicit SampleEditor(QWidget* parent = Q_NULLPTR);
|
||||
bool loadData(ProjectModel::SampleNode* node);
|
||||
void unloadData();
|
||||
ProjectModel::INode* currentNode() const;
|
||||
void unloadData() override;
|
||||
ProjectModel::INode* currentNode() const override;
|
||||
const amuse::SoundMacro* soundMacro() const;
|
||||
void setSamplePos(int pos);
|
||||
|
||||
void resizeEvent(QResizeEvent* ev);
|
||||
void resizeEvent(QResizeEvent* ev) override;
|
||||
};
|
||||
|
|
|
@ -13,7 +13,7 @@ public:
|
|||
explicit PageDataChangeUndoCommand(ProjectModel::SongGroupNode* node, const QString& text, bool drum, uint8_t prog,
|
||||
int column, int redoVal)
|
||||
: EditorUndoCommand(node, text), m_drum(drum), m_prog(prog), m_column(column), m_redoVal(redoVal) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
amuse::SongGroupIndex& index = *static_cast<ProjectModel::SongGroupNode*>(m_node.get())->m_index;
|
||||
auto& map = m_drum ? index.m_drumPages : index.m_normPages;
|
||||
|
@ -50,7 +50,7 @@ public:
|
|||
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
amuse::SongGroupIndex& index = *static_cast<ProjectModel::SongGroupNode*>(m_node.get())->m_index;
|
||||
auto& map = m_drum ? index.m_drumPages : index.m_normPages;
|
||||
amuse::SongGroupIndex::PageEntry& entry = map[m_prog];
|
||||
|
@ -103,7 +103,7 @@ public:
|
|||
explicit SetupDataChangeUndoCommand(ProjectModel::SongGroupNode* node, const QString& text, amuse::SongId song,
|
||||
int row, int column, int redoVal)
|
||||
: EditorUndoCommand(node, text), m_song(song), m_row(row), m_column(column), m_redoVal(redoVal) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
amuse::SongGroupIndex& index = *static_cast<ProjectModel::SongGroupNode*>(m_node.get())->m_index;
|
||||
auto& map = index.m_midiSetups;
|
||||
|
@ -131,7 +131,7 @@ public:
|
|||
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
amuse::SongGroupIndex& index = *static_cast<ProjectModel::SongGroupNode*>(m_node.get())->m_index;
|
||||
auto& map = index.m_midiSetups;
|
||||
std::array<amuse::SongGroupIndex::MIDISetup, 16>& entry = map[m_song];
|
||||
|
@ -175,7 +175,7 @@ public:
|
|||
explicit SongNameChangeUndoCommand(ProjectModel::SongGroupNode* node, const QString& text, amuse::SongId song,
|
||||
std::string_view redoVal)
|
||||
: EditorUndoCommand(node, text), m_song(song), m_redoVal(redoVal) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
g_MainWindow->projectModel()->setIdDatabases(m_node.get());
|
||||
amuse::SongGroupIndex& index = *static_cast<ProjectModel::SongGroupNode*>(m_node.get())->m_index;
|
||||
|
@ -198,7 +198,7 @@ public:
|
|||
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
g_MainWindow->projectModel()->setIdDatabases(m_node.get());
|
||||
amuse::SongGroupIndex& index = *static_cast<ProjectModel::SongGroupNode*>(m_node.get())->m_index;
|
||||
auto& map = index.m_midiSetups;
|
||||
|
@ -233,12 +233,12 @@ public:
|
|||
explicit SongMIDIPathChangeUndoCommand(ProjectModel::SongGroupNode* node, const QString& text, amuse::SongId song,
|
||||
QString redoVal)
|
||||
: EditorUndoCommand(node, text), m_song(song), m_redoVal(redoVal) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
g_MainWindow->projectModel()->setMIDIPathOfSong(m_song, m_undoVal);
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
m_undoVal = g_MainWindow->projectModel()->getMIDIPathOfSong(m_song);
|
||||
g_MainWindow->projectModel()->setMIDIPathOfSong(m_song, m_redoVal);
|
||||
if (m_undid)
|
||||
|
@ -688,11 +688,11 @@ protected:
|
|||
*it = static_cast<PageModel*>(m_view->model())->_removeRow(it->first);
|
||||
}
|
||||
}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
if (m_undid)
|
||||
EditorUndoCommand::redo();
|
||||
}
|
||||
|
@ -710,11 +710,11 @@ public:
|
|||
explicit PageRowAddUndoCommand(ProjectModel::SongGroupNode* node, const QString& text, PageTableView* view,
|
||||
std::vector<std::pair<uint8_t, amuse::SongGroupIndex::PageEntry>>&& data)
|
||||
: PageRowUndoCommand(node, text, view, std::move(data)) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
base::undo();
|
||||
base::del();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
base::redo();
|
||||
base::add();
|
||||
}
|
||||
|
@ -727,11 +727,11 @@ public:
|
|||
explicit PageRowDelUndoCommand(ProjectModel::SongGroupNode* node, const QString& text, PageTableView* view,
|
||||
std::vector<std::pair<uint8_t, amuse::SongGroupIndex::PageEntry>>&& data)
|
||||
: PageRowUndoCommand(node, text, view, std::move(data)) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
base::undo();
|
||||
base::add();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
base::redo();
|
||||
base::del();
|
||||
}
|
||||
|
@ -929,11 +929,11 @@ protected:
|
|||
*it = static_cast<SetupListModel*>(listView->model())->_removeRow(std::get<0>(*it));
|
||||
}
|
||||
}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
if (m_undid)
|
||||
EditorUndoCommand::redo();
|
||||
}
|
||||
|
@ -953,11 +953,11 @@ public:
|
|||
ProjectModel::SongGroupNode* node, const QString& text, SetupTableView* view,
|
||||
std::vector<std::tuple<amuse::SongId, std::string, std::array<amuse::SongGroupIndex::MIDISetup, 16>>>&& data)
|
||||
: SetupRowUndoCommand(node, text, view, std::move(data)) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
base::undo();
|
||||
base::del();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
base::redo();
|
||||
base::add();
|
||||
}
|
||||
|
@ -971,11 +971,11 @@ public:
|
|||
ProjectModel::SongGroupNode* node, const QString& text, SetupTableView* view,
|
||||
std::vector<std::tuple<amuse::SongId, std::string, std::array<amuse::SongGroupIndex::MIDISetup, 16>>>&& data)
|
||||
: SetupRowUndoCommand(node, text, view, std::move(data)) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
base::undo();
|
||||
base::add();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
base::redo();
|
||||
base::del();
|
||||
}
|
||||
|
|
|
@ -19,13 +19,13 @@ class SetupTableView;
|
|||
class PageObjectDelegate : public BaseObjectDelegate {
|
||||
Q_OBJECT
|
||||
protected:
|
||||
ProjectModel::INode* getNode(const QAbstractItemModel* model, const QModelIndex& index) const;
|
||||
ProjectModel::INode* getNode(const QAbstractItemModel* model, const QModelIndex& index) const override;
|
||||
|
||||
public:
|
||||
explicit PageObjectDelegate(QObject* parent = Q_NULLPTR);
|
||||
QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const;
|
||||
void setEditorData(QWidget* editor, const QModelIndex& index) const;
|
||||
void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const;
|
||||
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();
|
||||
};
|
||||
|
@ -54,12 +54,12 @@ class MIDIFileDelegate : public QStyledItemDelegate {
|
|||
|
||||
public:
|
||||
explicit MIDIFileDelegate(SetupTableView* parent = Q_NULLPTR);
|
||||
QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const;
|
||||
void destroyEditor(QWidget* editor, const QModelIndex& index) const;
|
||||
void setEditorData(QWidget* editor, const QModelIndex& index) const;
|
||||
void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const;
|
||||
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);
|
||||
const QModelIndex& index) override;
|
||||
private slots:
|
||||
void doExportMIDI();
|
||||
void _doExportMIDI(const QString& path);
|
||||
|
@ -95,12 +95,12 @@ public:
|
|||
void loadData(ProjectModel::SongGroupNode* node);
|
||||
void unloadData();
|
||||
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
|
||||
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
Qt::ItemFlags flags(const QModelIndex& index) const;
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
||||
Qt::ItemFlags flags(const QModelIndex& index) const override;
|
||||
|
||||
int _insertRow(const std::pair<uint8_t, amuse::SongGroupIndex::PageEntry>& data);
|
||||
std::pair<uint8_t, amuse::SongGroupIndex::PageEntry> _removeRow(uint8_t prog);
|
||||
|
@ -141,12 +141,12 @@ public:
|
|||
void loadData(ProjectModel::SongGroupNode* node);
|
||||
void unloadData();
|
||||
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
|
||||
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
Qt::ItemFlags flags(const QModelIndex& index) const;
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
||||
Qt::ItemFlags flags(const QModelIndex& index) const override;
|
||||
|
||||
int _insertRow(std::tuple<amuse::SongId, std::string, std::array<amuse::SongGroupIndex::MIDISetup, 16>>& data);
|
||||
std::tuple<amuse::SongId, std::string, std::array<amuse::SongGroupIndex::MIDISetup, 16>> _removeRow(amuse::SongId id);
|
||||
|
@ -162,12 +162,12 @@ public:
|
|||
void loadData(std::pair<const amuse::SongId, std::array<amuse::SongGroupIndex::MIDISetup, 16>>* data);
|
||||
void unloadData();
|
||||
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
|
||||
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
Qt::ItemFlags flags(const QModelIndex& index) const;
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
||||
Qt::ItemFlags flags(const QModelIndex& index) const override;
|
||||
};
|
||||
|
||||
class PageTableView : public QTableView {
|
||||
|
@ -180,7 +180,7 @@ class PageTableView : public QTableView {
|
|||
|
||||
public:
|
||||
explicit PageTableView(QWidget* parent = Q_NULLPTR);
|
||||
void setModel(QAbstractItemModel* model);
|
||||
void setModel(QAbstractItemModel* model) override;
|
||||
void deleteSelection();
|
||||
};
|
||||
|
||||
|
@ -199,14 +199,14 @@ public:
|
|||
explicit SetupTableView(QWidget* parent = Q_NULLPTR);
|
||||
void setModel(QAbstractItemModel* list, QAbstractItemModel* table);
|
||||
void deleteSelection();
|
||||
void showEvent(QShowEvent* event);
|
||||
void showEvent(QShowEvent* event) override;
|
||||
};
|
||||
|
||||
class ColoredTabBarStyle : public QProxyStyle {
|
||||
public:
|
||||
using QProxyStyle::QProxyStyle;
|
||||
void drawControl(QStyle::ControlElement element, const QStyleOption* option, QPainter* painter,
|
||||
const QWidget* widget = nullptr) const;
|
||||
const QWidget* widget = nullptr) const override;
|
||||
};
|
||||
|
||||
class ColoredTabBar : public QTabBar {
|
||||
|
@ -237,14 +237,14 @@ class MIDIPlayerWidget : public QWidget {
|
|||
public:
|
||||
explicit MIDIPlayerWidget(QModelIndex index, amuse::GroupId gid, amuse::SongId id, const QString& path,
|
||||
QWidget* parent = Q_NULLPTR);
|
||||
~MIDIPlayerWidget();
|
||||
~MIDIPlayerWidget() override;
|
||||
amuse::SongId songId() const { return m_songId; }
|
||||
amuse::Sequencer* sequencer() const { return m_seq.get(); }
|
||||
void stopped();
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
void mouseDoubleClickEvent(QMouseEvent* event);
|
||||
void mousePressEvent(QMouseEvent* event);
|
||||
void mouseReleaseEvent(QMouseEvent* event) { event->ignore(); }
|
||||
void resizeEvent(QResizeEvent* event) override;
|
||||
void mouseDoubleClickEvent(QMouseEvent* event) override;
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
void mouseReleaseEvent(QMouseEvent* event) override { event->ignore(); }
|
||||
public slots:
|
||||
void clicked();
|
||||
};
|
||||
|
@ -265,12 +265,12 @@ class SongGroupEditor : public EditorWidget {
|
|||
public:
|
||||
explicit SongGroupEditor(QWidget* parent = Q_NULLPTR);
|
||||
bool loadData(ProjectModel::SongGroupNode* node);
|
||||
void unloadData();
|
||||
ProjectModel::INode* currentNode() const;
|
||||
void setEditorEnabled(bool en) {}
|
||||
void resizeEvent(QResizeEvent* ev);
|
||||
void unloadData() override;
|
||||
ProjectModel::INode* currentNode() const override;
|
||||
void setEditorEnabled(bool en) override {}
|
||||
void resizeEvent(QResizeEvent* ev) override;
|
||||
QTableView* getSetupListView() const { return m_setupTable->m_listView; }
|
||||
AmuseItemEditFlags itemEditFlags() const;
|
||||
AmuseItemEditFlags itemEditFlags() const override;
|
||||
private slots:
|
||||
void doAdd();
|
||||
void doSelectionChanged();
|
||||
|
@ -285,5 +285,5 @@ private slots:
|
|||
void setupRowsAboutToBeRemoved(const QModelIndex& parent, int first, int last);
|
||||
void setupModelAboutToBeReset();
|
||||
void setupDataChanged();
|
||||
void itemDeleteAction();
|
||||
void itemDeleteAction() override;
|
||||
};
|
||||
|
|
|
@ -11,7 +11,7 @@ public:
|
|||
explicit SFXDataChangeUndoCommand(ProjectModel::SoundGroupNode* node, const QString& text, amuse::SFXId sfx,
|
||||
int column, int redoVal)
|
||||
: EditorUndoCommand(node, text), m_sfx(sfx), m_column(column), m_redoVal(redoVal) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
amuse::SFXGroupIndex& index = *static_cast<ProjectModel::SoundGroupNode*>(m_node.get())->m_index;
|
||||
auto& map = index.m_sfxEntries;
|
||||
|
@ -42,7 +42,7 @@ public:
|
|||
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
amuse::SFXGroupIndex& index = *static_cast<ProjectModel::SoundGroupNode*>(m_node.get())->m_index;
|
||||
auto& map = index.m_sfxEntries;
|
||||
amuse::SFXGroupIndex::SFXEntry& entry = map[m_sfx];
|
||||
|
@ -90,7 +90,7 @@ public:
|
|||
explicit SFXNameChangeUndoCommand(ProjectModel::SoundGroupNode* node, const QString& text, amuse::SFXId sfx,
|
||||
std::string_view redoVal)
|
||||
: EditorUndoCommand(node, text), m_sfx(sfx), m_redoVal(redoVal) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
g_MainWindow->projectModel()->setIdDatabases(m_node.get());
|
||||
amuse::SFXGroupIndex& index = *static_cast<ProjectModel::SoundGroupNode*>(m_node.get())->m_index;
|
||||
|
@ -100,7 +100,7 @@ public:
|
|||
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
g_MainWindow->projectModel()->setIdDatabases(m_node.get());
|
||||
amuse::SFXGroupIndex& index = *static_cast<ProjectModel::SoundGroupNode*>(m_node.get())->m_index;
|
||||
auto& map = index.m_sfxEntries;
|
||||
|
@ -370,11 +370,11 @@ protected:
|
|||
*it = static_cast<SFXModel*>(m_view->model())->_removeRow(std::get<0>(*it));
|
||||
}
|
||||
}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
if (m_undid)
|
||||
EditorUndoCommand::redo();
|
||||
}
|
||||
|
@ -393,11 +393,11 @@ public:
|
|||
ProjectModel::SoundGroupNode* node, const QString& text, SFXTableView* view,
|
||||
std::vector<std::tuple<amuse::SFXId, std::string, amuse::SFXGroupIndex::SFXEntry>>&& data)
|
||||
: SFXRowUndoCommand(node, text, view, std::move(data)) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
base::undo();
|
||||
base::del();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
base::redo();
|
||||
base::add();
|
||||
}
|
||||
|
@ -411,11 +411,11 @@ public:
|
|||
ProjectModel::SoundGroupNode* node, const QString& text, SFXTableView* view,
|
||||
std::vector<std::tuple<amuse::SFXId, std::string, amuse::SFXGroupIndex::SFXEntry>>&& data)
|
||||
: SFXRowUndoCommand(node, text, view, std::move(data)) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
base::undo();
|
||||
base::add();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
base::redo();
|
||||
base::del();
|
||||
}
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
class SFXObjectDelegate : public BaseObjectDelegate {
|
||||
Q_OBJECT
|
||||
protected:
|
||||
ProjectModel::INode* getNode(const QAbstractItemModel* model, const QModelIndex& index) const;
|
||||
ProjectModel::INode* getNode(const QAbstractItemModel* model, const QModelIndex& index) const override;
|
||||
|
||||
public:
|
||||
explicit SFXObjectDelegate(QObject* parent = Q_NULLPTR);
|
||||
QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const;
|
||||
void setEditorData(QWidget* editor, const QModelIndex& index) const;
|
||||
void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const;
|
||||
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();
|
||||
};
|
||||
|
@ -53,12 +53,12 @@ public:
|
|||
void loadData(ProjectModel::SoundGroupNode* node);
|
||||
void unloadData();
|
||||
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
|
||||
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
Qt::ItemFlags flags(const QModelIndex& index) const;
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
||||
Qt::ItemFlags flags(const QModelIndex& index) const override;
|
||||
|
||||
int _insertRow(const std::tuple<amuse::SFXId, std::string, amuse::SFXGroupIndex::SFXEntry>& data);
|
||||
std::tuple<amuse::SFXId, std::string, amuse::SFXGroupIndex::SFXEntry> _removeRow(amuse::SFXId sfx);
|
||||
|
@ -73,7 +73,7 @@ class SFXTableView : public QTableView {
|
|||
|
||||
public:
|
||||
explicit SFXTableView(QWidget* parent = Q_NULLPTR);
|
||||
void setModel(QAbstractItemModel* model);
|
||||
void setModel(QAbstractItemModel* model) override;
|
||||
void deleteSelection();
|
||||
};
|
||||
|
||||
|
@ -88,14 +88,14 @@ class SFXPlayerWidget : public QWidget {
|
|||
|
||||
public:
|
||||
explicit SFXPlayerWidget(QModelIndex index, amuse::GroupId gid, amuse::SFXId id, QWidget* parent = Q_NULLPTR);
|
||||
~SFXPlayerWidget();
|
||||
~SFXPlayerWidget() override;
|
||||
amuse::SongId sfxId() const { return m_sfxId; }
|
||||
amuse::Voice* voice() const { return m_vox.get(); }
|
||||
void stopped();
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
void mouseDoubleClickEvent(QMouseEvent* event);
|
||||
void mousePressEvent(QMouseEvent* event);
|
||||
void mouseReleaseEvent(QMouseEvent* event) { event->ignore(); }
|
||||
void resizeEvent(QResizeEvent* event) override;
|
||||
void mouseDoubleClickEvent(QMouseEvent* event) override;
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
void mouseReleaseEvent(QMouseEvent* event) override { event->ignore(); }
|
||||
public slots:
|
||||
void clicked();
|
||||
};
|
||||
|
@ -109,17 +109,17 @@ class SoundGroupEditor : public EditorWidget {
|
|||
public:
|
||||
explicit SoundGroupEditor(QWidget* parent = Q_NULLPTR);
|
||||
bool loadData(ProjectModel::SoundGroupNode* node);
|
||||
void unloadData();
|
||||
ProjectModel::INode* currentNode() const;
|
||||
void setEditorEnabled(bool en) {}
|
||||
void resizeEvent(QResizeEvent* ev);
|
||||
void unloadData() override;
|
||||
ProjectModel::INode* currentNode() const override;
|
||||
void setEditorEnabled(bool en) override {}
|
||||
void resizeEvent(QResizeEvent* ev) override;
|
||||
QTableView* getSFXListView() const { return m_sfxTable; }
|
||||
AmuseItemEditFlags itemEditFlags() const;
|
||||
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);
|
||||
void doAdd();
|
||||
void doSelectionChanged();
|
||||
void sfxDataChanged();
|
||||
void itemDeleteAction();
|
||||
void itemDeleteAction() override;
|
||||
};
|
||||
|
|
|
@ -280,7 +280,7 @@ public:
|
|||
, m_cmd(cmd)
|
||||
, m_field(field)
|
||||
, m_redoVal(redoVal) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
switch (m_field.m_tp) {
|
||||
case amuse::SoundMacro::CmdIntrospection::Field::Type::Bool:
|
||||
|
@ -316,7 +316,7 @@ public:
|
|||
}
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
switch (m_field.m_tp) {
|
||||
case amuse::SoundMacro::CmdIntrospection::Field::Type::Bool:
|
||||
m_undoVal = amuse::AccessField<bool>(m_cmd, m_field);
|
||||
|
@ -360,7 +360,7 @@ public:
|
|||
if (m_undid)
|
||||
EditorUndoCommand::redo();
|
||||
}
|
||||
bool mergeWith(const QUndoCommand* other) {
|
||||
bool mergeWith(const QUndoCommand* other) override {
|
||||
if (other->id() == id() && m_cmd == static_cast<const ValChangedUndoCommand*>(other)->m_cmd &&
|
||||
&m_field == &static_cast<const ValChangedUndoCommand*>(other)->m_field) {
|
||||
m_redoVal = static_cast<const ValChangedUndoCommand*>(other)->m_redoVal;
|
||||
|
@ -368,7 +368,7 @@ public:
|
|||
}
|
||||
return false;
|
||||
}
|
||||
int id() const { return int(Id::SMChangeVal); }
|
||||
int id() const override { return int(Id::SMChangeVal); }
|
||||
};
|
||||
|
||||
void CommandWidget::boolChanged(int state) {
|
||||
|
@ -557,12 +557,12 @@ class ReorderCommandsUndoCommand : public EditorUndoCommand {
|
|||
public:
|
||||
ReorderCommandsUndoCommand(int a, int b, const QString& text, amuse::ObjToken<ProjectModel::SoundMacroNode> node)
|
||||
: EditorUndoCommand(node.get(), SoundMacroListing::tr("Reorder %1").arg(text)), m_a(a), m_b(b) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
m_node.cast<ProjectModel::SoundMacroNode>()->m_obj->swapPositions(m_a, m_b);
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
m_node.cast<ProjectModel::SoundMacroNode>()->m_obj->swapPositions(m_a, m_b);
|
||||
if (m_undid)
|
||||
EditorUndoCommand::redo();
|
||||
|
@ -669,11 +669,11 @@ class InsertCommandUndoCommand : public EditorUndoCommand {
|
|||
public:
|
||||
InsertCommandUndoCommand(int insertIdx, const QString& text, amuse::ObjToken<ProjectModel::SoundMacroNode> node)
|
||||
: EditorUndoCommand(node.get(), SoundMacroListing::tr("Insert %1").arg(text)), m_insertIdx(insertIdx) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_cmd = m_node.cast<ProjectModel::SoundMacroNode>()->m_obj->deleteCmd(m_insertIdx);
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
if (!m_cmd)
|
||||
return;
|
||||
m_node.cast<ProjectModel::SoundMacroNode>()->m_obj->insertCmd(m_insertIdx, std::move(m_cmd));
|
||||
|
@ -714,13 +714,13 @@ class DeleteCommandUndoCommand : public EditorUndoCommand {
|
|||
public:
|
||||
DeleteCommandUndoCommand(int deleteIdx, const QString& text, amuse::ObjToken<ProjectModel::SoundMacroNode> node)
|
||||
: EditorUndoCommand(node.get(), SoundMacroListing::tr("Delete %1").arg(text)), m_deleteIdx(deleteIdx) {}
|
||||
void undo() {
|
||||
void undo() override {
|
||||
m_undid = true;
|
||||
m_node.cast<ProjectModel::SoundMacroNode>()->m_obj->insertCmd(m_deleteIdx, std::move(m_cmd));
|
||||
m_cmd.reset();
|
||||
EditorUndoCommand::undo();
|
||||
}
|
||||
void redo() {
|
||||
void redo() override {
|
||||
m_cmd = m_node.cast<ProjectModel::SoundMacroNode>()->m_obj->deleteCmd(m_deleteIdx);
|
||||
if (m_undid)
|
||||
EditorUndoCommand::redo();
|
||||
|
|
|
@ -20,10 +20,10 @@ class TargetButton : public QPushButton {
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit TargetButton(QWidget* parent = Q_NULLPTR);
|
||||
void mouseReleaseEvent(QMouseEvent* event) { event->ignore(); }
|
||||
void mouseMoveEvent(QMouseEvent* event) { event->ignore(); }
|
||||
void focusOutEvent(QFocusEvent* event) { event->ignore(); }
|
||||
void keyPressEvent(QKeyEvent* event) { event->ignore(); }
|
||||
void mouseReleaseEvent(QMouseEvent* event) override { event->ignore(); }
|
||||
void mouseMoveEvent(QMouseEvent* event) override { event->ignore(); }
|
||||
void focusOutEvent(QFocusEvent* event) override { event->ignore(); }
|
||||
void keyPressEvent(QKeyEvent* event) override { event->ignore(); }
|
||||
};
|
||||
|
||||
class FieldSoundMacroStep : public QWidget {
|
||||
|
@ -42,7 +42,7 @@ public slots:
|
|||
|
||||
public:
|
||||
explicit FieldSoundMacroStep(FieldProjectNode* macroField = Q_NULLPTR, QWidget* parent = Q_NULLPTR);
|
||||
~FieldSoundMacroStep();
|
||||
~FieldSoundMacroStep() override;
|
||||
void setIndex(int index);
|
||||
void cancel();
|
||||
};
|
||||
|
@ -72,7 +72,7 @@ private:
|
|||
public:
|
||||
CommandWidget(QWidget* parent, amuse::SoundMacro::ICmd* cmd, SoundMacroListing* listing);
|
||||
CommandWidget(QWidget* parent, amuse::SoundMacro::CmdOp op, SoundMacroListing* listing);
|
||||
void paintEvent(QPaintEvent* event);
|
||||
void paintEvent(QPaintEvent* event) override;
|
||||
QString getText() const { return m_titleLabel.text(); }
|
||||
};
|
||||
|
||||
|
@ -126,7 +126,7 @@ public:
|
|||
bool loadData(ProjectModel::SoundMacroNode* node);
|
||||
void unloadData();
|
||||
ProjectModel::INode* currentNode() const;
|
||||
void timerEvent(QTimerEvent* event);
|
||||
void timerEvent(QTimerEvent* event) override;
|
||||
};
|
||||
|
||||
class CatalogueItem : public QWidget {
|
||||
|
@ -147,9 +147,9 @@ class SoundMacroCatalogue : public QTreeWidget {
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit SoundMacroCatalogue(QWidget* parent = Q_NULLPTR);
|
||||
void mousePressEvent(QMouseEvent* event);
|
||||
void mouseReleaseEvent(QMouseEvent* event);
|
||||
void mouseMoveEvent(QMouseEvent* event);
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
void mouseReleaseEvent(QMouseEvent* event) override;
|
||||
void mouseMoveEvent(QMouseEvent* event) override;
|
||||
};
|
||||
|
||||
class SoundMacroEditor : public EditorWidget {
|
||||
|
@ -172,13 +172,13 @@ class SoundMacroEditor : public EditorWidget {
|
|||
public:
|
||||
explicit SoundMacroEditor(QWidget* parent = Q_NULLPTR);
|
||||
bool loadData(ProjectModel::SoundMacroNode* node);
|
||||
void unloadData();
|
||||
ProjectModel::INode* currentNode() const;
|
||||
void unloadData() override;
|
||||
ProjectModel::INode* currentNode() const override;
|
||||
|
||||
void mousePressEvent(QMouseEvent* event);
|
||||
void mouseReleaseEvent(QMouseEvent* event);
|
||||
void mouseMoveEvent(QMouseEvent* event);
|
||||
void keyPressEvent(QKeyEvent* event);
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
void mouseReleaseEvent(QMouseEvent* event) override;
|
||||
void mouseMoveEvent(QMouseEvent* event) override;
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
|
||||
public slots:
|
||||
void catalogueDoubleClicked(QTreeWidgetItem* item, int column);
|
||||
|
|
|
@ -13,10 +13,10 @@ class FXButton : public QPushButton {
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit FXButton(QWidget* parent = Q_NULLPTR);
|
||||
void mouseReleaseEvent(QMouseEvent* event) { event->ignore(); }
|
||||
void mouseMoveEvent(QMouseEvent* event) { event->ignore(); }
|
||||
void focusOutEvent(QFocusEvent* event) { event->ignore(); }
|
||||
void keyPressEvent(QKeyEvent* event) { event->ignore(); }
|
||||
void mouseReleaseEvent(QMouseEvent* event) override { event->ignore(); }
|
||||
void mouseMoveEvent(QMouseEvent* event) override { event->ignore(); }
|
||||
void focusOutEvent(QFocusEvent* event) override { event->ignore(); }
|
||||
void keyPressEvent(QKeyEvent* event) override { event->ignore(); }
|
||||
};
|
||||
|
||||
class StatusBarWidget : public QStatusBar {
|
||||
|
@ -73,7 +73,7 @@ class StatusBarFocus : public QObject {
|
|||
|
||||
public:
|
||||
explicit StatusBarFocus(StatusBarWidget* statusWidget) : QObject(statusWidget) {}
|
||||
~StatusBarFocus() { exit(); }
|
||||
~StatusBarFocus() override { exit(); }
|
||||
void setMessage(const QString& message);
|
||||
void enter();
|
||||
void exit();
|
||||
|
|
|
@ -46,7 +46,7 @@ class Uint32X8Button : public QPushButton {
|
|||
|
||||
public:
|
||||
explicit Uint32X8Button(int min, int max, QWidget* parent = Q_NULLPTR);
|
||||
void paintEvent(QPaintEvent* event);
|
||||
void paintEvent(QPaintEvent* event) override;
|
||||
Uint32X8Popup* popup() const { return m_popup; }
|
||||
QStyleOptionComboBox comboStyleOption() const;
|
||||
private slots:
|
||||
|
@ -77,7 +77,7 @@ public:
|
|||
EffectListing* getParent() const;
|
||||
explicit EffectWidget(QWidget* parent, amuse::EffectBaseTypeless* effect);
|
||||
explicit EffectWidget(QWidget* parent, amuse::EffectType op);
|
||||
void paintEvent(QPaintEvent* event);
|
||||
void paintEvent(QPaintEvent* event) override;
|
||||
QString getText() const { return m_titleLabel.text(); }
|
||||
};
|
||||
|
||||
|
@ -130,7 +130,7 @@ public:
|
|||
explicit EffectListing(QWidget* parent = Q_NULLPTR);
|
||||
bool loadData(amuse::Submix* submix);
|
||||
void unloadData();
|
||||
void timerEvent(QTimerEvent* event);
|
||||
void timerEvent(QTimerEvent* event) override;
|
||||
};
|
||||
|
||||
class EffectCatalogueItem : public QWidget {
|
||||
|
@ -151,9 +151,9 @@ class EffectCatalogue : public QTreeWidget {
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit EffectCatalogue(QWidget* parent = Q_NULLPTR);
|
||||
void mousePressEvent(QMouseEvent* event);
|
||||
void mouseReleaseEvent(QMouseEvent* event);
|
||||
void mouseMoveEvent(QMouseEvent* event);
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
void mouseReleaseEvent(QMouseEvent* event) override;
|
||||
void mouseMoveEvent(QMouseEvent* event) override;
|
||||
};
|
||||
|
||||
class StudioSetupWidget : public QWidget {
|
||||
|
@ -176,13 +176,13 @@ public:
|
|||
bool loadData(amuse::Studio* studio);
|
||||
void unloadData();
|
||||
|
||||
void mousePressEvent(QMouseEvent* event);
|
||||
void mouseReleaseEvent(QMouseEvent* event);
|
||||
void mouseMoveEvent(QMouseEvent* event);
|
||||
void keyPressEvent(QKeyEvent* event);
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
void mouseReleaseEvent(QMouseEvent* event) override;
|
||||
void mouseMoveEvent(QMouseEvent* event) override;
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
|
||||
void hideEvent(QHideEvent* event);
|
||||
void showEvent(QShowEvent* event);
|
||||
void hideEvent(QHideEvent* event) override;
|
||||
void showEvent(QShowEvent* event) override;
|
||||
void updateWindowPosition();
|
||||
|
||||
public slots:
|
||||
|
|
|
@ -37,19 +37,19 @@ static QIcon MakeAppIcon() {
|
|||
/* This is for adapting the get*Name methods */
|
||||
class BooInterface : public boo::IApplication {
|
||||
std::vector<boo::SystemString> m_args;
|
||||
void _deletedWindow(boo::IWindow* window) {}
|
||||
void _deletedWindow(boo::IWindow* window) override {}
|
||||
|
||||
public:
|
||||
EPlatformType getPlatformType() const { return EPlatformType::Qt; }
|
||||
EPlatformType getPlatformType() const override { return EPlatformType::Qt; }
|
||||
|
||||
int run() { return 0; }
|
||||
boo::SystemStringView getUniqueName() const { return _SYS_STR("amuse-gui"sv); }
|
||||
boo::SystemStringView getFriendlyName() const { return _SYS_STR("Amuse"sv); }
|
||||
boo::SystemStringView getProcessName() const { return _SYS_STR("amuse-gui"sv); }
|
||||
const std::vector<boo::SystemString>& getArgs() const { return m_args; }
|
||||
int run() override { return 0; }
|
||||
boo::SystemStringView getUniqueName() const override { return _SYS_STR("amuse-gui"sv); }
|
||||
boo::SystemStringView getFriendlyName() const override { return _SYS_STR("Amuse"sv); }
|
||||
boo::SystemStringView getProcessName() const override { return _SYS_STR("amuse-gui"sv); }
|
||||
const std::vector<boo::SystemString>& getArgs() const override { return m_args; }
|
||||
|
||||
/* Constructors/initializers for sub-objects */
|
||||
std::shared_ptr<boo::IWindow> newWindow(boo::SystemStringView title) { return {}; }
|
||||
std::shared_ptr<boo::IWindow> newWindow(boo::SystemStringView title) override { return {}; }
|
||||
};
|
||||
|
||||
MainWindow* g_MainWindow = nullptr;
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
#include "amuse/BooBackend.hpp"
|
||||
#include "boo/boo.hpp"
|
||||
#include "logvisor/logvisor.hpp"
|
||||
#include <thread>
|
||||
|
||||
#include <map>
|
||||
|
||||
#define EMITTER_TEST 0
|
||||
|
||||
|
@ -15,15 +16,15 @@ struct EventCallback : boo::IWindowCallback {
|
|||
bool m_tracking = false;
|
||||
|
||||
public:
|
||||
void charKeyDown(unsigned long charCode, boo::EModifierKey mods, bool isRepeat);
|
||||
void charKeyUp(unsigned long charCode, boo::EModifierKey mods);
|
||||
void specialKeyDown(boo::ESpecialKey key, boo::EModifierKey mods, bool isRepeat);
|
||||
void specialKeyUp(boo::ESpecialKey key, boo::EModifierKey mods);
|
||||
void resized(const boo::SWindowRect&, bool) {}
|
||||
void charKeyDown(unsigned long charCode, boo::EModifierKey mods, bool isRepeat) override;
|
||||
void charKeyUp(unsigned long charCode, boo::EModifierKey mods) override;
|
||||
void specialKeyDown(boo::ESpecialKey key, boo::EModifierKey mods, bool isRepeat) override;
|
||||
void specialKeyUp(boo::ESpecialKey key, boo::EModifierKey mods) override;
|
||||
void resized(const boo::SWindowRect&, bool) override {}
|
||||
|
||||
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
|
||||
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
|
||||
void mouseMove(const boo::SWindowCoord& coord);
|
||||
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
|
||||
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
|
||||
void mouseMove(const boo::SWindowCoord& coord) override;
|
||||
|
||||
EventCallback(AppCallback& app) : m_app(app) {}
|
||||
};
|
||||
|
@ -557,7 +558,7 @@ struct AppCallback : boo::IApplicationCallback {
|
|||
}
|
||||
}
|
||||
|
||||
int appMain(boo::IApplication* app) {
|
||||
int appMain(boo::IApplication* app) override {
|
||||
/* Event window */
|
||||
m_win = app->newWindow(_SYS_STR("amuseplay"));
|
||||
m_win->setCallback(&m_events);
|
||||
|
@ -818,7 +819,7 @@ struct AppCallback : boo::IApplicationCallback {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void appQuitting(boo::IApplication*) { m_running = false; }
|
||||
void appQuitting(boo::IApplication*) override { m_running = false; }
|
||||
|
||||
AppCallback(int argc, const boo::SystemChar** argv)
|
||||
: m_argc(argc), m_argv(argv), m_eventRec(*this), m_events(m_eventRec) {}
|
||||
|
|
|
@ -19,24 +19,24 @@ class BooBackendVoice : public IBackendVoice {
|
|||
Voice& m_clientVox;
|
||||
struct VoiceCallback : boo::IAudioVoiceCallback {
|
||||
BooBackendVoice& m_parent;
|
||||
void preSupplyAudio(boo::IAudioVoice& voice, double dt);
|
||||
size_t supplyAudio(boo::IAudioVoice& voice, size_t frames, int16_t* data);
|
||||
void routeAudio(size_t frames, size_t channels, double dt, int busId, int16_t* in, int16_t* out);
|
||||
void routeAudio(size_t frames, size_t channels, double dt, int busId, int32_t* in, int32_t* out);
|
||||
void routeAudio(size_t frames, size_t channels, double dt, int busId, float* in, float* out);
|
||||
void preSupplyAudio(boo::IAudioVoice& voice, double dt) override;
|
||||
size_t supplyAudio(boo::IAudioVoice& voice, size_t frames, int16_t* data) override;
|
||||
void routeAudio(size_t frames, size_t channels, double dt, int busId, int16_t* in, int16_t* out) override;
|
||||
void routeAudio(size_t frames, size_t channels, double dt, int busId, int32_t* in, int32_t* out) override;
|
||||
void routeAudio(size_t frames, size_t channels, double dt, int busId, float* in, float* out) override;
|
||||
VoiceCallback(BooBackendVoice& parent) : m_parent(parent) {}
|
||||
} m_cb;
|
||||
boo::ObjToken<boo::IAudioVoice> m_booVoice;
|
||||
|
||||
public:
|
||||
BooBackendVoice(boo::IAudioVoiceEngine& engine, Voice& clientVox, double sampleRate, bool dynamicPitch);
|
||||
void resetSampleRate(double sampleRate);
|
||||
void resetSampleRate(double sampleRate) override;
|
||||
|
||||
void resetChannelLevels();
|
||||
void setChannelLevels(IBackendSubmix* submix, const float coefs[8], bool slew);
|
||||
void setPitchRatio(double ratio, bool slew);
|
||||
void start();
|
||||
void stop();
|
||||
void resetChannelLevels() override;
|
||||
void setChannelLevels(IBackendSubmix* submix, const float coefs[8], bool slew) override;
|
||||
void setPitchRatio(double ratio, bool slew) override;
|
||||
void start() override;
|
||||
void stop() override;
|
||||
};
|
||||
|
||||
/** Backend submix implementation for boo mixer */
|
||||
|
@ -46,20 +46,22 @@ class BooBackendSubmix : public IBackendSubmix {
|
|||
Submix& m_clientSmx;
|
||||
struct SubmixCallback : boo::IAudioSubmixCallback {
|
||||
BooBackendSubmix& m_parent;
|
||||
bool canApplyEffect() const;
|
||||
void applyEffect(int16_t* audio, size_t frameCount, const boo::ChannelMap& chanMap, double sampleRate) const;
|
||||
void applyEffect(int32_t* audio, size_t frameCount, const boo::ChannelMap& chanMap, double sampleRate) const;
|
||||
void applyEffect(float* audio, size_t frameCount, const boo::ChannelMap& chanMap, double sampleRate) const;
|
||||
void resetOutputSampleRate(double sampleRate);
|
||||
bool canApplyEffect() const override;
|
||||
void applyEffect(int16_t* audio, size_t frameCount, const boo::ChannelMap& chanMap,
|
||||
double sampleRate) const override;
|
||||
void applyEffect(int32_t* audio, size_t frameCount, const boo::ChannelMap& chanMap,
|
||||
double sampleRate) const override;
|
||||
void applyEffect(float* audio, size_t frameCount, const boo::ChannelMap& chanMap, double sampleRate) const override;
|
||||
void resetOutputSampleRate(double sampleRate) override;
|
||||
SubmixCallback(BooBackendSubmix& parent) : m_parent(parent) {}
|
||||
} m_cb;
|
||||
boo::ObjToken<boo::IAudioSubmix> m_booSubmix;
|
||||
|
||||
public:
|
||||
BooBackendSubmix(boo::IAudioVoiceEngine& engine, Submix& clientSmx, bool mainOut, int busId);
|
||||
void setSendLevel(IBackendSubmix* submix, float level, bool slew);
|
||||
double getSampleRate() const;
|
||||
SubmixFormat getSampleFormat() const;
|
||||
void setSendLevel(IBackendSubmix* submix, float level, bool slew) override;
|
||||
double getSampleRate() const override;
|
||||
SubmixFormat getSampleFormat() const override;
|
||||
};
|
||||
|
||||
/** Backend MIDI event reader for controlling sequencer with external hardware / software */
|
||||
|
@ -87,34 +89,34 @@ public:
|
|||
void setVirtualIn(bool v);
|
||||
bool hasVirtualIn() const;
|
||||
|
||||
void pumpReader(double dt);
|
||||
void pumpReader(double dt) override;
|
||||
|
||||
void noteOff(uint8_t chan, uint8_t key, uint8_t velocity);
|
||||
void noteOn(uint8_t chan, uint8_t key, uint8_t velocity);
|
||||
void notePressure(uint8_t chan, uint8_t key, uint8_t pressure);
|
||||
void controlChange(uint8_t chan, uint8_t control, uint8_t value);
|
||||
void programChange(uint8_t chan, uint8_t program);
|
||||
void channelPressure(uint8_t chan, uint8_t pressure);
|
||||
void pitchBend(uint8_t chan, int16_t pitch);
|
||||
void noteOff(uint8_t chan, uint8_t key, uint8_t velocity) override;
|
||||
void noteOn(uint8_t chan, uint8_t key, uint8_t velocity) override;
|
||||
void notePressure(uint8_t chan, uint8_t key, uint8_t pressure) override;
|
||||
void controlChange(uint8_t chan, uint8_t control, uint8_t value) override;
|
||||
void programChange(uint8_t chan, uint8_t program) override;
|
||||
void channelPressure(uint8_t chan, uint8_t pressure) override;
|
||||
void pitchBend(uint8_t chan, int16_t pitch) override;
|
||||
|
||||
void allSoundOff(uint8_t chan);
|
||||
void resetAllControllers(uint8_t chan);
|
||||
void localControl(uint8_t chan, bool on);
|
||||
void allNotesOff(uint8_t chan);
|
||||
void omniMode(uint8_t chan, bool on);
|
||||
void polyMode(uint8_t chan, bool on);
|
||||
void allSoundOff(uint8_t chan) override;
|
||||
void resetAllControllers(uint8_t chan) override;
|
||||
void localControl(uint8_t chan, bool on) override;
|
||||
void allNotesOff(uint8_t chan) override;
|
||||
void omniMode(uint8_t chan, bool on) override;
|
||||
void polyMode(uint8_t chan, bool on) override;
|
||||
|
||||
void sysex(const void* data, size_t len);
|
||||
void timeCodeQuarterFrame(uint8_t message, uint8_t value);
|
||||
void songPositionPointer(uint16_t pointer);
|
||||
void songSelect(uint8_t song);
|
||||
void tuneRequest();
|
||||
void sysex(const void* data, size_t len) override;
|
||||
void timeCodeQuarterFrame(uint8_t message, uint8_t value) override;
|
||||
void songPositionPointer(uint16_t pointer) override;
|
||||
void songSelect(uint8_t song) override;
|
||||
void tuneRequest() override;
|
||||
|
||||
void startSeq();
|
||||
void continueSeq();
|
||||
void stopSeq();
|
||||
void startSeq() override;
|
||||
void continueSeq() override;
|
||||
void stopSeq() override;
|
||||
|
||||
void reset();
|
||||
void reset() override;
|
||||
};
|
||||
|
||||
/** Backend voice allocator implementation for boo mixer */
|
||||
|
@ -127,14 +129,14 @@ protected:
|
|||
|
||||
public:
|
||||
BooBackendVoiceAllocator(boo::IAudioVoiceEngine& booEngine);
|
||||
std::unique_ptr<IBackendVoice> allocateVoice(Voice& clientVox, double sampleRate, bool dynamicPitch);
|
||||
std::unique_ptr<IBackendSubmix> allocateSubmix(Submix& clientSmx, bool mainOut, int busId);
|
||||
std::vector<std::pair<std::string, std::string>> enumerateMIDIDevices();
|
||||
std::unique_ptr<IMIDIReader> allocateMIDIReader(Engine& engine);
|
||||
void setCallbackInterface(Engine* engine);
|
||||
AudioChannelSet getAvailableSet();
|
||||
void setVolume(float vol);
|
||||
void on5MsInterval(boo::IAudioVoiceEngine& engine, double dt);
|
||||
void onPumpCycleComplete(boo::IAudioVoiceEngine& engine);
|
||||
std::unique_ptr<IBackendVoice> allocateVoice(Voice& clientVox, double sampleRate, bool dynamicPitch) override;
|
||||
std::unique_ptr<IBackendSubmix> allocateSubmix(Submix& clientSmx, bool mainOut, int busId) override;
|
||||
std::vector<std::pair<std::string, std::string>> enumerateMIDIDevices() override;
|
||||
std::unique_ptr<IMIDIReader> allocateMIDIReader(Engine& engine) override;
|
||||
void setCallbackInterface(Engine* engine) override;
|
||||
AudioChannelSet getAvailableSet() override;
|
||||
void setVolume(float vol) override;
|
||||
void on5MsInterval(boo::IAudioVoiceEngine& engine, double dt) override;
|
||||
void onPumpCycleComplete(boo::IAudioVoiceEngine& engine) override;
|
||||
};
|
||||
} // namespace amuse
|
||||
|
|
|
@ -101,14 +101,14 @@ class EffectChorusImp : public EffectBase<T>, public EffectChorus {
|
|||
void _update();
|
||||
|
||||
public:
|
||||
~EffectChorusImp();
|
||||
~EffectChorusImp() override;
|
||||
EffectChorusImp(uint32_t baseDelay, uint32_t variation, uint32_t period, double sampleRate);
|
||||
EffectChorusImp(const EffectChorusInfo& info, double sampleRate)
|
||||
: EffectChorusImp(info.baseDelay, info.variation, info.period, sampleRate) {}
|
||||
|
||||
void applyEffect(T* audio, size_t frameCount, const ChannelMap& chanMap);
|
||||
void resetOutputSampleRate(double sampleRate) { _setup(sampleRate); }
|
||||
void applyEffect(T* audio, size_t frameCount, const ChannelMap& chanMap) override;
|
||||
void resetOutputSampleRate(double sampleRate) override { _setup(sampleRate); }
|
||||
|
||||
EffectType Isa() const { return EffectType::Chorus; }
|
||||
EffectType Isa() const override { return EffectType::Chorus; }
|
||||
};
|
||||
} // namespace amuse
|
||||
|
|
|
@ -119,9 +119,9 @@ public:
|
|||
EffectDelayImp(uint32_t initDelay, uint32_t initFeedback, uint32_t initOutput, double sampleRate);
|
||||
EffectDelayImp(const EffectDelayInfo& info, double sampleRate);
|
||||
|
||||
void applyEffect(T* audio, size_t frameCount, const ChannelMap& chanMap);
|
||||
void resetOutputSampleRate(double sampleRate) { _setup(sampleRate); }
|
||||
void applyEffect(T* audio, size_t frameCount, const ChannelMap& chanMap) override;
|
||||
void resetOutputSampleRate(double sampleRate) override { _setup(sampleRate); }
|
||||
|
||||
EffectType Isa() const { return EffectType::Delay; }
|
||||
EffectType Isa() const override { return EffectType::Delay; }
|
||||
};
|
||||
} // namespace amuse
|
||||
|
|
|
@ -162,10 +162,10 @@ public:
|
|||
EffectReverbStdImp(const EffectReverbStdInfo& info, double sampleRate)
|
||||
: EffectReverbStdImp(info.coloration, info.mix, info.time, info.damping, info.preDelay, sampleRate) {}
|
||||
|
||||
void applyEffect(T* audio, size_t frameCount, const ChannelMap& chanMap);
|
||||
void resetOutputSampleRate(double sampleRate) { _setup(sampleRate); }
|
||||
void applyEffect(T* audio, size_t frameCount, const ChannelMap& chanMap) override;
|
||||
void resetOutputSampleRate(double sampleRate) override { _setup(sampleRate); }
|
||||
|
||||
EffectType Isa() const { return EffectType::ReverbStd; }
|
||||
EffectType Isa() const override { return EffectType::ReverbStd; }
|
||||
};
|
||||
|
||||
/** High-quality 3-stage reverb with per-channel low-pass and crosstalk */
|
||||
|
@ -196,9 +196,9 @@ public:
|
|||
EffectReverbHiImp(const EffectReverbHiInfo& info, double sampleRate)
|
||||
: EffectReverbHiImp(info.coloration, info.mix, info.time, info.damping, info.preDelay, info.crosstalk, sampleRate) {}
|
||||
|
||||
void applyEffect(T* audio, size_t frameCount, const ChannelMap& chanMap);
|
||||
void resetOutputSampleRate(double sampleRate) { _setup(sampleRate); }
|
||||
void applyEffect(T* audio, size_t frameCount, const ChannelMap& chanMap) override;
|
||||
void resetOutputSampleRate(double sampleRate) override { _setup(sampleRate); }
|
||||
|
||||
EffectType Isa() const { return EffectType::ReverbHi; }
|
||||
EffectType Isa() const override { return EffectType::ReverbHi; }
|
||||
};
|
||||
} // namespace amuse
|
||||
|
|
|
@ -49,7 +49,7 @@ class Emitter : public Entity {
|
|||
void _update();
|
||||
|
||||
public:
|
||||
~Emitter();
|
||||
~Emitter() override;
|
||||
Emitter(Engine& engine, const AudioGroup& group, ObjToken<Voice> vox, float maxDist, float minVol, float falloff,
|
||||
bool doppler);
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ protected:
|
|||
public:
|
||||
Entity(Engine& engine, const AudioGroup& group, GroupId groupId, ObjectId oid = ObjectId())
|
||||
: m_engine(engine), m_audioGroup(group), m_groupId(groupId), m_objectId(oid) {}
|
||||
~Entity() {
|
||||
~Entity() override {
|
||||
/* Ensure proper destruction procedure followed */
|
||||
assert(m_destroyed);
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ class Sequencer : public Entity {
|
|||
void _destroy();
|
||||
|
||||
public:
|
||||
~Sequencer();
|
||||
~Sequencer() override;
|
||||
Sequencer(Engine& engine, const AudioGroup& group, GroupId groupId, const SongGroupIndex* songGroup, SongId setupId,
|
||||
ObjToken<Studio> studio);
|
||||
Sequencer(Engine& engine, const AudioGroup& group, GroupId groupId, const SFXGroupIndex* sfxGroup,
|
||||
|
|
|
@ -193,7 +193,7 @@ class Voice : public Entity {
|
|||
void _notifyCtrlChange(uint8_t ctrl, int8_t val);
|
||||
|
||||
public:
|
||||
~Voice();
|
||||
~Voice() override;
|
||||
Voice(Engine& engine, const AudioGroup& group, GroupId groupId, int vid, bool emitter, ObjToken<Studio> studio);
|
||||
Voice(Engine& engine, const AudioGroup& group, GroupId groupId, ObjectId oid, int vid, bool emitter,
|
||||
ObjToken<Studio> studio);
|
||||
|
|
Loading…
Reference in New Issue