diff options
author | Vitaly Novichkov <admin@wohlnet.ru> | 2018-06-08 01:38:14 +0300 |
---|---|---|
committer | Vitaly Novichkov <admin@wohlnet.ru> | 2018-06-08 01:38:14 +0300 |
commit | 2899c50228b8be18254dddee53c86c6dc3b8f19a (patch) | |
tree | 11de0c46bc56a687422aa6624ccbc78d6be6833d /src/chips/opl_chip_base.cpp | |
parent | 66923df807a6cece8872e1ffeed36001c02df4fa (diff) | |
parent | 7cfe4dbcef738681b5445aa14b35fc1a6f8ff001 (diff) | |
download | libADLMIDI-2899c50228b8be18254dddee53c86c6dc3b8f19a.tar.gz libADLMIDI-2899c50228b8be18254dddee53c86c6dc3b8f19a.tar.bz2 libADLMIDI-2899c50228b8be18254dddee53c86c6dc3b8f19a.zip |
Merge branch 'hq-resampler' of git@github.com:jpcima/libADLMIDI.git
Diffstat (limited to 'src/chips/opl_chip_base.cpp')
-rw-r--r-- | src/chips/opl_chip_base.cpp | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/src/chips/opl_chip_base.cpp b/src/chips/opl_chip_base.cpp deleted file mode 100644 index 670a998..0000000 --- a/src/chips/opl_chip_base.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "opl_chip_base.h" - -OPLChipBase::OPLChipBase() : - m_rate(44100) -{} - -OPLChipBase::OPLChipBase(const OPLChipBase &c): - m_rate(c.m_rate) -{} - -OPLChipBase::~OPLChipBase() -{} - -void OPLChipBase::setRate(uint32_t rate) -{ - m_rate = rate; -} - -void OPLChipBase::reset(uint32_t rate) -{ - setRate(rate); -} - -int OPLChipBase::generate32(int32_t *output, size_t frames) -{ - enum { maxFramesAtOnce = 256 }; - int16_t temp[2 * maxFramesAtOnce]; - for(size_t left = frames; left > 0;) { - size_t count = (left < static_cast<size_t>(maxFramesAtOnce)) ? left : static_cast<size_t>(maxFramesAtOnce); - generate(temp, count); - for(size_t i = 0; i < 2 * count; ++i) - output[i] = temp[i]; - left -= count; - output += 2 * count; - } - return (int)frames; -} - -int OPLChipBase::generateAndMix32(int32_t *output, size_t frames) -{ - enum { maxFramesAtOnce = 256 }; - int16_t temp[2 * maxFramesAtOnce]; - for(size_t left = frames; left > 0;) { - size_t count = (left < static_cast<size_t>(maxFramesAtOnce)) ? left : static_cast<size_t>(maxFramesAtOnce); - generate(temp, count); - for(size_t i = 0; i < 2 * count; ++i) - output[i] += temp[i]; - left -= count; - output += 2 * count; - } - return (int)frames; -} |