-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/midi/IMidiChannelVoice.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <HyperSonicDrivers/drivers/midi/IMidiChannelVoice.hpp> | ||
#include <HyperSonicDrivers/drivers/midi/IMidiChannel.hpp> | ||
|
||
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<uint8_t>((static_cast<uint32_t>(m_volume) * m_channel->volume / 127), 127); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/midi/opl/OplChannel.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <HyperSonicDrivers/drivers/midi/opl/OplChannel.hpp> | ||
|
||
namespace HyperSonicDrivers::drivers::midi::opl | ||
{ | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/midi/opl/OplChannel.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#pragma once | ||
|
||
#include <HyperSonicDrivers/drivers/midi/IMidiChannel.hpp> | ||
|
||
namespace HyperSonicDrivers::drivers::midi::opl | ||
{ | ||
class OplChannel : public IMidiChannel | ||
{ | ||
public: | ||
OplChannel() = default; | ||
}; | ||
} |