mirror of https://github.com/AxioDL/amuse.git
Merge pull request #38 from lioncash/athena
General: Be explicit about athena's Endian/SeekOrigin type
This commit is contained in:
commit
6c07ec907a
|
@ -67,18 +67,22 @@ static void VisitObjectFields(ProjectModel::SoundMacroNode* n,
|
||||||
break;
|
break;
|
||||||
switch (field.m_tp) {
|
switch (field.m_tp) {
|
||||||
case amuse::SoundMacro::CmdIntrospection::Field::Type::SoundMacroId:
|
case amuse::SoundMacro::CmdIntrospection::Field::Type::SoundMacroId:
|
||||||
if (!func(amuse::AccessField<amuse::SoundMacroIdDNA<athena::Little>>(p.get(), field).id,
|
if (!func(amuse::AccessField<amuse::SoundMacroIdDNA<athena::Endian::Little>>(p.get(), field).id,
|
||||||
amuse::SoundMacroId::CurNameDB))
|
amuse::SoundMacroId::CurNameDB)) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case amuse::SoundMacro::CmdIntrospection::Field::Type::TableId:
|
case amuse::SoundMacro::CmdIntrospection::Field::Type::TableId:
|
||||||
if (!func(amuse::AccessField<amuse::TableIdDNA<athena::Little>>(p.get(), field).id, amuse::TableId::CurNameDB))
|
if (!func(amuse::AccessField<amuse::TableIdDNA<athena::Endian::Little>>(p.get(), field).id,
|
||||||
|
amuse::TableId::CurNameDB)) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case amuse::SoundMacro::CmdIntrospection::Field::Type::SampleId:
|
case amuse::SoundMacro::CmdIntrospection::Field::Type::SampleId:
|
||||||
if (!func(amuse::AccessField<amuse::SampleIdDNA<athena::Little>>(p.get(), field).id,
|
if (!func(amuse::AccessField<amuse::SampleIdDNA<athena::Endian::Little>>(p.get(), field).id,
|
||||||
amuse::SampleId::CurNameDB))
|
amuse::SampleId::CurNameDB)) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -720,7 +724,7 @@ bool ProjectModel::exportGroup(const QString& path, const QString& groupName, UI
|
||||||
fo.writeUBytes(proj.data(), proj.size());
|
fo.writeUBytes(proj.data(), proj.size());
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto pool = group.getPool().toData<athena::Big>();
|
auto pool = group.getPool().toData<athena::Endian::Big>();
|
||||||
athena::io::FileWriter fo(QStringToSysString(basePath + QStringLiteral(".pool")));
|
athena::io::FileWriter fo(QStringToSysString(basePath + QStringLiteral(".pool")));
|
||||||
if (fo.hasError()) {
|
if (fo.hasError()) {
|
||||||
messenger.critical(tr("Export Error"), tr("Unable to export %1.pool").arg(groupName));
|
messenger.critical(tr("Export Error"), tr("Unable to export %1.pool").arg(groupName));
|
||||||
|
|
|
@ -219,8 +219,8 @@ CommandWidget::CommandWidget(QWidget* parent, amuse::SoundMacro::ICmd* cmd, amus
|
||||||
nf = new FieldProjectNode(collection, this);
|
nf = new FieldProjectNode(collection, this);
|
||||||
nf->setProperty("fieldIndex", f);
|
nf->setProperty("fieldIndex", f);
|
||||||
nf->setProperty("fieldName", fieldName);
|
nf->setProperty("fieldName", fieldName);
|
||||||
int index =
|
const int index = collection->indexOfId(
|
||||||
collection->indexOfId(amuse::AccessField<amuse::SoundMacroIdDNA<athena::Little>>(m_cmd, field).id);
|
amuse::AccessField<amuse::SoundMacroIdDNA<athena::Endian::Little>>(m_cmd, field).id);
|
||||||
nf->setCurrentIndex(index < 0 ? 0 : index + 1);
|
nf->setCurrentIndex(index < 0 ? 0 : index + 1);
|
||||||
connect(nf, &FieldProjectNode::currentIndexChanged, this, &CommandWidget::nodeChanged);
|
connect(nf, &FieldProjectNode::currentIndexChanged, this, &CommandWidget::nodeChanged);
|
||||||
layout->addWidget(nf, 1, f);
|
layout->addWidget(nf, 1, f);
|
||||||
|
@ -231,7 +231,8 @@ CommandWidget::CommandWidget(QWidget* parent, amuse::SoundMacro::ICmd* cmd, amus
|
||||||
sb->setFixedHeight(30);
|
sb->setFixedHeight(30);
|
||||||
sb->setProperty("fieldIndex", f);
|
sb->setProperty("fieldIndex", f);
|
||||||
sb->setProperty("fieldName", fieldName);
|
sb->setProperty("fieldName", fieldName);
|
||||||
sb->m_spinBox.setValue(amuse::AccessField<amuse::SoundMacroStepDNA<athena::Little>>(m_cmd, field).step);
|
sb->m_spinBox.setValue(
|
||||||
|
amuse::AccessField<amuse::SoundMacroStepDNA<athena::Endian::Little>>(m_cmd, field).step);
|
||||||
connect(sb, &FieldSoundMacroStep::valueChanged, this, &CommandWidget::numChanged);
|
connect(sb, &FieldSoundMacroStep::valueChanged, this, &CommandWidget::numChanged);
|
||||||
layout->addWidget(sb, 1, f);
|
layout->addWidget(sb, 1, f);
|
||||||
m_stepField = sb;
|
m_stepField = sb;
|
||||||
|
@ -315,7 +316,7 @@ public:
|
||||||
case amuse::SoundMacro::CmdIntrospection::Field::Type::SoundMacroStep:
|
case amuse::SoundMacro::CmdIntrospection::Field::Type::SoundMacroStep:
|
||||||
case amuse::SoundMacro::CmdIntrospection::Field::Type::TableId:
|
case amuse::SoundMacro::CmdIntrospection::Field::Type::TableId:
|
||||||
case amuse::SoundMacro::CmdIntrospection::Field::Type::SampleId:
|
case amuse::SoundMacro::CmdIntrospection::Field::Type::SampleId:
|
||||||
amuse::AccessField<amuse::SoundMacroIdDNA<athena::Little>>(m_cmd, m_field).id = uint16_t(m_undoVal);
|
amuse::AccessField<amuse::SoundMacroIdDNA<athena::Endian::Little>>(m_cmd, m_field).id = uint16_t(m_undoVal);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -357,8 +358,8 @@ public:
|
||||||
case amuse::SoundMacro::CmdIntrospection::Field::Type::SoundMacroStep:
|
case amuse::SoundMacro::CmdIntrospection::Field::Type::SoundMacroStep:
|
||||||
case amuse::SoundMacro::CmdIntrospection::Field::Type::TableId:
|
case amuse::SoundMacro::CmdIntrospection::Field::Type::TableId:
|
||||||
case amuse::SoundMacro::CmdIntrospection::Field::Type::SampleId:
|
case amuse::SoundMacro::CmdIntrospection::Field::Type::SampleId:
|
||||||
m_undoVal = amuse::AccessField<amuse::SoundMacroIdDNA<athena::Little>>(m_cmd, m_field).id.id;
|
m_undoVal = amuse::AccessField<amuse::SoundMacroIdDNA<athena::Endian::Little>>(m_cmd, m_field).id.id;
|
||||||
amuse::AccessField<amuse::SoundMacroIdDNA<athena::Little>>(m_cmd, m_field).id = uint16_t(m_redoVal);
|
amuse::AccessField<amuse::SoundMacroIdDNA<athena::Endian::Little>>(m_cmd, m_field).id = uint16_t(m_redoVal);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -36,7 +36,7 @@ struct AT_SPECIALIZE_PARMS(athena::Endian::Big, athena::Endian::Little) ObjectHe
|
||||||
AT_DECL_DNA
|
AT_DECL_DNA
|
||||||
Value<atUint32, DNAEn> size;
|
Value<atUint32, DNAEn> size;
|
||||||
ObjectIdDNA<DNAEn> objectId;
|
ObjectIdDNA<DNAEn> objectId;
|
||||||
Seek<2, athena::Current> pad;
|
Seek<2, athena::SeekOrigin::Current> pad;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SoundMacro {
|
struct SoundMacro {
|
||||||
|
@ -180,8 +180,8 @@ struct SoundMacro {
|
||||||
AT_DECL_DNA_YAMLV
|
AT_DECL_DNA_YAMLV
|
||||||
static const CmdIntrospection Introspective;
|
static const CmdIntrospection Introspective;
|
||||||
Value<atInt8> key;
|
Value<atInt8> key;
|
||||||
SoundMacroIdDNA<athena::Little> macro;
|
SoundMacroIdDNA<athena::Endian::Little> macro;
|
||||||
SoundMacroStepDNA<athena::Little> macroStep;
|
SoundMacroStepDNA<athena::Endian::Little> macroStep;
|
||||||
bool Do(SoundMacroState& st, Voice& vox) const override;
|
bool Do(SoundMacroState& st, Voice& vox) const override;
|
||||||
CmdOp Isa() const override { return CmdOp::SplitKey; }
|
CmdOp Isa() const override { return CmdOp::SplitKey; }
|
||||||
};
|
};
|
||||||
|
@ -189,8 +189,8 @@ struct SoundMacro {
|
||||||
AT_DECL_DNA_YAMLV
|
AT_DECL_DNA_YAMLV
|
||||||
static const CmdIntrospection Introspective;
|
static const CmdIntrospection Introspective;
|
||||||
Value<atInt8> velocity;
|
Value<atInt8> velocity;
|
||||||
SoundMacroIdDNA<athena::Little> macro;
|
SoundMacroIdDNA<athena::Endian::Little> macro;
|
||||||
SoundMacroStepDNA<athena::Little> macroStep;
|
SoundMacroStepDNA<athena::Endian::Little> macroStep;
|
||||||
bool Do(SoundMacroState& st, Voice& vox) const override;
|
bool Do(SoundMacroState& st, Voice& vox) const override;
|
||||||
CmdOp Isa() const override { return CmdOp::SplitVel; }
|
CmdOp Isa() const override { return CmdOp::SplitVel; }
|
||||||
};
|
};
|
||||||
|
@ -212,7 +212,7 @@ struct SoundMacro {
|
||||||
Value<bool> keyOff;
|
Value<bool> keyOff;
|
||||||
Value<bool> random;
|
Value<bool> random;
|
||||||
Value<bool> sampleEnd;
|
Value<bool> sampleEnd;
|
||||||
SoundMacroStepDNA<athena::Little> macroStep;
|
SoundMacroStepDNA<athena::Endian::Little> macroStep;
|
||||||
Value<atUint16> times;
|
Value<atUint16> times;
|
||||||
bool Do(SoundMacroState& st, Voice& vox) const override;
|
bool Do(SoundMacroState& st, Voice& vox) const override;
|
||||||
CmdOp Isa() const override { return CmdOp::Loop; }
|
CmdOp Isa() const override { return CmdOp::Loop; }
|
||||||
|
@ -221,8 +221,8 @@ struct SoundMacro {
|
||||||
AT_DECL_DNA_YAMLV
|
AT_DECL_DNA_YAMLV
|
||||||
static const CmdIntrospection Introspective;
|
static const CmdIntrospection Introspective;
|
||||||
Seek<1, athena::SeekOrigin::Current> dummy;
|
Seek<1, athena::SeekOrigin::Current> dummy;
|
||||||
SoundMacroIdDNA<athena::Little> macro;
|
SoundMacroIdDNA<athena::Endian::Little> macro;
|
||||||
SoundMacroStepDNA<athena::Little> macroStep;
|
SoundMacroStepDNA<athena::Endian::Little> macroStep;
|
||||||
bool Do(SoundMacroState& st, Voice& vox) const override;
|
bool Do(SoundMacroState& st, Voice& vox) const override;
|
||||||
CmdOp Isa() const override { return CmdOp::Goto; }
|
CmdOp Isa() const override { return CmdOp::Goto; }
|
||||||
};
|
};
|
||||||
|
@ -242,8 +242,8 @@ struct SoundMacro {
|
||||||
AT_DECL_DNA_YAMLV
|
AT_DECL_DNA_YAMLV
|
||||||
static const CmdIntrospection Introspective;
|
static const CmdIntrospection Introspective;
|
||||||
Value<atInt8> addNote;
|
Value<atInt8> addNote;
|
||||||
SoundMacroIdDNA<athena::Little> macro;
|
SoundMacroIdDNA<athena::Endian::Little> macro;
|
||||||
SoundMacroStepDNA<athena::Little> macroStep;
|
SoundMacroStepDNA<athena::Endian::Little> macroStep;
|
||||||
Value<atUint8> priority;
|
Value<atUint8> priority;
|
||||||
Value<atUint8> maxVoices;
|
Value<atUint8> maxVoices;
|
||||||
bool Do(SoundMacroState& st, Voice& vox) const override;
|
bool Do(SoundMacroState& st, Voice& vox) const override;
|
||||||
|
@ -261,8 +261,8 @@ struct SoundMacro {
|
||||||
AT_DECL_DNA_YAMLV
|
AT_DECL_DNA_YAMLV
|
||||||
static const CmdIntrospection Introspective;
|
static const CmdIntrospection Introspective;
|
||||||
Value<atInt8> modValue;
|
Value<atInt8> modValue;
|
||||||
SoundMacroIdDNA<athena::Little> macro;
|
SoundMacroIdDNA<athena::Endian::Little> macro;
|
||||||
SoundMacroStepDNA<athena::Little> macroStep;
|
SoundMacroStepDNA<athena::Endian::Little> macroStep;
|
||||||
bool Do(SoundMacroState& st, Voice& vox) const override;
|
bool Do(SoundMacroState& st, Voice& vox) const override;
|
||||||
CmdOp Isa() const override { return CmdOp::SplitMod; }
|
CmdOp Isa() const override { return CmdOp::SplitMod; }
|
||||||
};
|
};
|
||||||
|
@ -278,7 +278,7 @@ struct SoundMacro {
|
||||||
struct CmdSetAdsr : ICmd {
|
struct CmdSetAdsr : ICmd {
|
||||||
AT_DECL_DNA_YAMLV
|
AT_DECL_DNA_YAMLV
|
||||||
static const CmdIntrospection Introspective;
|
static const CmdIntrospection Introspective;
|
||||||
TableIdDNA<athena::Little> table;
|
TableIdDNA<athena::Endian::Little> table;
|
||||||
Value<bool> dlsMode;
|
Value<bool> dlsMode;
|
||||||
bool Do(SoundMacroState& st, Voice& vox) const override;
|
bool Do(SoundMacroState& st, Voice& vox) const override;
|
||||||
CmdOp Isa() const override { return CmdOp::SetAdsr; }
|
CmdOp Isa() const override { return CmdOp::SetAdsr; }
|
||||||
|
@ -288,7 +288,7 @@ struct SoundMacro {
|
||||||
static const CmdIntrospection Introspective;
|
static const CmdIntrospection Introspective;
|
||||||
Value<atInt8> scale;
|
Value<atInt8> scale;
|
||||||
Value<atInt8> add;
|
Value<atInt8> add;
|
||||||
TableIdDNA<athena::Little> table;
|
TableIdDNA<athena::Endian::Little> table;
|
||||||
Value<bool> originalVol;
|
Value<bool> originalVol;
|
||||||
bool Do(SoundMacroState& st, Voice& vox) const override;
|
bool Do(SoundMacroState& st, Voice& vox) const override;
|
||||||
CmdOp Isa() const override { return CmdOp::ScaleVolume; }
|
CmdOp Isa() const override { return CmdOp::ScaleVolume; }
|
||||||
|
@ -307,7 +307,7 @@ struct SoundMacro {
|
||||||
static const CmdIntrospection Introspective;
|
static const CmdIntrospection Introspective;
|
||||||
Value<atInt8> scale;
|
Value<atInt8> scale;
|
||||||
Value<atInt8> add;
|
Value<atInt8> add;
|
||||||
TableIdDNA<athena::Little> table;
|
TableIdDNA<athena::Endian::Little> table;
|
||||||
Value<bool> msSwitch;
|
Value<bool> msSwitch;
|
||||||
Value<atUint16> ticksOrMs;
|
Value<atUint16> ticksOrMs;
|
||||||
bool Do(SoundMacroState& st, Voice& vox) const override;
|
bool Do(SoundMacroState& st, Voice& vox) const override;
|
||||||
|
@ -317,7 +317,7 @@ struct SoundMacro {
|
||||||
AT_DECL_DNA_YAMLV
|
AT_DECL_DNA_YAMLV
|
||||||
static const CmdIntrospection Introspective;
|
static const CmdIntrospection Introspective;
|
||||||
enum class Mode : atInt8 { NoScale = 0, Negative = 1, Positive = 2 };
|
enum class Mode : atInt8 { NoScale = 0, Negative = 1, Positive = 2 };
|
||||||
SampleIdDNA<athena::Little> sample;
|
SampleIdDNA<athena::Endian::Little> sample;
|
||||||
Value<Mode> mode;
|
Value<Mode> mode;
|
||||||
Value<atUint32> offset;
|
Value<atUint32> offset;
|
||||||
bool Do(SoundMacroState& st, Voice& vox) const override;
|
bool Do(SoundMacroState& st, Voice& vox) const override;
|
||||||
|
@ -339,8 +339,8 @@ struct SoundMacro {
|
||||||
AT_DECL_DNA_YAMLV
|
AT_DECL_DNA_YAMLV
|
||||||
static const CmdIntrospection Introspective;
|
static const CmdIntrospection Introspective;
|
||||||
Value<atUint8> rnd;
|
Value<atUint8> rnd;
|
||||||
SoundMacroIdDNA<athena::Little> macro;
|
SoundMacroIdDNA<athena::Endian::Little> macro;
|
||||||
SoundMacroStepDNA<athena::Little> macroStep;
|
SoundMacroStepDNA<athena::Endian::Little> macroStep;
|
||||||
bool Do(SoundMacroState& st, Voice& vox) const override;
|
bool Do(SoundMacroState& st, Voice& vox) const override;
|
||||||
CmdOp Isa() const override { return CmdOp::SplitRnd; }
|
CmdOp Isa() const override { return CmdOp::SplitRnd; }
|
||||||
};
|
};
|
||||||
|
@ -349,7 +349,7 @@ struct SoundMacro {
|
||||||
static const CmdIntrospection Introspective;
|
static const CmdIntrospection Introspective;
|
||||||
Value<atInt8> scale;
|
Value<atInt8> scale;
|
||||||
Value<atInt8> add;
|
Value<atInt8> add;
|
||||||
TableIdDNA<athena::Little> table;
|
TableIdDNA<athena::Endian::Little> table;
|
||||||
Value<bool> msSwitch;
|
Value<bool> msSwitch;
|
||||||
Value<atUint16> ticksOrMs;
|
Value<atUint16> ticksOrMs;
|
||||||
bool Do(SoundMacroState& st, Voice& vox) const override;
|
bool Do(SoundMacroState& st, Voice& vox) const override;
|
||||||
|
@ -477,7 +477,7 @@ struct SoundMacro {
|
||||||
struct CmdSetPitchAdsr : ICmd {
|
struct CmdSetPitchAdsr : ICmd {
|
||||||
AT_DECL_DNA_YAMLV
|
AT_DECL_DNA_YAMLV
|
||||||
static const CmdIntrospection Introspective;
|
static const CmdIntrospection Introspective;
|
||||||
TableIdDNA<athena::Little> table;
|
TableIdDNA<athena::Endian::Little> table;
|
||||||
Seek<1, athena::SeekOrigin::Current> seek;
|
Seek<1, athena::SeekOrigin::Current> seek;
|
||||||
Value<atInt8> keys;
|
Value<atInt8> keys;
|
||||||
Value<atInt8> cents;
|
Value<atInt8> cents;
|
||||||
|
@ -519,8 +519,8 @@ struct SoundMacro {
|
||||||
AT_DECL_DNA_YAMLV
|
AT_DECL_DNA_YAMLV
|
||||||
static const CmdIntrospection Introspective;
|
static const CmdIntrospection Introspective;
|
||||||
Seek<1, athena::SeekOrigin::Current> seek;
|
Seek<1, athena::SeekOrigin::Current> seek;
|
||||||
SoundMacroIdDNA<athena::Little> macro;
|
SoundMacroIdDNA<athena::Endian::Little> macro;
|
||||||
SoundMacroStepDNA<athena::Little> macroStep;
|
SoundMacroStepDNA<athena::Endian::Little> macroStep;
|
||||||
bool Do(SoundMacroState& st, Voice& vox) const override;
|
bool Do(SoundMacroState& st, Voice& vox) const override;
|
||||||
CmdOp Isa() const override { return CmdOp::GoSub; }
|
CmdOp Isa() const override { return CmdOp::GoSub; }
|
||||||
};
|
};
|
||||||
|
@ -529,8 +529,8 @@ struct SoundMacro {
|
||||||
static const CmdIntrospection Introspective;
|
static const CmdIntrospection Introspective;
|
||||||
enum class EventType : atInt8 { KeyOff, SampleEnd, MessageRecv };
|
enum class EventType : atInt8 { KeyOff, SampleEnd, MessageRecv };
|
||||||
Value<EventType> event;
|
Value<EventType> event;
|
||||||
SoundMacroIdDNA<athena::Little> macro;
|
SoundMacroIdDNA<athena::Endian::Little> macro;
|
||||||
SoundMacroStepDNA<athena::Little> macroStep;
|
SoundMacroStepDNA<athena::Endian::Little> macroStep;
|
||||||
bool Do(SoundMacroState& st, Voice& vox) const override;
|
bool Do(SoundMacroState& st, Voice& vox) const override;
|
||||||
CmdOp Isa() const override { return CmdOp::TrapEvent; }
|
CmdOp Isa() const override { return CmdOp::TrapEvent; }
|
||||||
};
|
};
|
||||||
|
@ -545,7 +545,7 @@ struct SoundMacro {
|
||||||
AT_DECL_DNA_YAMLV
|
AT_DECL_DNA_YAMLV
|
||||||
static const CmdIntrospection Introspective;
|
static const CmdIntrospection Introspective;
|
||||||
Value<bool> isVar;
|
Value<bool> isVar;
|
||||||
SoundMacroIdDNA<athena::Little> macro;
|
SoundMacroIdDNA<athena::Endian::Little> macro;
|
||||||
Value<atUint8> voiceVar;
|
Value<atUint8> voiceVar;
|
||||||
Value<atUint8> valueVar;
|
Value<atUint8> valueVar;
|
||||||
bool Do(SoundMacroState& st, Voice& vox) const override;
|
bool Do(SoundMacroState& st, Voice& vox) const override;
|
||||||
|
@ -908,7 +908,7 @@ struct SoundMacro {
|
||||||
static const CmdIntrospection Introspective;
|
static const CmdIntrospection Introspective;
|
||||||
Value<bool> varCtrlA;
|
Value<bool> varCtrlA;
|
||||||
Value<atInt8> a;
|
Value<atInt8> a;
|
||||||
Seek<1, athena::Current> pad;
|
Seek<1, athena::SeekOrigin::Current> pad;
|
||||||
Value<atInt16> imm;
|
Value<atInt16> imm;
|
||||||
bool Do(SoundMacroState& st, Voice& vox) const override;
|
bool Do(SoundMacroState& st, Voice& vox) const override;
|
||||||
CmdOp Isa() const override { return CmdOp::SetVar; }
|
CmdOp Isa() const override { return CmdOp::SetVar; }
|
||||||
|
@ -921,7 +921,7 @@ struct SoundMacro {
|
||||||
Value<bool> varCtrlB;
|
Value<bool> varCtrlB;
|
||||||
Value<atInt8> b;
|
Value<atInt8> b;
|
||||||
Value<bool> notEq;
|
Value<bool> notEq;
|
||||||
SoundMacroStepDNA<athena::Little> macroStep;
|
SoundMacroStepDNA<athena::Endian::Little> macroStep;
|
||||||
bool Do(SoundMacroState& st, Voice& vox) const override;
|
bool Do(SoundMacroState& st, Voice& vox) const override;
|
||||||
CmdOp Isa() const override { return CmdOp::IfEqual; }
|
CmdOp Isa() const override { return CmdOp::IfEqual; }
|
||||||
};
|
};
|
||||||
|
@ -933,7 +933,7 @@ struct SoundMacro {
|
||||||
Value<bool> varCtrlB;
|
Value<bool> varCtrlB;
|
||||||
Value<atInt8> b;
|
Value<atInt8> b;
|
||||||
Value<bool> notLt;
|
Value<bool> notLt;
|
||||||
SoundMacroStepDNA<athena::Little> macroStep;
|
SoundMacroStepDNA<athena::Endian::Little> macroStep;
|
||||||
bool Do(SoundMacroState& st, Voice& vox) const override;
|
bool Do(SoundMacroState& st, Voice& vox) const override;
|
||||||
CmdOp Isa() const override { return CmdOp::IfLess; }
|
CmdOp Isa() const override { return CmdOp::IfLess; }
|
||||||
};
|
};
|
||||||
|
@ -1100,11 +1100,11 @@ struct AT_SPECIALIZE_PARMS(athena::Endian::Big, athena::Endian::Little) KeymapDN
|
||||||
Value<atInt8> transpose;
|
Value<atInt8> transpose;
|
||||||
Value<atInt8> pan; /* -128 for surround-channel only */
|
Value<atInt8> pan; /* -128 for surround-channel only */
|
||||||
Value<atInt8> prioOffset;
|
Value<atInt8> prioOffset;
|
||||||
Seek<3, athena::Current> pad;
|
Seek<3, athena::SeekOrigin::Current> pad;
|
||||||
};
|
};
|
||||||
struct Keymap : BigDNA {
|
struct Keymap : BigDNA {
|
||||||
AT_DECL_DNA_YAML
|
AT_DECL_DNA_YAML
|
||||||
SoundMacroIdDNA<athena::Big> macro;
|
SoundMacroIdDNA<athena::Endian::Big> macro;
|
||||||
Value<atInt8> transpose = 0;
|
Value<atInt8> transpose = 0;
|
||||||
Value<atInt8> pan = 64; /* -128 for surround-channel only */
|
Value<atInt8> pan = 64; /* -128 for surround-channel only */
|
||||||
Value<atInt8> prioOffset = 0;
|
Value<atInt8> prioOffset = 0;
|
||||||
|
@ -1142,11 +1142,11 @@ struct AT_SPECIALIZE_PARMS(athena::Endian::Big, athena::Endian::Little) LayerMap
|
||||||
Value<atInt8> prioOffset;
|
Value<atInt8> prioOffset;
|
||||||
Value<atInt8> span;
|
Value<atInt8> span;
|
||||||
Value<atInt8> pan;
|
Value<atInt8> pan;
|
||||||
Seek<3, athena::Current> pad;
|
Seek<3, athena::SeekOrigin::Current> pad;
|
||||||
};
|
};
|
||||||
struct LayerMapping : BigDNA {
|
struct LayerMapping : BigDNA {
|
||||||
AT_DECL_DNA_YAML
|
AT_DECL_DNA_YAML
|
||||||
SoundMacroIdDNA<athena::Big> macro;
|
SoundMacroIdDNA<athena::Endian::Big> macro;
|
||||||
Value<atInt8> keyLo = 0;
|
Value<atInt8> keyLo = 0;
|
||||||
Value<atInt8> keyHi = 127;
|
Value<atInt8> keyHi = 127;
|
||||||
Value<atInt8> transpose = 0;
|
Value<atInt8> transpose = 0;
|
||||||
|
|
|
@ -46,7 +46,7 @@ struct SongGroupIndex : AudioGroupIndex {
|
||||||
Value<atUint8> priority;
|
Value<atUint8> priority;
|
||||||
Value<atUint8> maxVoices;
|
Value<atUint8> maxVoices;
|
||||||
Value<atUint8> programNo;
|
Value<atUint8> programNo;
|
||||||
Seek<1, athena::Current> pad;
|
Seek<1, athena::SeekOrigin::Current> pad;
|
||||||
};
|
};
|
||||||
template <athena::Endian DNAEn>
|
template <athena::Endian DNAEn>
|
||||||
struct AT_SPECIALIZE_PARMS(athena::Endian::Big, athena::Endian::Little) MusyX1PageEntryDNA : BigDNA {
|
struct AT_SPECIALIZE_PARMS(athena::Endian::Big, athena::Endian::Little) MusyX1PageEntryDNA : BigDNA {
|
||||||
|
@ -56,11 +56,11 @@ struct SongGroupIndex : AudioGroupIndex {
|
||||||
Value<atUint8> maxVoices;
|
Value<atUint8> maxVoices;
|
||||||
Value<atUint8> unk;
|
Value<atUint8> unk;
|
||||||
Value<atUint8> programNo;
|
Value<atUint8> programNo;
|
||||||
Seek<2, athena::Current> pad;
|
Seek<2, athena::SeekOrigin::Current> pad;
|
||||||
};
|
};
|
||||||
struct PageEntry : BigDNA {
|
struct PageEntry : BigDNA {
|
||||||
AT_DECL_DNA_YAML
|
AT_DECL_DNA_YAML
|
||||||
PageObjectIdDNA<athena::Big> objId;
|
PageObjectIdDNA<athena::Endian::Big> objId;
|
||||||
Value<atUint8> priority = 0;
|
Value<atUint8> priority = 0;
|
||||||
Value<atUint8> maxVoices = 255;
|
Value<atUint8> maxVoices = 255;
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ struct SongGroupIndex : AudioGroupIndex {
|
||||||
Value<atUint8> panning;
|
Value<atUint8> panning;
|
||||||
Value<atUint8> reverb;
|
Value<atUint8> reverb;
|
||||||
Value<atUint8> chorus;
|
Value<atUint8> chorus;
|
||||||
Seek<3, athena::Current> pad;
|
Seek<3, athena::SeekOrigin::Current> pad;
|
||||||
};
|
};
|
||||||
struct MIDISetup : BigDNA {
|
struct MIDISetup : BigDNA {
|
||||||
AT_DECL_DNA_YAML
|
AT_DECL_DNA_YAML
|
||||||
|
@ -130,11 +130,11 @@ struct SFXGroupIndex : AudioGroupIndex {
|
||||||
Value<atUint8> defVel;
|
Value<atUint8> defVel;
|
||||||
Value<atUint8> panning;
|
Value<atUint8> panning;
|
||||||
Value<atUint8> defKey;
|
Value<atUint8> defKey;
|
||||||
Seek<1, athena::Current> pad;
|
Seek<1, athena::SeekOrigin::Current> pad;
|
||||||
};
|
};
|
||||||
struct SFXEntry : BigDNA {
|
struct SFXEntry : BigDNA {
|
||||||
AT_DECL_DNA_YAML
|
AT_DECL_DNA_YAML
|
||||||
PageObjectIdDNA<athena::Big> objId;
|
PageObjectIdDNA<athena::Endian::Big> objId;
|
||||||
Value<atUint8> priority = 0;
|
Value<atUint8> priority = 0;
|
||||||
Value<atUint8> maxVoices = 255;
|
Value<atUint8> maxVoices = 255;
|
||||||
Value<atUint8> defVel = 127;
|
Value<atUint8> defVel = 127;
|
||||||
|
|
|
@ -31,7 +31,7 @@ struct DSPADPCMHeader : BigDNA {
|
||||||
Value<atInt16> x46_loop_hist1 = 0;
|
Value<atInt16> x46_loop_hist1 = 0;
|
||||||
Value<atInt16> x48_loop_hist2 = 0;
|
Value<atInt16> x48_loop_hist2 = 0;
|
||||||
Value<atUint8> m_pitch = 0; // Stash this in the padding
|
Value<atUint8> m_pitch = 0; // Stash this in the padding
|
||||||
Seek<21, athena::Current> pad;
|
Seek<21, athena::SeekOrigin::Current> pad;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct VADPCMHeader : BigDNA {
|
struct VADPCMHeader : BigDNA {
|
||||||
|
@ -156,11 +156,11 @@ public:
|
||||||
struct AT_SPECIALIZE_PARMS(athena::Endian::Big, athena::Endian::Little) EntryDNA : BigDNA {
|
struct AT_SPECIALIZE_PARMS(athena::Endian::Big, athena::Endian::Little) EntryDNA : BigDNA {
|
||||||
AT_DECL_DNA
|
AT_DECL_DNA
|
||||||
SampleIdDNA<DNAEn> m_sfxId;
|
SampleIdDNA<DNAEn> m_sfxId;
|
||||||
Seek<2, athena::Current> pad;
|
Seek<2, athena::SeekOrigin::Current> pad;
|
||||||
Value<atUint32, DNAEn> m_sampleOff;
|
Value<atUint32, DNAEn> m_sampleOff;
|
||||||
Value<atUint32, DNAEn> m_unk;
|
Value<atUint32, DNAEn> m_unk;
|
||||||
Value<atUint8, DNAEn> m_pitch;
|
Value<atUint8, DNAEn> m_pitch;
|
||||||
Seek<1, athena::Current> pad2;
|
Seek<1, athena::SeekOrigin::Current> pad2;
|
||||||
Value<atUint16, DNAEn> m_sampleRate;
|
Value<atUint16, DNAEn> m_sampleRate;
|
||||||
Value<atUint32, DNAEn> m_numSamples; // Top 8 bits is SampleFormat
|
Value<atUint32, DNAEn> m_numSamples; // Top 8 bits is SampleFormat
|
||||||
Value<atUint32, DNAEn> m_loopStartSample;
|
Value<atUint32, DNAEn> m_loopStartSample;
|
||||||
|
@ -177,7 +177,7 @@ public:
|
||||||
struct AT_SPECIALIZE_PARMS(athena::Endian::Big, athena::Endian::Little) MusyX1SdirEntry : BigDNA {
|
struct AT_SPECIALIZE_PARMS(athena::Endian::Big, athena::Endian::Little) MusyX1SdirEntry : BigDNA {
|
||||||
AT_DECL_DNA
|
AT_DECL_DNA
|
||||||
SampleIdDNA<DNAEn> m_sfxId;
|
SampleIdDNA<DNAEn> m_sfxId;
|
||||||
Seek<2, athena::Current> pad;
|
Seek<2, athena::SeekOrigin::Current> pad;
|
||||||
Value<atUint32, DNAEn> m_sampleOff;
|
Value<atUint32, DNAEn> m_sampleOff;
|
||||||
Value<atUint32, DNAEn> m_pitchSampleRate;
|
Value<atUint32, DNAEn> m_pitchSampleRate;
|
||||||
Value<atUint32, DNAEn> m_numSamples;
|
Value<atUint32, DNAEn> m_numSamples;
|
||||||
|
@ -188,7 +188,7 @@ public:
|
||||||
struct AT_SPECIALIZE_PARMS(athena::Endian::Big, athena::Endian::Little) MusyX1AbsSdirEntry : BigDNA {
|
struct AT_SPECIALIZE_PARMS(athena::Endian::Big, athena::Endian::Little) MusyX1AbsSdirEntry : BigDNA {
|
||||||
AT_DECL_DNA
|
AT_DECL_DNA
|
||||||
SampleIdDNA<DNAEn> m_sfxId;
|
SampleIdDNA<DNAEn> m_sfxId;
|
||||||
Seek<2, athena::Current> pad;
|
Seek<2, athena::SeekOrigin::Current> pad;
|
||||||
Value<uint32_t, DNAEn> m_sampleOff;
|
Value<uint32_t, DNAEn> m_sampleOff;
|
||||||
Value<uint32_t, DNAEn> m_unk;
|
Value<uint32_t, DNAEn> m_unk;
|
||||||
Value<uint32_t, DNAEn> m_pitchSampleRate;
|
Value<uint32_t, DNAEn> m_pitchSampleRate;
|
||||||
|
|
|
@ -38,10 +38,10 @@ constexpr float NativeSampleRate = 32000.0f;
|
||||||
namespace amuse {
|
namespace amuse {
|
||||||
struct NameDB;
|
struct NameDB;
|
||||||
|
|
||||||
using BigDNA = athena::io::DNA<athena::Big>;
|
using BigDNA = athena::io::DNA<athena::Endian::Big>;
|
||||||
using LittleDNA = athena::io::DNA<athena::Little>;
|
using LittleDNA = athena::io::DNA<athena::Endian::Little>;
|
||||||
using BigDNAV = athena::io::DNAVYaml<athena::Big>;
|
using BigDNAV = athena::io::DNAVYaml<athena::Endian::Big>;
|
||||||
using LittleDNAV = athena::io::DNAVYaml<athena::Little>;
|
using LittleDNAV = athena::io::DNAVYaml<athena::Endian::Little>;
|
||||||
|
|
||||||
/** Common ID structure statically tagging
|
/** Common ID structure statically tagging
|
||||||
* SoundMacros, Tables, Keymaps, Layers, Samples, SFX, Songs */
|
* SoundMacros, Tables, Keymaps, Layers, Samples, SFX, Songs */
|
||||||
|
|
|
@ -67,7 +67,7 @@ struct MakeDefaultCmdOp {
|
||||||
case amuse::SoundMacro::CmdIntrospection::Field::Type::SoundMacroStep:
|
case amuse::SoundMacro::CmdIntrospection::Field::Type::SoundMacroStep:
|
||||||
case amuse::SoundMacro::CmdIntrospection::Field::Type::TableId:
|
case amuse::SoundMacro::CmdIntrospection::Field::Type::TableId:
|
||||||
case amuse::SoundMacro::CmdIntrospection::Field::Type::SampleId:
|
case amuse::SoundMacro::CmdIntrospection::Field::Type::SampleId:
|
||||||
AccessField<SoundMacroIdDNA<athena::Little>>(ret.get(), field).id = uint16_t(field.m_default);
|
AccessField<SoundMacroIdDNA<athena::Endian::Little>>(ret.get(), field).id = uint16_t(field.m_default);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -88,7 +88,7 @@ struct IntrospectCmdOp {
|
||||||
|
|
||||||
static bool AtEnd(athena::io::IStreamReader& r) {
|
static bool AtEnd(athena::io::IStreamReader& r) {
|
||||||
uint32_t v = r.readUint32Big();
|
uint32_t v = r.readUint32Big();
|
||||||
r.seek(-4, athena::Current);
|
r.seek(-4, athena::SeekOrigin::Current);
|
||||||
return v == 0xffffffff;
|
return v == 0xffffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ AudioGroupPool AudioGroupPool::_AudioGroupPool(athena::io::IStreamReader& r) {
|
||||||
head.read(r);
|
head.read(r);
|
||||||
|
|
||||||
if (head.soundMacrosOffset) {
|
if (head.soundMacrosOffset) {
|
||||||
r.seek(head.soundMacrosOffset, athena::Begin);
|
r.seek(head.soundMacrosOffset, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd(r)) {
|
while (!AtEnd(r)) {
|
||||||
ObjectHeader<DNAE> objHead;
|
ObjectHeader<DNAE> objHead;
|
||||||
atInt64 startPos = r.position();
|
atInt64 startPos = r.position();
|
||||||
|
@ -111,12 +111,12 @@ AudioGroupPool AudioGroupPool::_AudioGroupPool(athena::io::IStreamReader& r) {
|
||||||
auto& macro = ret.m_soundMacros[objHead.objectId.id];
|
auto& macro = ret.m_soundMacros[objHead.objectId.id];
|
||||||
macro = MakeObj<SoundMacro>();
|
macro = MakeObj<SoundMacro>();
|
||||||
macro->template readCmds<DNAE>(r, objHead.size - 8);
|
macro->template readCmds<DNAE>(r, objHead.size - 8);
|
||||||
r.seek(startPos + objHead.size, athena::Begin);
|
r.seek(startPos + objHead.size, athena::SeekOrigin::Begin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (head.tablesOffset) {
|
if (head.tablesOffset) {
|
||||||
r.seek(head.tablesOffset, athena::Begin);
|
r.seek(head.tablesOffset, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd(r)) {
|
while (!AtEnd(r)) {
|
||||||
ObjectHeader<DNAE> objHead;
|
ObjectHeader<DNAE> objHead;
|
||||||
atInt64 startPos = r.position();
|
atInt64 startPos = r.position();
|
||||||
|
@ -139,12 +139,12 @@ AudioGroupPool AudioGroupPool::_AudioGroupPool(athena::io::IStreamReader& r) {
|
||||||
r.readUBytesToBuf(&static_cast<Curve&>(**ptr).data[0], objHead.size - 8);
|
r.readUBytesToBuf(&static_cast<Curve&>(**ptr).data[0], objHead.size - 8);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
r.seek(startPos + objHead.size, athena::Begin);
|
r.seek(startPos + objHead.size, athena::SeekOrigin::Begin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (head.keymapsOffset) {
|
if (head.keymapsOffset) {
|
||||||
r.seek(head.keymapsOffset, athena::Begin);
|
r.seek(head.keymapsOffset, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd(r)) {
|
while (!AtEnd(r)) {
|
||||||
ObjectHeader<DNAE> objHead;
|
ObjectHeader<DNAE> objHead;
|
||||||
atInt64 startPos = r.position();
|
atInt64 startPos = r.position();
|
||||||
|
@ -159,12 +159,12 @@ AudioGroupPool AudioGroupPool::_AudioGroupPool(athena::io::IStreamReader& r) {
|
||||||
kmData.read(r);
|
kmData.read(r);
|
||||||
(*km)[i] = kmData;
|
(*km)[i] = kmData;
|
||||||
}
|
}
|
||||||
r.seek(startPos + objHead.size, athena::Begin);
|
r.seek(startPos + objHead.size, athena::SeekOrigin::Begin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (head.layersOffset) {
|
if (head.layersOffset) {
|
||||||
r.seek(head.layersOffset, athena::Begin);
|
r.seek(head.layersOffset, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd(r)) {
|
while (!AtEnd(r)) {
|
||||||
ObjectHeader<DNAE> objHead;
|
ObjectHeader<DNAE> objHead;
|
||||||
atInt64 startPos = r.position();
|
atInt64 startPos = r.position();
|
||||||
|
@ -182,14 +182,14 @@ AudioGroupPool AudioGroupPool::_AudioGroupPool(athena::io::IStreamReader& r) {
|
||||||
lmData.read(r);
|
lmData.read(r);
|
||||||
lm->push_back(lmData);
|
lm->push_back(lmData);
|
||||||
}
|
}
|
||||||
r.seek(startPos + objHead.size, athena::Begin);
|
r.seek(startPos + objHead.size, athena::SeekOrigin::Begin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
template AudioGroupPool AudioGroupPool::_AudioGroupPool<athena::Big>(athena::io::IStreamReader& r);
|
template AudioGroupPool AudioGroupPool::_AudioGroupPool<athena::Endian::Big>(athena::io::IStreamReader& r);
|
||||||
template AudioGroupPool AudioGroupPool::_AudioGroupPool<athena::Little>(athena::io::IStreamReader& r);
|
template AudioGroupPool AudioGroupPool::_AudioGroupPool<athena::Endian::Little>(athena::io::IStreamReader& r);
|
||||||
|
|
||||||
AudioGroupPool AudioGroupPool::CreateAudioGroupPool(const AudioGroupData& data) {
|
AudioGroupPool AudioGroupPool::CreateAudioGroupPool(const AudioGroupData& data) {
|
||||||
if (data.getPoolSize() < 16)
|
if (data.getPoolSize() < 16)
|
||||||
|
@ -197,9 +197,9 @@ AudioGroupPool AudioGroupPool::CreateAudioGroupPool(const AudioGroupData& data)
|
||||||
athena::io::MemoryReader r(data.getPool(), data.getPoolSize());
|
athena::io::MemoryReader r(data.getPool(), data.getPoolSize());
|
||||||
switch (data.getDataFormat()) {
|
switch (data.getDataFormat()) {
|
||||||
case DataFormat::PC:
|
case DataFormat::PC:
|
||||||
return _AudioGroupPool<athena::Little>(r);
|
return _AudioGroupPool<athena::Endian::Little>(r);
|
||||||
default:
|
default:
|
||||||
return _AudioGroupPool<athena::Big>(r);
|
return _AudioGroupPool<athena::Endian::Big>(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,8 +339,8 @@ void SoundMacro::readCmds(athena::io::IStreamReader& r, uint32_t size) {
|
||||||
m_cmds.push_back(CmdDo<MakeCmdOp, std::unique_ptr<ICmd>>(mr));
|
m_cmds.push_back(CmdDo<MakeCmdOp, std::unique_ptr<ICmd>>(mr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
template void SoundMacro::readCmds<athena::Big>(athena::io::IStreamReader& r, uint32_t size);
|
template void SoundMacro::readCmds<athena::Endian::Big>(athena::io::IStreamReader& r, uint32_t size);
|
||||||
template void SoundMacro::readCmds<athena::Little>(athena::io::IStreamReader& r, uint32_t size);
|
template void SoundMacro::readCmds<athena::Endian::Little>(athena::io::IStreamReader& r, uint32_t size);
|
||||||
|
|
||||||
template <athena::Endian DNAE>
|
template <athena::Endian DNAE>
|
||||||
void SoundMacro::writeCmds(athena::io::IStreamWriter& w) const {
|
void SoundMacro::writeCmds(athena::io::IStreamWriter& w) const {
|
||||||
|
@ -352,8 +352,8 @@ void SoundMacro::writeCmds(athena::io::IStreamWriter& w) const {
|
||||||
athena::io::Write<athena::io::PropType::None>::Do<decltype(data), DNAE>({}, data, w);
|
athena::io::Write<athena::io::PropType::None>::Do<decltype(data), DNAE>({}, data, w);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
template void SoundMacro::writeCmds<athena::Big>(athena::io::IStreamWriter& w) const;
|
template void SoundMacro::writeCmds<athena::Endian::Big>(athena::io::IStreamWriter& w) const;
|
||||||
template void SoundMacro::writeCmds<athena::Little>(athena::io::IStreamWriter& w) const;
|
template void SoundMacro::writeCmds<athena::Endian::Little>(athena::io::IStreamWriter& w) const;
|
||||||
|
|
||||||
void SoundMacro::buildFromPrototype(const SoundMacro& other) {
|
void SoundMacro::buildFromPrototype(const SoundMacro& other) {
|
||||||
m_cmds.reserve(other.m_cmds.size());
|
m_cmds.reserve(other.m_cmds.size());
|
||||||
|
@ -1019,9 +1019,9 @@ std::vector<uint8_t> AudioGroupPool::toData() const {
|
||||||
p.second->template writeCmds<DNAE>(fo);
|
p.second->template writeCmds<DNAE>(fo);
|
||||||
objHead.size = fo.position() - startPos;
|
objHead.size = fo.position() - startPos;
|
||||||
objHead.objectId = p.first;
|
objHead.objectId = p.first;
|
||||||
fo.seek(startPos, athena::Begin);
|
fo.seek(startPos, athena::SeekOrigin::Begin);
|
||||||
objHead.write(fo);
|
objHead.write(fo);
|
||||||
fo.seek(startPos + objHead.size, athena::Begin);
|
fo.seek(startPos + objHead.size, athena::SeekOrigin::Begin);
|
||||||
}
|
}
|
||||||
athena::io::Write<athena::io::PropType::None>::Do<decltype(term), DNAE>({}, term, fo);
|
athena::io::Write<athena::io::PropType::None>::Do<decltype(term), DNAE>({}, term, fo);
|
||||||
}
|
}
|
||||||
|
@ -1049,9 +1049,9 @@ std::vector<uint8_t> AudioGroupPool::toData() const {
|
||||||
}
|
}
|
||||||
objHead.size = fo.position() - startPos;
|
objHead.size = fo.position() - startPos;
|
||||||
objHead.objectId = p.first;
|
objHead.objectId = p.first;
|
||||||
fo.seek(startPos, athena::Begin);
|
fo.seek(startPos, athena::SeekOrigin::Begin);
|
||||||
objHead.write(fo);
|
objHead.write(fo);
|
||||||
fo.seek(startPos + objHead.size, athena::Begin);
|
fo.seek(startPos + objHead.size, athena::SeekOrigin::Begin);
|
||||||
}
|
}
|
||||||
athena::io::Write<athena::io::PropType::None>::Do<decltype(term), DNAE>({}, term, fo);
|
athena::io::Write<athena::io::PropType::None>::Do<decltype(term), DNAE>({}, term, fo);
|
||||||
}
|
}
|
||||||
|
@ -1068,9 +1068,9 @@ std::vector<uint8_t> AudioGroupPool::toData() const {
|
||||||
}
|
}
|
||||||
objHead.size = fo.position() - startPos;
|
objHead.size = fo.position() - startPos;
|
||||||
objHead.objectId = p.first;
|
objHead.objectId = p.first;
|
||||||
fo.seek(startPos, athena::Begin);
|
fo.seek(startPos, athena::SeekOrigin::Begin);
|
||||||
objHead.write(fo);
|
objHead.write(fo);
|
||||||
fo.seek(startPos + objHead.size, athena::Begin);
|
fo.seek(startPos + objHead.size, athena::SeekOrigin::Begin);
|
||||||
}
|
}
|
||||||
athena::io::Write<athena::io::PropType::None>::Do<decltype(term), DNAE>({}, term, fo);
|
athena::io::Write<athena::io::PropType::None>::Do<decltype(term), DNAE>({}, term, fo);
|
||||||
}
|
}
|
||||||
|
@ -1089,20 +1089,20 @@ std::vector<uint8_t> AudioGroupPool::toData() const {
|
||||||
}
|
}
|
||||||
objHead.size = fo.position() - startPos;
|
objHead.size = fo.position() - startPos;
|
||||||
objHead.objectId = p.first;
|
objHead.objectId = p.first;
|
||||||
fo.seek(startPos, athena::Begin);
|
fo.seek(startPos, athena::SeekOrigin::Begin);
|
||||||
objHead.write(fo);
|
objHead.write(fo);
|
||||||
fo.seek(startPos + objHead.size, athena::Begin);
|
fo.seek(startPos + objHead.size, athena::SeekOrigin::Begin);
|
||||||
}
|
}
|
||||||
athena::io::Write<athena::io::PropType::None>::Do<decltype(term), DNAE>({}, term, fo);
|
athena::io::Write<athena::io::PropType::None>::Do<decltype(term), DNAE>({}, term, fo);
|
||||||
}
|
}
|
||||||
|
|
||||||
fo.seek(0, athena::Begin);
|
fo.seek(0, athena::SeekOrigin::Begin);
|
||||||
head.write(fo);
|
head.write(fo);
|
||||||
|
|
||||||
return fo.data();
|
return fo.data();
|
||||||
}
|
}
|
||||||
template std::vector<uint8_t> AudioGroupPool::toData<athena::Big>() const;
|
template std::vector<uint8_t> AudioGroupPool::toData<athena::Endian::Big>() const;
|
||||||
template std::vector<uint8_t> AudioGroupPool::toData<athena::Little>() const;
|
template std::vector<uint8_t> AudioGroupPool::toData<athena::Endian::Little>() const;
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void amuse::Curve::Enumerate<LittleDNA::Read>(athena::io::IStreamReader& r) {
|
void amuse::Curve::Enumerate<LittleDNA::Read>(athena::io::IStreamReader& r) {
|
||||||
|
|
|
@ -13,19 +13,19 @@ namespace amuse {
|
||||||
|
|
||||||
static bool AtEnd64(athena::io::IStreamReader& r) {
|
static bool AtEnd64(athena::io::IStreamReader& r) {
|
||||||
uint64_t v = r.readUint64Big();
|
uint64_t v = r.readUint64Big();
|
||||||
r.seek(-8, athena::Current);
|
r.seek(-8, athena::SeekOrigin::Current);
|
||||||
return v == 0xffffffffffffffff;
|
return v == 0xffffffffffffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool AtEnd32(athena::io::IStreamReader& r) {
|
static bool AtEnd32(athena::io::IStreamReader& r) {
|
||||||
uint32_t v = r.readUint32Big();
|
uint32_t v = r.readUint32Big();
|
||||||
r.seek(-4, athena::Current);
|
r.seek(-4, athena::SeekOrigin::Current);
|
||||||
return v == 0xffffffff;
|
return v == 0xffffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool AtEnd16(athena::io::IStreamReader& r) {
|
static bool AtEnd16(athena::io::IStreamReader& r) {
|
||||||
uint16_t v = r.readUint16Big();
|
uint16_t v = r.readUint16Big();
|
||||||
r.seek(-2, athena::Current);
|
r.seek(-2, athena::SeekOrigin::Current);
|
||||||
return v == 0xffff;
|
return v == 0xffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ static void WriteRangedObjectIds(athena::io::IStreamWriter& w, const T& list) {
|
||||||
|
|
||||||
AudioGroupProject::AudioGroupProject(athena::io::IStreamReader& r, GCNDataTag) {
|
AudioGroupProject::AudioGroupProject(athena::io::IStreamReader& r, GCNDataTag) {
|
||||||
while (!AtEnd32(r)) {
|
while (!AtEnd32(r)) {
|
||||||
GroupHeader<athena::Big> header;
|
GroupHeader<athena::Endian::Big> header;
|
||||||
header.read(r);
|
header.read(r);
|
||||||
|
|
||||||
if (GroupId::CurNameDB)
|
if (GroupId::CurNameDB)
|
||||||
|
@ -90,29 +90,34 @@ AudioGroupProject::AudioGroupProject(athena::io::IStreamReader& r, GCNDataTag) {
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* Sound Macros */
|
/* Sound Macros */
|
||||||
r.seek(header.soundMacroIdsOff, athena::Begin);
|
r.seek(header.soundMacroIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r)) {
|
||||||
ReadRangedObjectIds<athena::Big>(SoundMacroId::CurNameDB, r, NameDB::Type::SoundMacro);
|
ReadRangedObjectIds<athena::Endian::Big>(SoundMacroId::CurNameDB, r, NameDB::Type::SoundMacro);
|
||||||
|
}
|
||||||
|
|
||||||
/* Samples */
|
/* Samples */
|
||||||
r.seek(header.samplIdsOff, athena::Begin);
|
r.seek(header.samplIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r)) {
|
||||||
ReadRangedObjectIds<athena::Big>(SampleId::CurNameDB, r, NameDB::Type::Sample);
|
ReadRangedObjectIds<athena::Endian::Big>(SampleId::CurNameDB, r, NameDB::Type::Sample);
|
||||||
|
}
|
||||||
|
|
||||||
/* Tables */
|
/* Tables */
|
||||||
r.seek(header.tableIdsOff, athena::Begin);
|
r.seek(header.tableIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r)) {
|
||||||
ReadRangedObjectIds<athena::Big>(TableId::CurNameDB, r, NameDB::Type::Table);
|
ReadRangedObjectIds<athena::Endian::Big>(TableId::CurNameDB, r, NameDB::Type::Table);
|
||||||
|
}
|
||||||
|
|
||||||
/* Keymaps */
|
/* Keymaps */
|
||||||
r.seek(header.keymapIdsOff, athena::Begin);
|
r.seek(header.keymapIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r)) {
|
||||||
ReadRangedObjectIds<athena::Big>(KeymapId::CurNameDB, r, NameDB::Type::Keymap);
|
ReadRangedObjectIds<athena::Endian::Big>(KeymapId::CurNameDB, r, NameDB::Type::Keymap);
|
||||||
|
}
|
||||||
|
|
||||||
/* Layers */
|
/* Layers */
|
||||||
r.seek(header.layerIdsOff, athena::Begin);
|
r.seek(header.layerIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r)) {
|
||||||
ReadRangedObjectIds<athena::Big>(LayersId::CurNameDB, r, NameDB::Type::Layer);
|
ReadRangedObjectIds<athena::Endian::Big>(LayersId::CurNameDB, r, NameDB::Type::Layer);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (header.type == GroupType::Song) {
|
if (header.type == GroupType::Song) {
|
||||||
|
@ -120,43 +125,45 @@ AudioGroupProject::AudioGroupProject(athena::io::IStreamReader& r, GCNDataTag) {
|
||||||
idx = MakeObj<SongGroupIndex>();
|
idx = MakeObj<SongGroupIndex>();
|
||||||
|
|
||||||
/* Normal pages */
|
/* Normal pages */
|
||||||
r.seek(header.pageTableOff, athena::Begin);
|
r.seek(header.pageTableOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd64(r)) {
|
while (!AtEnd64(r)) {
|
||||||
SongGroupIndex::PageEntryDNA<athena::Big> entry;
|
SongGroupIndex::PageEntryDNA<athena::Endian::Big> entry;
|
||||||
entry.read(r);
|
entry.read(r);
|
||||||
idx->m_normPages[entry.programNo] = entry;
|
idx->m_normPages[entry.programNo] = entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Drum pages */
|
/* Drum pages */
|
||||||
r.seek(header.drumTableOff, athena::Begin);
|
r.seek(header.drumTableOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd64(r)) {
|
while (!AtEnd64(r)) {
|
||||||
SongGroupIndex::PageEntryDNA<athena::Big> entry;
|
SongGroupIndex::PageEntryDNA<athena::Endian::Big> entry;
|
||||||
entry.read(r);
|
entry.read(r);
|
||||||
idx->m_drumPages[entry.programNo] = entry;
|
idx->m_drumPages[entry.programNo] = entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MIDI setups */
|
/* MIDI setups */
|
||||||
r.seek(header.midiSetupsOff, athena::Begin);
|
r.seek(header.midiSetupsOff, athena::SeekOrigin::Begin);
|
||||||
while (r.position() < header.groupEndOff) {
|
while (r.position() < header.groupEndOff) {
|
||||||
uint16_t songId = r.readUint16Big();
|
uint16_t songId = r.readUint16Big();
|
||||||
r.seek(2, athena::Current);
|
r.seek(2, athena::SeekOrigin::Current);
|
||||||
std::array<SongGroupIndex::MIDISetup, 16>& setup = idx->m_midiSetups[songId];
|
std::array<SongGroupIndex::MIDISetup, 16>& setup = idx->m_midiSetups[songId];
|
||||||
for (int i = 0; i < 16; ++i)
|
for (int i = 0; i < 16; ++i) {
|
||||||
setup[i].read(r);
|
setup[i].read(r);
|
||||||
if (SongId::CurNameDB)
|
}
|
||||||
|
if (SongId::CurNameDB) {
|
||||||
SongId::CurNameDB->registerPair(NameDB::generateName(songId, NameDB::Type::Song), songId);
|
SongId::CurNameDB->registerPair(NameDB::generateName(songId, NameDB::Type::Song), songId);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (header.type == GroupType::SFX) {
|
} else if (header.type == GroupType::SFX) {
|
||||||
auto& idx = m_sfxGroups[header.groupId];
|
auto& idx = m_sfxGroups[header.groupId];
|
||||||
idx = MakeObj<SFXGroupIndex>();
|
idx = MakeObj<SFXGroupIndex>();
|
||||||
|
|
||||||
/* SFX entries */
|
/* SFX entries */
|
||||||
r.seek(header.pageTableOff, athena::Begin);
|
r.seek(header.pageTableOff, athena::SeekOrigin::Begin);
|
||||||
uint16_t count = r.readUint16Big();
|
uint16_t count = r.readUint16Big();
|
||||||
r.seek(2, athena::Current);
|
r.seek(2, athena::SeekOrigin::Current);
|
||||||
idx->m_sfxEntries.reserve(count);
|
idx->m_sfxEntries.reserve(count);
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
SFXGroupIndex::SFXEntryDNA<athena::Big> entry;
|
SFXGroupIndex::SFXEntryDNA<athena::Endian::Big> entry;
|
||||||
entry.read(r);
|
entry.read(r);
|
||||||
idx->m_sfxEntries[entry.sfxId.id] = entry;
|
idx->m_sfxEntries[entry.sfxId.id] = entry;
|
||||||
if (SFXId::CurNameDB)
|
if (SFXId::CurNameDB)
|
||||||
|
@ -164,7 +171,7 @@ AudioGroupProject::AudioGroupProject(athena::io::IStreamReader& r, GCNDataTag) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
r.seek(header.groupEndOff, athena::Begin);
|
r.seek(header.groupEndOff, athena::SeekOrigin::Begin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,29 +189,34 @@ AudioGroupProject AudioGroupProject::_AudioGroupProject(athena::io::IStreamReade
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* Sound Macros */
|
/* Sound Macros */
|
||||||
r.seek(subDataOff + header.soundMacroIdsOff, athena::Begin);
|
r.seek(subDataOff + header.soundMacroIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r)) {
|
||||||
ReadRangedObjectIds<DNAE>(SoundMacroId::CurNameDB, r, NameDB::Type::SoundMacro);
|
ReadRangedObjectIds<DNAE>(SoundMacroId::CurNameDB, r, NameDB::Type::SoundMacro);
|
||||||
|
}
|
||||||
|
|
||||||
/* Samples */
|
/* Samples */
|
||||||
r.seek(subDataOff + header.samplIdsOff, athena::Begin);
|
r.seek(subDataOff + header.samplIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r)) {
|
||||||
ReadRangedObjectIds<DNAE>(SampleId::CurNameDB, r, NameDB::Type::Sample);
|
ReadRangedObjectIds<DNAE>(SampleId::CurNameDB, r, NameDB::Type::Sample);
|
||||||
|
}
|
||||||
|
|
||||||
/* Tables */
|
/* Tables */
|
||||||
r.seek(subDataOff + header.tableIdsOff, athena::Begin);
|
r.seek(subDataOff + header.tableIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r)) {
|
||||||
ReadRangedObjectIds<DNAE>(TableId::CurNameDB, r, NameDB::Type::Table);
|
ReadRangedObjectIds<DNAE>(TableId::CurNameDB, r, NameDB::Type::Table);
|
||||||
|
}
|
||||||
|
|
||||||
/* Keymaps */
|
/* Keymaps */
|
||||||
r.seek(subDataOff + header.keymapIdsOff, athena::Begin);
|
r.seek(subDataOff + header.keymapIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r)) {
|
||||||
ReadRangedObjectIds<DNAE>(KeymapId::CurNameDB, r, NameDB::Type::Keymap);
|
ReadRangedObjectIds<DNAE>(KeymapId::CurNameDB, r, NameDB::Type::Keymap);
|
||||||
|
}
|
||||||
|
|
||||||
/* Layers */
|
/* Layers */
|
||||||
r.seek(subDataOff + header.layerIdsOff, athena::Begin);
|
r.seek(subDataOff + header.layerIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r)) {
|
||||||
ReadRangedObjectIds<DNAE>(LayersId::CurNameDB, r, NameDB::Type::Layer);
|
ReadRangedObjectIds<DNAE>(LayersId::CurNameDB, r, NameDB::Type::Layer);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (header.type == GroupType::Song) {
|
if (header.type == GroupType::Song) {
|
||||||
|
@ -213,7 +225,7 @@ AudioGroupProject AudioGroupProject::_AudioGroupProject(athena::io::IStreamReade
|
||||||
|
|
||||||
if (absOffs) {
|
if (absOffs) {
|
||||||
/* Normal pages */
|
/* Normal pages */
|
||||||
r.seek(header.pageTableOff, athena::Begin);
|
r.seek(header.pageTableOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r)) {
|
while (!AtEnd16(r)) {
|
||||||
SongGroupIndex::PageEntryDNA<DNAE> entry;
|
SongGroupIndex::PageEntryDNA<DNAE> entry;
|
||||||
entry.read(r);
|
entry.read(r);
|
||||||
|
@ -221,7 +233,7 @@ AudioGroupProject AudioGroupProject::_AudioGroupProject(athena::io::IStreamReade
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Drum pages */
|
/* Drum pages */
|
||||||
r.seek(header.drumTableOff, athena::Begin);
|
r.seek(header.drumTableOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r)) {
|
while (!AtEnd16(r)) {
|
||||||
SongGroupIndex::PageEntryDNA<DNAE> entry;
|
SongGroupIndex::PageEntryDNA<DNAE> entry;
|
||||||
entry.read(r);
|
entry.read(r);
|
||||||
|
@ -229,19 +241,20 @@ AudioGroupProject AudioGroupProject::_AudioGroupProject(athena::io::IStreamReade
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MIDI setups */
|
/* MIDI setups */
|
||||||
r.seek(header.midiSetupsOff, athena::Begin);
|
r.seek(header.midiSetupsOff, athena::SeekOrigin::Begin);
|
||||||
while (r.position() < header.groupEndOff) {
|
while (r.position() < header.groupEndOff) {
|
||||||
uint16_t songId;
|
uint16_t songId;
|
||||||
athena::io::Read<athena::io::PropType::None>::Do<decltype(songId), DNAE>({}, songId, r);
|
athena::io::Read<athena::io::PropType::None>::Do<decltype(songId), DNAE>({}, songId, r);
|
||||||
r.seek(2, athena::Current);
|
r.seek(2, athena::SeekOrigin::Current);
|
||||||
std::array<SongGroupIndex::MIDISetup, 16>& setup = idx->m_midiSetups[songId];
|
std::array<SongGroupIndex::MIDISetup, 16>& setup = idx->m_midiSetups[songId];
|
||||||
for (int i = 0; i < 16; ++i)
|
for (int i = 0; i < 16; ++i) {
|
||||||
setup[i].read(r);
|
setup[i].read(r);
|
||||||
|
}
|
||||||
SongId::CurNameDB->registerPair(NameDB::generateName(songId, NameDB::Type::Song), songId);
|
SongId::CurNameDB->registerPair(NameDB::generateName(songId, NameDB::Type::Song), songId);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Normal pages */
|
/* Normal pages */
|
||||||
r.seek(subDataOff + header.pageTableOff, athena::Begin);
|
r.seek(subDataOff + header.pageTableOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r)) {
|
while (!AtEnd16(r)) {
|
||||||
SongGroupIndex::MusyX1PageEntryDNA<DNAE> entry;
|
SongGroupIndex::MusyX1PageEntryDNA<DNAE> entry;
|
||||||
entry.read(r);
|
entry.read(r);
|
||||||
|
@ -249,7 +262,7 @@ AudioGroupProject AudioGroupProject::_AudioGroupProject(athena::io::IStreamReade
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Drum pages */
|
/* Drum pages */
|
||||||
r.seek(subDataOff + header.drumTableOff, athena::Begin);
|
r.seek(subDataOff + header.drumTableOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r)) {
|
while (!AtEnd16(r)) {
|
||||||
SongGroupIndex::MusyX1PageEntryDNA<DNAE> entry;
|
SongGroupIndex::MusyX1PageEntryDNA<DNAE> entry;
|
||||||
entry.read(r);
|
entry.read(r);
|
||||||
|
@ -257,11 +270,11 @@ AudioGroupProject AudioGroupProject::_AudioGroupProject(athena::io::IStreamReade
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MIDI setups */
|
/* MIDI setups */
|
||||||
r.seek(subDataOff + header.midiSetupsOff, athena::Begin);
|
r.seek(subDataOff + header.midiSetupsOff, athena::SeekOrigin::Begin);
|
||||||
while (atInt64(r.position() + 4) < groupBegin + header.groupEndOff) {
|
while (atInt64(r.position() + 4) < groupBegin + header.groupEndOff) {
|
||||||
uint16_t songId;
|
uint16_t songId;
|
||||||
athena::io::Read<athena::io::PropType::None>::Do<decltype(songId), DNAE>({}, songId, r);
|
athena::io::Read<athena::io::PropType::None>::Do<decltype(songId), DNAE>({}, songId, r);
|
||||||
r.seek(2, athena::Current);
|
r.seek(2, athena::SeekOrigin::Current);
|
||||||
std::array<SongGroupIndex::MIDISetup, 16>& setup = idx->m_midiSetups[songId];
|
std::array<SongGroupIndex::MIDISetup, 16>& setup = idx->m_midiSetups[songId];
|
||||||
for (int i = 0; i < 16; ++i) {
|
for (int i = 0; i < 16; ++i) {
|
||||||
SongGroupIndex::MusyX1MIDISetup ent;
|
SongGroupIndex::MusyX1MIDISetup ent;
|
||||||
|
@ -276,24 +289,24 @@ AudioGroupProject AudioGroupProject::_AudioGroupProject(athena::io::IStreamReade
|
||||||
idx = MakeObj<SFXGroupIndex>();
|
idx = MakeObj<SFXGroupIndex>();
|
||||||
|
|
||||||
/* SFX entries */
|
/* SFX entries */
|
||||||
r.seek(subDataOff + header.pageTableOff, athena::Begin);
|
r.seek(subDataOff + header.pageTableOff, athena::SeekOrigin::Begin);
|
||||||
uint16_t count;
|
uint16_t count;
|
||||||
athena::io::Read<athena::io::PropType::None>::Do<decltype(count), DNAE>({}, count, r);
|
athena::io::Read<athena::io::PropType::None>::Do<decltype(count), DNAE>({}, count, r);
|
||||||
r.seek(2, athena::Current);
|
r.seek(2, athena::SeekOrigin::Current);
|
||||||
idx->m_sfxEntries.reserve(count);
|
idx->m_sfxEntries.reserve(count);
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
SFXGroupIndex::SFXEntryDNA<DNAE> entry;
|
SFXGroupIndex::SFXEntryDNA<DNAE> entry;
|
||||||
entry.read(r);
|
entry.read(r);
|
||||||
r.seek(2, athena::Current);
|
r.seek(2, athena::SeekOrigin::Current);
|
||||||
idx->m_sfxEntries[entry.sfxId.id] = entry;
|
idx->m_sfxEntries[entry.sfxId.id] = entry;
|
||||||
SFXId::CurNameDB->registerPair(NameDB::generateName(entry.sfxId.id, NameDB::Type::SFX), entry.sfxId.id);
|
SFXId::CurNameDB->registerPair(NameDB::generateName(entry.sfxId.id, NameDB::Type::SFX), entry.sfxId.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (absOffs)
|
if (absOffs)
|
||||||
r.seek(header.groupEndOff, athena::Begin);
|
r.seek(header.groupEndOff, athena::SeekOrigin::Begin);
|
||||||
else
|
else
|
||||||
r.seek(groupBegin + header.groupEndOff, athena::Begin);
|
r.seek(groupBegin + header.groupEndOff, athena::SeekOrigin::Begin);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -308,9 +321,9 @@ AudioGroupProject AudioGroupProject::CreateAudioGroupProject(const AudioGroupDat
|
||||||
default:
|
default:
|
||||||
return AudioGroupProject(r, GCNDataTag{});
|
return AudioGroupProject(r, GCNDataTag{});
|
||||||
case DataFormat::N64:
|
case DataFormat::N64:
|
||||||
return _AudioGroupProject<athena::Big>(r, data.getAbsoluteProjOffsets());
|
return _AudioGroupProject<athena::Endian::Big>(r, data.getAbsoluteProjOffsets());
|
||||||
case DataFormat::PC:
|
case DataFormat::PC:
|
||||||
return _AudioGroupProject<athena::Little>(r, data.getAbsoluteProjOffsets());
|
return _AudioGroupProject<athena::Endian::Little>(r, data.getAbsoluteProjOffsets());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -446,57 +459,61 @@ AudioGroupProject AudioGroupProject::CreateAudioGroupProject(const AudioGroupPro
|
||||||
|
|
||||||
void AudioGroupProject::BootstrapObjectIDs(athena::io::IStreamReader& r, GCNDataTag) {
|
void AudioGroupProject::BootstrapObjectIDs(athena::io::IStreamReader& r, GCNDataTag) {
|
||||||
while (!AtEnd32(r)) {
|
while (!AtEnd32(r)) {
|
||||||
GroupHeader<athena::Big> header;
|
GroupHeader<athena::Endian::Big> header;
|
||||||
header.read(r);
|
header.read(r);
|
||||||
|
|
||||||
GroupId::CurNameDB->registerPair(NameDB::generateName(header.groupId, NameDB::Type::Group), header.groupId);
|
GroupId::CurNameDB->registerPair(NameDB::generateName(header.groupId, NameDB::Type::Group), header.groupId);
|
||||||
|
|
||||||
/* Sound Macros */
|
/* Sound Macros */
|
||||||
r.seek(header.soundMacroIdsOff, athena::Begin);
|
r.seek(header.soundMacroIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r))
|
||||||
ReadRangedObjectIds<athena::Big>(SoundMacroId::CurNameDB, r, NameDB::Type::SoundMacro);
|
ReadRangedObjectIds<athena::Endian::Big>(SoundMacroId::CurNameDB, r, NameDB::Type::SoundMacro);
|
||||||
|
|
||||||
/* Samples */
|
/* Samples */
|
||||||
r.seek(header.samplIdsOff, athena::Begin);
|
r.seek(header.samplIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r)) {
|
||||||
ReadRangedObjectIds<athena::Big>(SampleId::CurNameDB, r, NameDB::Type::Sample);
|
ReadRangedObjectIds<athena::Endian::Big>(SampleId::CurNameDB, r, NameDB::Type::Sample);
|
||||||
|
}
|
||||||
|
|
||||||
/* Tables */
|
/* Tables */
|
||||||
r.seek(header.tableIdsOff, athena::Begin);
|
r.seek(header.tableIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r)) {
|
||||||
ReadRangedObjectIds<athena::Big>(TableId::CurNameDB, r, NameDB::Type::Table);
|
ReadRangedObjectIds<athena::Endian::Big>(TableId::CurNameDB, r, NameDB::Type::Table);
|
||||||
|
}
|
||||||
|
|
||||||
/* Keymaps */
|
/* Keymaps */
|
||||||
r.seek(header.keymapIdsOff, athena::Begin);
|
r.seek(header.keymapIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r)) {
|
||||||
ReadRangedObjectIds<athena::Big>(KeymapId::CurNameDB, r, NameDB::Type::Keymap);
|
ReadRangedObjectIds<athena::Endian::Big>(KeymapId::CurNameDB, r, NameDB::Type::Keymap);
|
||||||
|
}
|
||||||
|
|
||||||
/* Layers */
|
/* Layers */
|
||||||
r.seek(header.layerIdsOff, athena::Begin);
|
r.seek(header.layerIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r)) {
|
||||||
ReadRangedObjectIds<athena::Big>(LayersId::CurNameDB, r, NameDB::Type::Layer);
|
ReadRangedObjectIds<athena::Endian::Big>(LayersId::CurNameDB, r, NameDB::Type::Layer);
|
||||||
|
}
|
||||||
|
|
||||||
if (header.type == GroupType::Song) {
|
if (header.type == GroupType::Song) {
|
||||||
/* MIDI setups */
|
/* MIDI setups */
|
||||||
r.seek(header.midiSetupsOff, athena::Begin);
|
r.seek(header.midiSetupsOff, athena::SeekOrigin::Begin);
|
||||||
while (r.position() < header.groupEndOff) {
|
while (r.position() < header.groupEndOff) {
|
||||||
uint16_t id = r.readUint16Big();
|
uint16_t id = r.readUint16Big();
|
||||||
SongId::CurNameDB->registerPair(NameDB::generateName(id, NameDB::Type::Song), id);
|
SongId::CurNameDB->registerPair(NameDB::generateName(id, NameDB::Type::Song), id);
|
||||||
r.seek(2 + 5 * 16, athena::Current);
|
r.seek(2 + 5 * 16, athena::SeekOrigin::Current);
|
||||||
}
|
}
|
||||||
} else if (header.type == GroupType::SFX) {
|
} else if (header.type == GroupType::SFX) {
|
||||||
/* SFX entries */
|
/* SFX entries */
|
||||||
r.seek(header.pageTableOff, athena::Begin);
|
r.seek(header.pageTableOff, athena::SeekOrigin::Begin);
|
||||||
uint16_t count = r.readUint16Big();
|
uint16_t count = r.readUint16Big();
|
||||||
r.seek(2, athena::Current);
|
r.seek(2, athena::SeekOrigin::Current);
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
SFXGroupIndex::SFXEntryDNA<athena::Big> entry;
|
SFXGroupIndex::SFXEntryDNA<athena::Endian::Big> entry;
|
||||||
entry.read(r);
|
entry.read(r);
|
||||||
SFXId::CurNameDB->registerPair(NameDB::generateName(entry.sfxId.id, NameDB::Type::SFX), entry.sfxId.id);
|
SFXId::CurNameDB->registerPair(NameDB::generateName(entry.sfxId.id, NameDB::Type::SFX), entry.sfxId.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
r.seek(header.groupEndOff, athena::Begin);
|
r.seek(header.groupEndOff, athena::SeekOrigin::Begin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -511,67 +528,73 @@ void AudioGroupProject::BootstrapObjectIDs(athena::io::IStreamReader& r, bool ab
|
||||||
GroupId::CurNameDB->registerPair(NameDB::generateName(header.groupId, NameDB::Type::Group), header.groupId);
|
GroupId::CurNameDB->registerPair(NameDB::generateName(header.groupId, NameDB::Type::Group), header.groupId);
|
||||||
|
|
||||||
/* Sound Macros */
|
/* Sound Macros */
|
||||||
r.seek(subDataOff + header.soundMacroIdsOff, athena::Begin);
|
r.seek(subDataOff + header.soundMacroIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r)) {
|
||||||
ReadRangedObjectIds<DNAE>(SoundMacroId::CurNameDB, r, NameDB::Type::SoundMacro);
|
ReadRangedObjectIds<DNAE>(SoundMacroId::CurNameDB, r, NameDB::Type::SoundMacro);
|
||||||
|
}
|
||||||
|
|
||||||
/* Samples */
|
/* Samples */
|
||||||
r.seek(subDataOff + header.samplIdsOff, athena::Begin);
|
r.seek(subDataOff + header.samplIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r)) {
|
||||||
ReadRangedObjectIds<DNAE>(SampleId::CurNameDB, r, NameDB::Type::Sample);
|
ReadRangedObjectIds<DNAE>(SampleId::CurNameDB, r, NameDB::Type::Sample);
|
||||||
|
}
|
||||||
|
|
||||||
/* Tables */
|
/* Tables */
|
||||||
r.seek(subDataOff + header.tableIdsOff, athena::Begin);
|
r.seek(subDataOff + header.tableIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r)) {
|
||||||
ReadRangedObjectIds<DNAE>(TableId::CurNameDB, r, NameDB::Type::Table);
|
ReadRangedObjectIds<DNAE>(TableId::CurNameDB, r, NameDB::Type::Table);
|
||||||
|
}
|
||||||
|
|
||||||
/* Keymaps */
|
/* Keymaps */
|
||||||
r.seek(subDataOff + header.keymapIdsOff, athena::Begin);
|
r.seek(subDataOff + header.keymapIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r)) {
|
||||||
ReadRangedObjectIds<DNAE>(KeymapId::CurNameDB, r, NameDB::Type::Keymap);
|
ReadRangedObjectIds<DNAE>(KeymapId::CurNameDB, r, NameDB::Type::Keymap);
|
||||||
|
}
|
||||||
|
|
||||||
/* Layers */
|
/* Layers */
|
||||||
r.seek(subDataOff + header.layerIdsOff, athena::Begin);
|
r.seek(subDataOff + header.layerIdsOff, athena::SeekOrigin::Begin);
|
||||||
while (!AtEnd16(r))
|
while (!AtEnd16(r)) {
|
||||||
ReadRangedObjectIds<DNAE>(LayersId::CurNameDB, r, NameDB::Type::Layer);
|
ReadRangedObjectIds<DNAE>(LayersId::CurNameDB, r, NameDB::Type::Layer);
|
||||||
|
}
|
||||||
|
|
||||||
if (header.type == GroupType::Song) {
|
if (header.type == GroupType::Song) {
|
||||||
/* MIDI setups */
|
/* MIDI setups */
|
||||||
if (absOffs) {
|
if (absOffs) {
|
||||||
r.seek(header.midiSetupsOff, athena::Begin);
|
r.seek(header.midiSetupsOff, athena::SeekOrigin::Begin);
|
||||||
while (r.position() < header.groupEndOff) {
|
while (r.position() < header.groupEndOff) {
|
||||||
uint16_t id;
|
uint16_t id;
|
||||||
athena::io::Read<athena::io::PropType::None>::Do<decltype(id), DNAE>({}, id, r);
|
athena::io::Read<athena::io::PropType::None>::Do<decltype(id), DNAE>({}, id, r);
|
||||||
SongId::CurNameDB->registerPair(NameDB::generateName(id, NameDB::Type::Song), id);
|
SongId::CurNameDB->registerPair(NameDB::generateName(id, NameDB::Type::Song), id);
|
||||||
r.seek(2 + 5 * 16, athena::Current);
|
r.seek(2 + 5 * 16, athena::SeekOrigin::Current);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
r.seek(subDataOff + header.midiSetupsOff, athena::Begin);
|
r.seek(subDataOff + header.midiSetupsOff, athena::SeekOrigin::Begin);
|
||||||
while (atInt64(r.position()) < groupBegin + header.groupEndOff) {
|
while (atInt64(r.position()) < groupBegin + header.groupEndOff) {
|
||||||
uint16_t id;
|
uint16_t id;
|
||||||
athena::io::Read<athena::io::PropType::None>::Do<decltype(id), DNAE>({}, id, r);
|
athena::io::Read<athena::io::PropType::None>::Do<decltype(id), DNAE>({}, id, r);
|
||||||
SongId::CurNameDB->registerPair(NameDB::generateName(id, NameDB::Type::Song), id);
|
SongId::CurNameDB->registerPair(NameDB::generateName(id, NameDB::Type::Song), id);
|
||||||
r.seek(2 + 8 * 16, athena::Current);
|
r.seek(2 + 8 * 16, athena::SeekOrigin::Current);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (header.type == GroupType::SFX) {
|
} else if (header.type == GroupType::SFX) {
|
||||||
/* SFX entries */
|
/* SFX entries */
|
||||||
r.seek(subDataOff + header.pageTableOff, athena::Begin);
|
r.seek(subDataOff + header.pageTableOff, athena::SeekOrigin::Begin);
|
||||||
uint16_t count;
|
uint16_t count;
|
||||||
athena::io::Read<athena::io::PropType::None>::Do<decltype(count), DNAE>({}, count, r);
|
athena::io::Read<athena::io::PropType::None>::Do<decltype(count), DNAE>({}, count, r);
|
||||||
r.seek(2, athena::Current);
|
r.seek(2, athena::SeekOrigin::Current);
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
SFXGroupIndex::SFXEntryDNA<DNAE> entry;
|
SFXGroupIndex::SFXEntryDNA<DNAE> entry;
|
||||||
entry.read(r);
|
entry.read(r);
|
||||||
r.seek(2, athena::Current);
|
r.seek(2, athena::SeekOrigin::Current);
|
||||||
SFXId::CurNameDB->registerPair(NameDB::generateName(entry.sfxId.id, NameDB::Type::SFX), entry.sfxId.id);
|
SFXId::CurNameDB->registerPair(NameDB::generateName(entry.sfxId.id, NameDB::Type::SFX), entry.sfxId.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (absOffs)
|
if (absOffs) {
|
||||||
r.seek(header.groupEndOff, athena::Begin);
|
r.seek(header.groupEndOff, athena::SeekOrigin::Begin);
|
||||||
else
|
} else {
|
||||||
r.seek(groupBegin + header.groupEndOff, athena::Begin);
|
r.seek(groupBegin + header.groupEndOff, athena::SeekOrigin::Begin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -583,10 +606,10 @@ void AudioGroupProject::BootstrapObjectIDs(const AudioGroupData& data) {
|
||||||
BootstrapObjectIDs(r, GCNDataTag{});
|
BootstrapObjectIDs(r, GCNDataTag{});
|
||||||
break;
|
break;
|
||||||
case DataFormat::N64:
|
case DataFormat::N64:
|
||||||
BootstrapObjectIDs<athena::Big>(r, data.getAbsoluteProjOffsets());
|
BootstrapObjectIDs<athena::Endian::Big>(r, data.getAbsoluteProjOffsets());
|
||||||
break;
|
break;
|
||||||
case DataFormat::PC:
|
case DataFormat::PC:
|
||||||
BootstrapObjectIDs<athena::Little>(r, data.getAbsoluteProjOffsets());
|
BootstrapObjectIDs<athena::Endian::Little>(r, data.getAbsoluteProjOffsets());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -797,7 +820,7 @@ struct ObjectIdPool
|
||||||
|
|
||||||
std::vector<uint8_t> AudioGroupProject::toGCNData(const AudioGroupPool& pool,
|
std::vector<uint8_t> AudioGroupProject::toGCNData(const AudioGroupPool& pool,
|
||||||
const AudioGroupSampleDirectory& sdir) const {
|
const AudioGroupSampleDirectory& sdir) const {
|
||||||
constexpr athena::Endian DNAE = athena::Big;
|
constexpr athena::Endian DNAE = athena::Endian::Big;
|
||||||
|
|
||||||
athena::io::VectorWriter fo;
|
athena::io::VectorWriter fo;
|
||||||
|
|
||||||
|
@ -861,9 +884,9 @@ std::vector<uint8_t> AudioGroupProject::toGCNData(const AudioGroupPool& pool,
|
||||||
}
|
}
|
||||||
|
|
||||||
header.groupEndOff = fo.position();
|
header.groupEndOff = fo.position();
|
||||||
fo.seek(groupStart, athena::Begin);
|
fo.seek(groupStart, athena::SeekOrigin::Begin);
|
||||||
header.write(fo);
|
header.write(fo);
|
||||||
fo.seek(header.groupEndOff, athena::Begin);
|
fo.seek(header.groupEndOff, athena::SeekOrigin::Begin);
|
||||||
} else {
|
} else {
|
||||||
auto search2 = m_sfxGroups.find(id);
|
auto search2 = m_sfxGroups.find(id);
|
||||||
if (search2 != m_sfxGroups.end()) {
|
if (search2 != m_sfxGroups.end()) {
|
||||||
|
@ -897,9 +920,9 @@ std::vector<uint8_t> AudioGroupProject::toGCNData(const AudioGroupPool& pool,
|
||||||
}
|
}
|
||||||
|
|
||||||
header.groupEndOff = fo.position();
|
header.groupEndOff = fo.position();
|
||||||
fo.seek(groupStart, athena::Begin);
|
fo.seek(groupStart, athena::SeekOrigin::Begin);
|
||||||
header.write(fo);
|
header.write(fo);
|
||||||
fo.seek(header.groupEndOff, athena::Begin);
|
fo.seek(header.groupEndOff, athena::SeekOrigin::Begin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace amuse {
|
||||||
|
|
||||||
static bool AtEnd32(athena::io::IStreamReader& r) {
|
static bool AtEnd32(athena::io::IStreamReader& r) {
|
||||||
uint32_t v = r.readUint32Big();
|
uint32_t v = r.readUint32Big();
|
||||||
r.seek(-4, athena::Current);
|
r.seek(-4, athena::SeekOrigin::Current);
|
||||||
return v == 0xffffffff;
|
return v == 0xffffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ void AudioGroupSampleDirectory::ADPCMParms::swapBigVADPCM() {
|
||||||
|
|
||||||
AudioGroupSampleDirectory::AudioGroupSampleDirectory(athena::io::IStreamReader& r, GCNDataTag) {
|
AudioGroupSampleDirectory::AudioGroupSampleDirectory(athena::io::IStreamReader& r, GCNDataTag) {
|
||||||
while (!AtEnd32(r)) {
|
while (!AtEnd32(r)) {
|
||||||
EntryDNA<athena::Big> ent;
|
EntryDNA<athena::Endian::Big> ent;
|
||||||
ent.read(r);
|
ent.read(r);
|
||||||
m_entries[ent.m_sfxId] = MakeObj<Entry>(ent);
|
m_entries[ent.m_sfxId] = MakeObj<Entry>(ent);
|
||||||
if (SampleId::CurNameDB)
|
if (SampleId::CurNameDB)
|
||||||
|
@ -55,7 +55,7 @@ AudioGroupSampleDirectory::AudioGroupSampleDirectory(athena::io::IStreamReader&
|
||||||
|
|
||||||
for (auto& p : m_entries) {
|
for (auto& p : m_entries) {
|
||||||
if (p.second->m_data->m_adpcmParmOffset) {
|
if (p.second->m_data->m_adpcmParmOffset) {
|
||||||
r.seek(p.second->m_data->m_adpcmParmOffset, athena::Begin);
|
r.seek(p.second->m_data->m_adpcmParmOffset, athena::SeekOrigin::Begin);
|
||||||
r.readUBytesToBuf(&p.second->m_data->m_ADPCMParms, sizeof(ADPCMParms::DSPParms));
|
r.readUBytesToBuf(&p.second->m_data->m_ADPCMParms, sizeof(ADPCMParms::DSPParms));
|
||||||
p.second->m_data->m_ADPCMParms.swapBigDSP();
|
p.second->m_data->m_ADPCMParms.swapBigDSP();
|
||||||
}
|
}
|
||||||
|
@ -66,14 +66,14 @@ AudioGroupSampleDirectory::AudioGroupSampleDirectory(athena::io::IStreamReader&
|
||||||
bool absOffs, N64DataTag) {
|
bool absOffs, N64DataTag) {
|
||||||
if (absOffs) {
|
if (absOffs) {
|
||||||
while (!AtEnd32(r)) {
|
while (!AtEnd32(r)) {
|
||||||
MusyX1AbsSdirEntry<athena::Big> ent;
|
MusyX1AbsSdirEntry<athena::Endian::Big> ent;
|
||||||
ent.read(r);
|
ent.read(r);
|
||||||
m_entries[ent.m_sfxId] = MakeObj<Entry>(ent);
|
m_entries[ent.m_sfxId] = MakeObj<Entry>(ent);
|
||||||
SampleId::CurNameDB->registerPair(NameDB::generateName(ent.m_sfxId, NameDB::Type::Sample), ent.m_sfxId);
|
SampleId::CurNameDB->registerPair(NameDB::generateName(ent.m_sfxId, NameDB::Type::Sample), ent.m_sfxId);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while (!AtEnd32(r)) {
|
while (!AtEnd32(r)) {
|
||||||
MusyX1SdirEntry<athena::Big> ent;
|
MusyX1SdirEntry<athena::Endian::Big> ent;
|
||||||
ent.read(r);
|
ent.read(r);
|
||||||
m_entries[ent.m_sfxId] = MakeObj<Entry>(ent);
|
m_entries[ent.m_sfxId] = MakeObj<Entry>(ent);
|
||||||
SampleId::CurNameDB->registerPair(NameDB::generateName(ent.m_sfxId, NameDB::Type::Sample), ent.m_sfxId);
|
SampleId::CurNameDB->registerPair(NameDB::generateName(ent.m_sfxId, NameDB::Type::Sample), ent.m_sfxId);
|
||||||
|
@ -89,7 +89,7 @@ AudioGroupSampleDirectory::AudioGroupSampleDirectory(athena::io::IStreamReader&
|
||||||
AudioGroupSampleDirectory::AudioGroupSampleDirectory(athena::io::IStreamReader& r, bool absOffs, PCDataTag) {
|
AudioGroupSampleDirectory::AudioGroupSampleDirectory(athena::io::IStreamReader& r, bool absOffs, PCDataTag) {
|
||||||
if (absOffs) {
|
if (absOffs) {
|
||||||
while (!AtEnd32(r)) {
|
while (!AtEnd32(r)) {
|
||||||
MusyX1AbsSdirEntry<athena::Little> ent;
|
MusyX1AbsSdirEntry<athena::Endian::Little> ent;
|
||||||
ent.read(r);
|
ent.read(r);
|
||||||
auto& store = m_entries[ent.m_sfxId];
|
auto& store = m_entries[ent.m_sfxId];
|
||||||
store = MakeObj<Entry>(ent);
|
store = MakeObj<Entry>(ent);
|
||||||
|
@ -98,7 +98,7 @@ AudioGroupSampleDirectory::AudioGroupSampleDirectory(athena::io::IStreamReader&
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while (!AtEnd32(r)) {
|
while (!AtEnd32(r)) {
|
||||||
MusyX1SdirEntry<athena::Little> ent;
|
MusyX1SdirEntry<athena::Endian::Little> ent;
|
||||||
ent.read(r);
|
ent.read(r);
|
||||||
auto& store = m_entries[ent.m_sfxId];
|
auto& store = m_entries[ent.m_sfxId];
|
||||||
store = MakeObj<Entry>(ent);
|
store = MakeObj<Entry>(ent);
|
||||||
|
@ -237,7 +237,7 @@ void AudioGroupSampleDirectory::EntryData::loadLooseWAV(SystemStringView wavPath
|
||||||
m_looseData.reset(new uint8_t[chunkSize]);
|
m_looseData.reset(new uint8_t[chunkSize]);
|
||||||
r.readUBytesToBuf(m_looseData.get(), chunkSize);
|
r.readUBytesToBuf(m_looseData.get(), chunkSize);
|
||||||
}
|
}
|
||||||
r.seek(startPos + chunkSize, athena::Begin);
|
r.seek(startPos + chunkSize, athena::SeekOrigin::Begin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -388,7 +388,7 @@ void AudioGroupSampleDirectory::EntryData::patchMetadataDSP(SystemStringView dsp
|
||||||
|
|
||||||
athena::io::FileWriter w(dspPath, false);
|
athena::io::FileWriter w(dspPath, false);
|
||||||
if (!w.hasError()) {
|
if (!w.hasError()) {
|
||||||
w.seek(0, athena::Begin);
|
w.seek(0, athena::SeekOrigin::Begin);
|
||||||
head.write(w);
|
head.write(w);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,7 +397,7 @@ void AudioGroupSampleDirectory::EntryData::patchMetadataDSP(SystemStringView dsp
|
||||||
void AudioGroupSampleDirectory::EntryData::patchMetadataVADPCM(SystemStringView vadpcmPath) {
|
void AudioGroupSampleDirectory::EntryData::patchMetadataVADPCM(SystemStringView vadpcmPath) {
|
||||||
athena::io::FileWriter w(vadpcmPath, false);
|
athena::io::FileWriter w(vadpcmPath, false);
|
||||||
if (!w.hasError()) {
|
if (!w.hasError()) {
|
||||||
w.seek(0, athena::Begin);
|
w.seek(0, athena::SeekOrigin::Begin);
|
||||||
VADPCMHeader header;
|
VADPCMHeader header;
|
||||||
header.m_pitchSampleRate = m_pitch << 24;
|
header.m_pitchSampleRate = m_pitch << 24;
|
||||||
header.m_pitchSampleRate |= m_sampleRate & 0xffff;
|
header.m_pitchSampleRate |= m_sampleRate & 0xffff;
|
||||||
|
@ -434,12 +434,12 @@ void AudioGroupSampleDirectory::EntryData::patchMetadataWAV(SystemStringView wav
|
||||||
loopOffset = startPos + 36;
|
loopOffset = startPos + 36;
|
||||||
++readSec;
|
++readSec;
|
||||||
}
|
}
|
||||||
r.seek(startPos + chunkSize, athena::Begin);
|
r.seek(startPos + chunkSize, athena::SeekOrigin::Begin);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (smplOffset == -1 || loopOffset == -1) {
|
if (smplOffset == -1 || loopOffset == -1) {
|
||||||
/* Complete rewrite of RIFF layout - new smpl chunk */
|
/* Complete rewrite of RIFF layout - new smpl chunk */
|
||||||
r.seek(12, athena::Begin);
|
r.seek(12, athena::SeekOrigin::Begin);
|
||||||
athena::io::FileWriter w(wavPath);
|
athena::io::FileWriter w(wavPath);
|
||||||
if (!w.hasError()) {
|
if (!w.hasError()) {
|
||||||
w.writeUint32Little(SBIG('RIFF'));
|
w.writeUint32Little(SBIG('RIFF'));
|
||||||
|
@ -470,7 +470,7 @@ void AudioGroupSampleDirectory::EntryData::patchMetadataWAV(SystemStringView wav
|
||||||
loop.end = getLoopEndSample();
|
loop.end = getLoopEndSample();
|
||||||
loop.write(w);
|
loop.write(w);
|
||||||
if (chunkMagic == SBIG('smpl')) {
|
if (chunkMagic == SBIG('smpl')) {
|
||||||
r.seek(chunkSize, athena::Current);
|
r.seek(chunkSize, athena::SeekOrigin::Current);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -480,7 +480,7 @@ void AudioGroupSampleDirectory::EntryData::patchMetadataWAV(SystemStringView wav
|
||||||
}
|
}
|
||||||
|
|
||||||
atUint64 wavLen = w.position();
|
atUint64 wavLen = w.position();
|
||||||
w.seek(4, athena::Begin);
|
w.seek(4, athena::SeekOrigin::Begin);
|
||||||
w.writeUint32Little(wavLen - 8);
|
w.writeUint32Little(wavLen - 8);
|
||||||
}
|
}
|
||||||
r.close();
|
r.close();
|
||||||
|
@ -489,7 +489,7 @@ void AudioGroupSampleDirectory::EntryData::patchMetadataWAV(SystemStringView wav
|
||||||
r.close();
|
r.close();
|
||||||
athena::io::FileWriter w(wavPath, false);
|
athena::io::FileWriter w(wavPath, false);
|
||||||
if (!w.hasError()) {
|
if (!w.hasError()) {
|
||||||
w.seek(smplOffset, athena::Begin);
|
w.seek(smplOffset, athena::SeekOrigin::Begin);
|
||||||
WAVSampleChunk smpl;
|
WAVSampleChunk smpl;
|
||||||
smpl.smplPeriod = 1000000000 / fmt.sampleRate;
|
smpl.smplPeriod = 1000000000 / fmt.sampleRate;
|
||||||
smpl.midiNote = m_pitch;
|
smpl.midiNote = m_pitch;
|
||||||
|
@ -810,7 +810,7 @@ void AudioGroupSampleDirectory::_extractCompressed(SampleId id, const EntryData&
|
||||||
samps += sampleCount;
|
samps += sampleCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
w.seek(0, athena::Begin);
|
w.seek(0, athena::SeekOrigin::Begin);
|
||||||
header.write(w);
|
header.write(w);
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
|
@ -877,7 +877,7 @@ void AudioGroupSampleDirectory::reloadSampleData(SystemStringView groupPath) {
|
||||||
|
|
||||||
std::pair<std::vector<uint8_t>, std::vector<uint8_t>>
|
std::pair<std::vector<uint8_t>, std::vector<uint8_t>>
|
||||||
AudioGroupSampleDirectory::toGCNData(const AudioGroupDatabase& group) const {
|
AudioGroupSampleDirectory::toGCNData(const AudioGroupDatabase& group) const {
|
||||||
constexpr athena::Endian DNAE = athena::Big;
|
constexpr athena::Endian DNAE = athena::Endian::Big;
|
||||||
|
|
||||||
athena::io::VectorWriter fo;
|
athena::io::VectorWriter fo;
|
||||||
athena::io::VectorWriter sfo;
|
athena::io::VectorWriter sfo;
|
||||||
|
|
|
@ -49,52 +49,52 @@ bool Copy(const SystemChar* from, const SystemChar* to) {
|
||||||
thread_local NameDB* type::CurNameDB = nullptr; \
|
thread_local NameDB* type::CurNameDB = nullptr; \
|
||||||
template <> \
|
template <> \
|
||||||
template <> \
|
template <> \
|
||||||
void type##DNA<athena::Little>::Enumerate<BigDNA::Read>(athena::io::IStreamReader & reader) { \
|
void type##DNA<athena::Endian::Little>::Enumerate<BigDNA::Read>(athena::io::IStreamReader& reader) { \
|
||||||
id = reader.readUint16Little(); \
|
id = reader.readUint16Little(); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
template <> \
|
template <> \
|
||||||
void type##DNA<athena::Little>::Enumerate<BigDNA::Write>(athena::io::IStreamWriter & writer) { \
|
void type##DNA<athena::Endian::Little>::Enumerate<BigDNA::Write>(athena::io::IStreamWriter& writer) { \
|
||||||
writer.writeUint16Little(id.id); \
|
writer.writeUint16Little(id.id); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
template <> \
|
template <> \
|
||||||
void type##DNA<athena::Little>::Enumerate<BigDNA::BinarySize>(size_t & sz) { \
|
void type##DNA<athena::Endian::Little>::Enumerate<BigDNA::BinarySize>(size_t& sz) { \
|
||||||
sz += 2; \
|
sz += 2; \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
template <> \
|
template <> \
|
||||||
void type##DNA<athena::Little>::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader & reader) { \
|
void type##DNA<athena::Endian::Little>::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader& reader) { \
|
||||||
_read(reader); \
|
_read(reader); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
template <> \
|
template <> \
|
||||||
void type##DNA<athena::Little>::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter & writer) { \
|
void type##DNA<athena::Endian::Little>::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter& writer) { \
|
||||||
_write(writer); \
|
_write(writer); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
template <> \
|
template <> \
|
||||||
void type##DNA<athena::Big>::Enumerate<BigDNA::Read>(athena::io::IStreamReader & reader) { \
|
void type##DNA<athena::Endian::Big>::Enumerate<BigDNA::Read>(athena::io::IStreamReader& reader) { \
|
||||||
id = reader.readUint16Big(); \
|
id = reader.readUint16Big(); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
template <> \
|
template <> \
|
||||||
void type##DNA<athena::Big>::Enumerate<BigDNA::Write>(athena::io::IStreamWriter & writer) { \
|
void type##DNA<athena::Endian::Big>::Enumerate<BigDNA::Write>(athena::io::IStreamWriter& writer) { \
|
||||||
writer.writeUint16Big(id.id); \
|
writer.writeUint16Big(id.id); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
template <> \
|
template <> \
|
||||||
void type##DNA<athena::Big>::Enumerate<BigDNA::BinarySize>(size_t & sz) { \
|
void type##DNA<athena::Endian::Big>::Enumerate<BigDNA::BinarySize>(size_t& sz) { \
|
||||||
sz += 2; \
|
sz += 2; \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
template <> \
|
template <> \
|
||||||
void type##DNA<athena::Big>::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader & reader) { \
|
void type##DNA<athena::Endian::Big>::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader& reader) { \
|
||||||
_read(reader); \
|
_read(reader); \
|
||||||
} \
|
} \
|
||||||
template <> \
|
template <> \
|
||||||
template <> \
|
template <> \
|
||||||
void type##DNA<athena::Big>::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter & writer) { \
|
void type##DNA<athena::Endian::Big>::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter& writer) { \
|
||||||
_write(writer); \
|
_write(writer); \
|
||||||
} \
|
} \
|
||||||
template <athena::Endian DNAE> \
|
template <athena::Endian DNAE> \
|
||||||
|
@ -122,8 +122,8 @@ bool Copy(const SystemChar* from, const SystemChar* to) {
|
||||||
const char* type##DNA<DNAE>::DNAType() { \
|
const char* type##DNA<DNAE>::DNAType() { \
|
||||||
return "amuse::" #type "DNA"; \
|
return "amuse::" #type "DNA"; \
|
||||||
} \
|
} \
|
||||||
template struct type##DNA<athena::Big>; \
|
template struct type##DNA<athena::Endian::Big>; \
|
||||||
template struct type##DNA<athena::Little>;
|
template struct type##DNA<athena::Endian::Little>;
|
||||||
|
|
||||||
DEFINE_ID_TYPE(ObjectId, "object")
|
DEFINE_ID_TYPE(ObjectId, "object")
|
||||||
DEFINE_ID_TYPE(SoundMacroId, "SoundMacro")
|
DEFINE_ID_TYPE(SoundMacroId, "SoundMacro")
|
||||||
|
@ -137,52 +137,52 @@ DEFINE_ID_TYPE(GroupId, "group")
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void PageObjectIdDNA<athena::Little>::Enumerate<BigDNA::Read>(athena::io::IStreamReader& reader) {
|
void PageObjectIdDNA<athena::Endian::Little>::Enumerate<BigDNA::Read>(athena::io::IStreamReader& reader) {
|
||||||
id = reader.readUint16Little();
|
id = reader.readUint16Little();
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void PageObjectIdDNA<athena::Little>::Enumerate<BigDNA::Write>(athena::io::IStreamWriter& writer) {
|
void PageObjectIdDNA<athena::Endian::Little>::Enumerate<BigDNA::Write>(athena::io::IStreamWriter& writer) {
|
||||||
writer.writeUint16Little(id.id);
|
writer.writeUint16Little(id.id);
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void PageObjectIdDNA<athena::Little>::Enumerate<BigDNA::BinarySize>(size_t& sz) {
|
void PageObjectIdDNA<athena::Endian::Little>::Enumerate<BigDNA::BinarySize>(size_t& sz) {
|
||||||
sz += 2;
|
sz += 2;
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void PageObjectIdDNA<athena::Little>::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader& reader) {
|
void PageObjectIdDNA<athena::Endian::Little>::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader& reader) {
|
||||||
_read(reader);
|
_read(reader);
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void PageObjectIdDNA<athena::Little>::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter& writer) {
|
void PageObjectIdDNA<athena::Endian::Little>::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter& writer) {
|
||||||
_write(writer);
|
_write(writer);
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void PageObjectIdDNA<athena::Big>::Enumerate<BigDNA::Read>(athena::io::IStreamReader& reader) {
|
void PageObjectIdDNA<athena::Endian::Big>::Enumerate<BigDNA::Read>(athena::io::IStreamReader& reader) {
|
||||||
id = reader.readUint16Big();
|
id = reader.readUint16Big();
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void PageObjectIdDNA<athena::Big>::Enumerate<BigDNA::Write>(athena::io::IStreamWriter& writer) {
|
void PageObjectIdDNA<athena::Endian::Big>::Enumerate<BigDNA::Write>(athena::io::IStreamWriter& writer) {
|
||||||
writer.writeUint16Big(id.id);
|
writer.writeUint16Big(id.id);
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void PageObjectIdDNA<athena::Big>::Enumerate<BigDNA::BinarySize>(size_t& sz) {
|
void PageObjectIdDNA<athena::Endian::Big>::Enumerate<BigDNA::BinarySize>(size_t& sz) {
|
||||||
sz += 2;
|
sz += 2;
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void PageObjectIdDNA<athena::Big>::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader& reader) {
|
void PageObjectIdDNA<athena::Endian::Big>::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader& reader) {
|
||||||
_read(reader);
|
_read(reader);
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void PageObjectIdDNA<athena::Big>::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter& writer) {
|
void PageObjectIdDNA<athena::Endian::Big>::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter& writer) {
|
||||||
_write(writer);
|
_write(writer);
|
||||||
}
|
}
|
||||||
template <athena::Endian DNAE>
|
template <athena::Endian DNAE>
|
||||||
|
@ -232,65 +232,65 @@ template <athena::Endian DNAE>
|
||||||
const char* PageObjectIdDNA<DNAE>::DNAType() {
|
const char* PageObjectIdDNA<DNAE>::DNAType() {
|
||||||
return "amuse::PageObjectIdDNA";
|
return "amuse::PageObjectIdDNA";
|
||||||
}
|
}
|
||||||
template struct PageObjectIdDNA<athena::Big>;
|
template struct PageObjectIdDNA<athena::Endian::Big>;
|
||||||
template struct PageObjectIdDNA<athena::Little>;
|
template struct PageObjectIdDNA<athena::Endian::Little>;
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void SoundMacroStepDNA<athena::Little>::Enumerate<BigDNA::Read>(athena::io::IStreamReader& reader) {
|
void SoundMacroStepDNA<athena::Endian::Little>::Enumerate<BigDNA::Read>(athena::io::IStreamReader& reader) {
|
||||||
step = reader.readUint16Little();
|
step = reader.readUint16Little();
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void SoundMacroStepDNA<athena::Little>::Enumerate<BigDNA::Write>(athena::io::IStreamWriter& writer) {
|
void SoundMacroStepDNA<athena::Endian::Little>::Enumerate<BigDNA::Write>(athena::io::IStreamWriter& writer) {
|
||||||
writer.writeUint16Little(step);
|
writer.writeUint16Little(step);
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void SoundMacroStepDNA<athena::Little>::Enumerate<BigDNA::BinarySize>(size_t& sz) {
|
void SoundMacroStepDNA<athena::Endian::Little>::Enumerate<BigDNA::BinarySize>(size_t& sz) {
|
||||||
sz += 2;
|
sz += 2;
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void SoundMacroStepDNA<athena::Little>::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader& reader) {
|
void SoundMacroStepDNA<athena::Endian::Little>::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader& reader) {
|
||||||
step = reader.readUint16(nullptr);
|
step = reader.readUint16(nullptr);
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void SoundMacroStepDNA<athena::Little>::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter& writer) {
|
void SoundMacroStepDNA<athena::Endian::Little>::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter& writer) {
|
||||||
writer.writeUint16(nullptr, step);
|
writer.writeUint16(nullptr, step);
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void SoundMacroStepDNA<athena::Big>::Enumerate<BigDNA::Read>(athena::io::IStreamReader& reader) {
|
void SoundMacroStepDNA<athena::Endian::Big>::Enumerate<BigDNA::Read>(athena::io::IStreamReader& reader) {
|
||||||
step = reader.readUint16Big();
|
step = reader.readUint16Big();
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void SoundMacroStepDNA<athena::Big>::Enumerate<BigDNA::Write>(athena::io::IStreamWriter& writer) {
|
void SoundMacroStepDNA<athena::Endian::Big>::Enumerate<BigDNA::Write>(athena::io::IStreamWriter& writer) {
|
||||||
writer.writeUint16Big(step);
|
writer.writeUint16Big(step);
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void SoundMacroStepDNA<athena::Big>::Enumerate<BigDNA::BinarySize>(size_t& sz) {
|
void SoundMacroStepDNA<athena::Endian::Big>::Enumerate<BigDNA::BinarySize>(size_t& sz) {
|
||||||
sz += 2;
|
sz += 2;
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void SoundMacroStepDNA<athena::Big>::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader& reader) {
|
void SoundMacroStepDNA<athena::Endian::Big>::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader& reader) {
|
||||||
step = reader.readUint16(nullptr);
|
step = reader.readUint16(nullptr);
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
template <>
|
template <>
|
||||||
void SoundMacroStepDNA<athena::Big>::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter& writer) {
|
void SoundMacroStepDNA<athena::Endian::Big>::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter& writer) {
|
||||||
writer.writeUint16(nullptr, step);
|
writer.writeUint16(nullptr, step);
|
||||||
}
|
}
|
||||||
template <athena::Endian DNAE>
|
template <athena::Endian DNAE>
|
||||||
const char* SoundMacroStepDNA<DNAE>::DNAType() {
|
const char* SoundMacroStepDNA<DNAE>::DNAType() {
|
||||||
return "amuse::SoundMacroStepDNA";
|
return "amuse::SoundMacroStepDNA";
|
||||||
}
|
}
|
||||||
template struct SoundMacroStepDNA<athena::Big>;
|
template struct SoundMacroStepDNA<athena::Endian::Big>;
|
||||||
template struct SoundMacroStepDNA<athena::Little>;
|
template struct SoundMacroStepDNA<athena::Endian::Little>;
|
||||||
|
|
||||||
ObjectId NameDB::generateId(Type tp) const {
|
ObjectId NameDB::generateId(Type tp) const {
|
||||||
uint16_t maxMatch = 0;
|
uint16_t maxMatch = 0;
|
||||||
|
|
|
@ -163,19 +163,19 @@ constexpr SoundMacro::CmdIntrospection::Field::Type GetFieldType<atUint32>() {
|
||||||
return SoundMacro::CmdIntrospection::Field::Type::UInt32;
|
return SoundMacro::CmdIntrospection::Field::Type::UInt32;
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
constexpr SoundMacro::CmdIntrospection::Field::Type GetFieldType<SoundMacroIdDNA<athena::Little>>() {
|
constexpr SoundMacro::CmdIntrospection::Field::Type GetFieldType<SoundMacroIdDNA<athena::Endian::Little>>() {
|
||||||
return SoundMacro::CmdIntrospection::Field::Type::SoundMacroId;
|
return SoundMacro::CmdIntrospection::Field::Type::SoundMacroId;
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
constexpr SoundMacro::CmdIntrospection::Field::Type GetFieldType<SoundMacroStepDNA<athena::Little>>() {
|
constexpr SoundMacro::CmdIntrospection::Field::Type GetFieldType<SoundMacroStepDNA<athena::Endian::Little>>() {
|
||||||
return SoundMacro::CmdIntrospection::Field::Type::SoundMacroStep;
|
return SoundMacro::CmdIntrospection::Field::Type::SoundMacroStep;
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
constexpr SoundMacro::CmdIntrospection::Field::Type GetFieldType<TableIdDNA<athena::Little>>() {
|
constexpr SoundMacro::CmdIntrospection::Field::Type GetFieldType<TableIdDNA<athena::Endian::Little>>() {
|
||||||
return SoundMacro::CmdIntrospection::Field::Type::TableId;
|
return SoundMacro::CmdIntrospection::Field::Type::TableId;
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
constexpr SoundMacro::CmdIntrospection::Field::Type GetFieldType<SampleIdDNA<athena::Little>>() {
|
constexpr SoundMacro::CmdIntrospection::Field::Type GetFieldType<SampleIdDNA<athena::Endian::Little>>() {
|
||||||
return SoundMacro::CmdIntrospection::Field::Type::SampleId;
|
return SoundMacro::CmdIntrospection::Field::Type::SampleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue