diff options
author | Tarek Soliman | 2017-12-23 15:40:30 -0600 |
---|---|---|
committer | Tarek Soliman | 2018-01-03 10:40:23 -0600 |
commit | 50d79c5f265aad592ae7f17209653ccbb1fde488 (patch) | |
tree | 1951526e3ff2910acb0588f3a23ba0e9e7e66544 /audio/softsynth/mt32/LA32WaveGenerator.h | |
parent | bb5e8d3a11711d409f89739cf3f054cd5bac8c4f (diff) | |
download | scummvm-rg350-50d79c5f265aad592ae7f17209653ccbb1fde488.tar.gz scummvm-rg350-50d79c5f265aad592ae7f17209653ccbb1fde488.tar.bz2 scummvm-rg350-50d79c5f265aad592ae7f17209653ccbb1fde488.zip |
MT32: Update to munt 2.3.0
This uses upstream commit 939cc986d9ffd044f8c6149361127ad5d94e430f
Closes gh-1091
Diffstat (limited to 'audio/softsynth/mt32/LA32WaveGenerator.h')
-rw-r--r-- | audio/softsynth/mt32/LA32WaveGenerator.h | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/audio/softsynth/mt32/LA32WaveGenerator.h b/audio/softsynth/mt32/LA32WaveGenerator.h index 6a40e44c98..c206daa63f 100644 --- a/audio/softsynth/mt32/LA32WaveGenerator.h +++ b/audio/softsynth/mt32/LA32WaveGenerator.h @@ -1,5 +1,5 @@ /* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Dean Beeler, Jerome Fisher - * Copyright (C) 2011-2016 Dean Beeler, Jerome Fisher, Sergey V. Mikayev + * Copyright (C) 2011-2017 Dean Beeler, Jerome Fisher, Sergey V. Mikayev * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -22,10 +22,6 @@ #include "internals.h" #include "Types.h" -#if MT32EMU_USE_FLOAT_SAMPLES -#include "LA32FloatWaveGenerator.h" -#else - namespace MT32Emu { /** @@ -208,6 +204,30 @@ public: // LA32PartialPair contains a structure of two partials being mixed / ring modulated class LA32PartialPair { +public: + enum PairType { + MASTER, + SLAVE + }; + + virtual ~LA32PartialPair() {} + + // ringModulated should be set to false for the structures with mixing or stereo output + // ringModulated should be set to true for the structures with ring modulation + // mixed is used for the structures with ring modulation and indicates whether the master partial output is mixed to the ring modulator output + virtual void init(const bool ringModulated, const bool mixed) = 0; + + // Initialise the WG engine for generation of synth partial samples and set up the invariant parameters + virtual void initSynth(const PairType master, const bool sawtoothWaveform, const Bit8u pulseWidth, const Bit8u resonance) = 0; + + // Initialise the WG engine for generation of PCM partial samples and set up the invariant parameters + virtual void initPCM(const PairType master, const Bit16s * const pcmWaveAddress, const Bit32u pcmWaveLength, const bool pcmWaveLooped) = 0; + + // Deactivate the WG engine + virtual void deactivate(const PairType master) = 0; +}; // class LA32PartialPair + +class LA32IntPartialPair : public LA32PartialPair { LA32WaveGenerator master; LA32WaveGenerator slave; bool ringModulated; @@ -216,11 +236,6 @@ class LA32PartialPair { static Bit16s unlogAndMixWGOutput(const LA32WaveGenerator &wg); public: - enum PairType { - MASTER, - SLAVE - }; - // ringModulated should be set to false for the structures with mixing or stereo output // ringModulated should be set to true for the structures with ring modulation // mixed is used for the structures with ring modulation and indicates whether the master partial output is mixed to the ring modulator output @@ -235,7 +250,8 @@ public: // Update parameters with respect to TVP, TVA and TVF, and generate next sample void generateNextSample(const PairType master, const Bit32u amp, const Bit16u pitch, const Bit32u cutoff); - // Perform mixing / ring modulation and return the result + // Perform mixing / ring modulation of WG output and return the result + // Although, LA32 applies panning itself, we assume it is applied in the mixer, not within a pair Bit16s nextOutSample(); // Deactivate the WG engine @@ -243,10 +259,8 @@ public: // Return active state of the WG engine bool isActive(const PairType master) const; -}; // class LA32PartialPair +}; // class LA32IntPartialPair } // namespace MT32Emu -#endif // #if MT32EMU_USE_FLOAT_SAMPLES - #endif // #ifndef MT32EMU_LA32_WAVE_GENERATOR_H |