1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 #include <memory>
6 #include "zmusic_internal.h"
7 #include "fileio.h"
8 
9 // Note: Bools here are stored as ints to allow having a simpler interface.
10 
11 struct ADLConfig
12 {
13 	int adl_chips_count = 6;
14 	int adl_emulator_id = 0;
15 	int adl_bank = 14;
16 	int adl_volume_model = 0; // Automatical volume model (by bank properties)
17 	int adl_run_at_pcm_rate = 0;
18 	int adl_fullpan = 1;
19 	int adl_use_custom_bank = false;
20 	std::string adl_custom_bank;
21 };
22 
23 struct FluidConfig
24 {
25 	std::string fluid_lib;
26 	std::string fluid_patchset;
27 	int fluid_reverb = false;
28 	int fluid_chorus = false;
29 	int fluid_voices = 128;
30 	int fluid_interp = 1;
31 	int fluid_samplerate = 0;
32 	int fluid_threads = 1;
33 	int fluid_chorus_voices = 3;
34 	int fluid_chorus_type = 0;
35 	float fluid_gain = 0.5f;
36 	float fluid_reverb_roomsize = 0.61f;
37 	float fluid_reverb_damping = 0.23f;
38 	float fluid_reverb_width = 0.76f;
39 	float fluid_reverb_level = 0.57f;
40 	float fluid_chorus_level = 1.2f;
41 	float fluid_chorus_speed = 0.3f;
42 	float fluid_chorus_depth = 8;
43 };
44 
45 struct OPLConfig
46 {
47 	int numchips = 2;
48 	int core = 0;
49 	int fullpan = true;
50 	int genmidiset = false;
51 	uint8_t OPLinstruments[36 * 175]; // it really is 'struct GenMidiInstrument OPLinstruments[GENMIDI_NUM_TOTAL]'; but since this is a public header it cannot pull in a dependency from oplsynth.
52 };
53 
54 struct OpnConfig
55 {
56 	int opn_chips_count = 8;
57 	int opn_emulator_id = 0;
58 	int opn_run_at_pcm_rate = false;
59 	int opn_fullpan = 1;
60 	int opn_use_custom_bank = false;
61 	std::string opn_custom_bank;
62 	std::vector<uint8_t> default_bank;
63 };
64 
65 namespace Timidity
66 {
67 	class Instruments;
68 	class SoundFontReaderInterface;
69 }
70 
71 struct GUSConfig
72 {
73 	int midi_voices = 32;
74 	int gus_memsize = 0;
75 	int gus_dmxgus = false;
76 	std::string gus_patchdir;
77 	std::string gus_config;
78 	std::vector<uint8_t> dmxgus;				// can contain the contents of a DMXGUS lump that may be used as the instrument set. In this case gus_patchdir must point to the location of the GUS data and gus_dmxgus must be true.
79 
80 	// This is the instrument cache for the GUS synth.
81 	MusicIO::SoundFontReaderInterface *reader;
82 	std::string readerName;
83 	std::string loadedConfig;
84 	std::unique_ptr<Timidity::Instruments> instruments;
85 };
86 
87 namespace TimidityPlus
88 {
89 	class Instruments;
90 	class SoundFontReaderInterface;
91 }
92 
93 struct TimidityConfig
94 {
95 	std::string timidity_config;
96 
97 	MusicIO::SoundFontReaderInterface* reader;
98 	std::string readerName;
99 	std::string loadedConfig;
100 	std::shared_ptr<TimidityPlus::Instruments> instruments;	// this is held both by the config and the device
101 
102 };
103 
104 namespace WildMidi
105 {
106 	struct Instruments;
107 	class SoundFontReaderInterface;
108 }
109 
110 struct WildMidiConfig
111 {
112 	bool reverb = false;
113 	bool enhanced_resampling = true;
114 	std::string config;
115 
116 	MusicIO::SoundFontReaderInterface* reader;
117 	std::string readerName;
118 	std::string loadedConfig;
119 	std::shared_ptr<WildMidi::Instruments> instruments;	// this is held both by the config and the device
120 
121 };
122 
123 struct DumbConfig
124 {
125 	int  mod_samplerate;
126     int  mod_volramp = 2;
127     int  mod_interp = 2;
128     int  mod_autochip;
129     int  mod_autochip_size_force = 100;
130     int  mod_autochip_size_scan = 500;
131     int  mod_autochip_scan_threshold = 12;
132     float mod_dumb_mastervolume = 1;
133 };
134 
135 struct MiscConfig
136 {
137 	int snd_midiprecache;
138 	float gme_stereodepth;
139 	int snd_streambuffersize = 64;
140 	int snd_mididevice;
141 	int snd_outputrate = 44100;
142 	float snd_musicvolume = 1.f;
143 	float relative_volume = 1.f;
144 	float snd_mastervolume = 1.f;
145 };
146 
147 extern ADLConfig adlConfig;
148 extern FluidConfig fluidConfig;
149 extern OPLConfig oplConfig;
150 extern OpnConfig opnConfig;
151 extern GUSConfig gusConfig;
152 extern TimidityConfig timidityConfig;
153 extern WildMidiConfig wildMidiConfig;
154 extern DumbConfig dumbConfig;
155 extern MiscConfig miscConfig;
156 extern ZMusicCallbacks musicCallbacks;
157 
158