|
1
|
1 #pragma once
|
|
|
2
|
|
|
3 namespace dsp_sample_common {
|
|
|
4 //This is our GUID. Generate your own one when reusing this code.
|
|
|
5 static constexpr GUID guid = { 0x890827b, 0x67df, 0x4c27, { 0xba, 0x1a, 0x4f, 0x95, 0x8d, 0xf, 0xb5, 0xd0 } };
|
|
|
6
|
|
|
7 static void make_preset(float gain, dsp_preset & out) {
|
|
|
8 dsp_preset_builder builder; builder << gain; builder.finish(guid, out);
|
|
|
9 }
|
|
|
10 static float parse_preset(const dsp_preset & in) {
|
|
|
11 try {
|
|
|
12 float gain;
|
|
|
13 dsp_preset_parser parser(in); parser >> gain;
|
|
|
14 return gain;
|
|
|
15 } catch(exception_io_data const &) {return 0;}
|
|
|
16 }
|
|
|
17
|
|
|
18 }
|
|
|
19
|
|
|
20 using namespace dsp_sample_common;
|