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