diff --git a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/midi/IMidiChannelVoice.cpp b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/midi/IMidiChannelVoice.cpp new file mode 100644 index 00000000..bedfd4e3 --- /dev/null +++ b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/midi/IMidiChannelVoice.cpp @@ -0,0 +1,21 @@ +#include +#include + +namespace HyperSonicDrivers::drivers::midi +{ + uint8_t IMidiChannelVoice::getChannelNum() const noexcept + { + return m_channel->channel; + } + + void IMidiChannelVoice::setVolumes(const uint8_t volume) noexcept + { + m_volume = volume; + m_real_volume = calcVolume_(); + } + + uint8_t IMidiChannelVoice::calcVolume_() const noexcept + { + return std::min((static_cast(m_volume) * m_channel->volume / 127), 127); + } +} diff --git a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/midi/opl/OplChannel.cpp b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/midi/opl/OplChannel.cpp new file mode 100644 index 00000000..ba75b84d --- /dev/null +++ b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/midi/opl/OplChannel.cpp @@ -0,0 +1,6 @@ +#include + +namespace HyperSonicDrivers::drivers::midi::opl +{ + +} diff --git a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/midi/opl/OplChannel.hpp b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/midi/opl/OplChannel.hpp new file mode 100644 index 00000000..52c6e26d --- /dev/null +++ b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/midi/opl/OplChannel.hpp @@ -0,0 +1,12 @@ +#pragma once + +#include + +namespace HyperSonicDrivers::drivers::midi::opl +{ + class OplChannel : public IMidiChannel + { + public: + OplChannel() = default; + }; +}