OpenGothic
Open source reimplementation of Gothic I and II
Loading...
Searching...
No Matches
dlscollection.h
Go to the documentation of this file.
1#pragma once
2
3#include "riff.h"
4#include "structs.h"
5#include "soundfont.h"
6#include "wave.h"
7
8#include <vector>
9
10namespace Dx8 {
11
12class DlsCollection final {
13 public:
14 DlsCollection(Riff &input);
15
16 struct RgnRange final {
17 uint16_t usLow =0;
18 uint16_t usHigh=0;
19 };
20
27
28 struct WaveLink final {
29 uint16_t fusOptions =0;
30 uint16_t usPhaseGroup=0;
31 uint32_t ulChannel =0;
32 uint32_t ulTableIndex=0;
33 };
34
35 struct WaveSample final {
36 uint32_t cbSize =0;
37 uint16_t usUnityNote =0;
38 int16_t sFineTune =0;
39 int32_t lAttenuation=0;
40 uint32_t fulOptions =0;
41 uint32_t cSampleLoops=0;
42 };
43
44 struct WaveSampleLoop final {
45 uint32_t cbSize =0;
46 uint32_t ulLoopType =0;
47 uint32_t ulLoopStart =0;
48 uint32_t ulLoopLength=0;
49 };
50
51 class Region final {
52 public:
53 Region(Riff& c);
54
58 std::vector<WaveSampleLoop> loop;
59
60 private:
61 void implRead(Riff &input);
62 };
63
64 struct ConnectionBlock final {
65 uint16_t usSource=0;
66 uint16_t usControl=0;
67 uint16_t usDestination=0;
68 uint16_t usTransform=0;
69 int32_t lScale=0;
70 };
71
72
73 class Articulator final {
74 public:
75 Articulator(Riff& c);
76 std::vector<ConnectionBlock> connectionBlocks;
77 };
78
79 struct MidiLocale final {
80 uint32_t ulBank =0;
81 uint32_t ulInstrument=0;
82 };
83
84 struct InstrumentHeader final {
85 uint32_t cRegions=0;
87 };
88
89 class Instrument final {
90 public:
91 Instrument(Riff& c);
92
95 std::vector<Region> regions;
96 std::vector<Articulator> articulators;
97
98 private:
99 void implRead(Riff &input);
100 };
101
102 uint64_t version=0;
104 std::vector<Instrument> instrument;
105
106 void dbgDump() const;
107 SoundFont toSoundfont(uint32_t dwPatch) const;
108 void save(std::ostream& fout) const;
109
110 const Wave* findWave(uint8_t note) const;
111
112 private:
113 void implRead(Riff &input);
114
115 std::vector<Wave> wave;
116 mutable std::shared_ptr<SoundFont::Data> shData; //FIXME: mutable
117 };
118
119}
std::vector< ConnectionBlock > connectionBlocks
std::vector< Region > regions
std::vector< Articulator > articulators
std::vector< WaveSampleLoop > loop
std::vector< Instrument > instrument
void save(std::ostream &fout) const
const Wave * findWave(uint8_t note) const
SoundFont toSoundfont(uint32_t dwPatch) const
Definition band.h:10