Torch
Loading...
Searching...
No Matches
InstrumentFactory.h
1
#pragma once
2
3
#include <factories/BaseFactory.h>
4
#include "AudioContext.h"
5
6
class
InstrumentData
:
public
IParsedData
{
7
public
:
8
uint8_t isRelocated;
9
uint8_t normalRangeLo;
10
uint8_t normalRangeHi;
11
uint8_t adsrDecayIndex;
12
uint32_t envelope;
13
TunedSample
lowPitchTunedSample;
14
TunedSample
normalPitchTunedSample;
15
TunedSample
highPitchTunedSample;
16
};
17
18
class
InstrumentHeaderExporter
:
public
BaseExporter
{
19
ExportResult Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName, YAML::Node& node, std::string* replacement)
override
;
20
};
21
22
class
InstrumentBinaryExporter
:
public
BaseExporter
{
23
ExportResult Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName, YAML::Node& node, std::string* replacement)
override
;
24
};
25
26
class
InstrumentCodeExporter
:
public
BaseExporter
{
27
ExportResult Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName, YAML::Node& node, std::string* replacement)
override
;
28
};
29
30
class
InstrumentFactory
:
public
BaseFactory
{
31
public
:
32
std::optional<std::shared_ptr<IParsedData>> parse(std::vector<uint8_t>& buffer, YAML::Node& data)
override
;
33
inline
std::unordered_map<ExportType, std::shared_ptr<BaseExporter>> GetExporters()
override
{
34
return
{
35
REGISTER(Header,
InstrumentHeaderExporter
)
36
REGISTER(Binary,
InstrumentBinaryExporter
)
37
REGISTER(Code,
InstrumentCodeExporter
)
38
};
39
}
40
41
bool
HasModdedDependencies()
override
{
return
true
; }
42
};
BaseExporter
Definition
BaseFactory.h:88
BaseFactory
Definition
BaseFactory.h:94
IParsedData
Definition
BaseFactory.h:80
InstrumentBinaryExporter
Definition
InstrumentFactory.h:22
InstrumentCodeExporter
Definition
InstrumentFactory.h:26
InstrumentData
Definition
InstrumentFactory.h:6
InstrumentFactory
Definition
InstrumentFactory.h:30
InstrumentHeaderExporter
Definition
InstrumentFactory.h:18
TunedSample
Definition
AudioContext.h:7
src
factories
naudio
v1
InstrumentFactory.h
Generated by
1.14.0