diff foosdk/sdk/foobar2000/foo_sample/dsp_sample.h @ 1:20d02a178406 default tip

*: check in everything else yay
author Paper <paper@tflc.us>
date Mon, 05 Jan 2026 02:15:46 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/foosdk/sdk/foobar2000/foo_sample/dsp_sample.h	Mon Jan 05 02:15:46 2026 -0500
@@ -0,0 +1,20 @@
+#pragma once
+
+namespace dsp_sample_common {
+    //This is our GUID. Generate your own one when reusing this code.
+    static constexpr GUID guid = { 0x890827b, 0x67df, 0x4c27, { 0xba, 0x1a, 0x4f, 0x95, 0x8d, 0xf, 0xb5, 0xd0 } };
+
+    static void make_preset(float gain, dsp_preset & out) {
+        dsp_preset_builder builder; builder << gain; builder.finish(guid, out);
+    }
+    static float parse_preset(const dsp_preset & in) {
+        try {
+            float gain;
+            dsp_preset_parser parser(in); parser >> gain;
+            return gain;
+        } catch(exception_io_data const &) {return 0;}
+    }
+
+}
+
+using namespace dsp_sample_common;