aboutsummaryrefslogtreecommitdiff
path: root/audio/softsynth/mt32/Synth.h
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2017-02-27 12:32:06 +0100
committerWillem Jan Palenstijn2017-02-28 18:40:04 +0100
commit867511d2d0a5d063e37b07115b8b98f5930d415b (patch)
tree2fd96da5f26b8320b8c3524a2acb20f37c59e61c /audio/softsynth/mt32/Synth.h
parente2a72393d298a5c338e55b73ae910c9ef4e1b45e (diff)
downloadscummvm-rg350-867511d2d0a5d063e37b07115b8b98f5930d415b.tar.gz
scummvm-rg350-867511d2d0a5d063e37b07115b8b98f5930d415b.tar.bz2
scummvm-rg350-867511d2d0a5d063e37b07115b8b98f5930d415b.zip
MT32: Update Munt to 2.0.3
This update uses upstream commit 777c51cdb4dbb4e02a53c23edea9086f0b600e26. The new SampleRateConverter is added, but not built as we don't use it. Also, building it without source changes will need additional include directories. This update of Munt reduces the stack size, and thus fixes bug #9630.
Diffstat (limited to 'audio/softsynth/mt32/Synth.h')
-rwxr-xr-xaudio/softsynth/mt32/Synth.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/audio/softsynth/mt32/Synth.h b/audio/softsynth/mt32/Synth.h
index 5561d8d5db..fe31d99f02 100755
--- a/audio/softsynth/mt32/Synth.h
+++ b/audio/softsynth/mt32/Synth.h
@@ -120,6 +120,8 @@ friend class PartialManager;
friend class Poly;
friend class Renderer;
friend class RhythmPart;
+friend class SamplerateAdapter;
+friend class SoxrAdapter;
friend class TVA;
friend class TVP;
@@ -254,6 +256,14 @@ public:
}
}
+ static inline Bit16s convertSample(float sample) {
+ return Synth::clipSampleEx(Bit32s(sample * 16384.0f)); // This multiplier takes into account the DAC bit shift
+ }
+
+ static inline float convertSample(Bit16s sample) {
+ return float(sample) / 16384.0f; // This multiplier takes into account the DAC bit shift
+ }
+
// Returns library version as an integer in format: 0x00MMmmpp, where:
// MM - major version number
// mm - minor version number