summaryrefslogtreecommitdiff
path: root/src/factories/naudio/v0/SampleFactory.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/factories/naudio/v0/SampleFactory.h')
-rw-r--r--src/factories/naudio/v0/SampleFactory.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/factories/naudio/v0/SampleFactory.h b/src/factories/naudio/v0/SampleFactory.h
index 50161b6..bf0d5a0 100644
--- a/src/factories/naudio/v0/SampleFactory.h
+++ b/src/factories/naudio/v0/SampleFactory.h
@@ -32,4 +32,21 @@ public:
}
bool SupportModdedAssets() override { return true; }
-}; \ No newline at end of file
+};
+
+#ifdef BUILD_UI
+// Decodes a sample to PCM16 through the AIFF converter. The PCM is 1:1 with
+// the vadpcm frames (front-padded so loop points stay aligned); `rate` is the
+// tuning-derived natural rate.
+bool DecodeSampleToPcm(AudioBankSample* sample, std::vector<int16_t>& pcm, int& rate);
+
+// Parses an in-memory AIFF (as produced by write_aiff) into PCM16.
+bool DecodeAiffBytes(const std::vector<char>& bytes, std::vector<int16_t>& pcm, int& rate);
+
+// Plays the sample (decoded through the AIFF converter) with basic controls.
+class SampleFactoryUI : public BaseFactoryUI {
+public:
+ float GetItemHeight(const ParseResultData& data) override;
+ void DrawUI(const ParseResultData& data) override;
+};
+#endif