#include <Def/Channel.hpp>
A type-safe class for MIDI channels.
Definition at line 13 of file Channel.hpp.
Public Member Functions | |
| constexpr | Channel (uint8_t zeroBasedChannel) |
| Create a MIDI Channel object. | |
| constexpr uint8_t | getRaw () const |
| Get the channel as an integer. | |
| constexpr uint8_t | getOneBased () const |
| Get the channel as an integer. | |
| constexpr bool | operator== (const Channel &rhs) const |
| Check if two channels are the same. | |
| constexpr bool | operator!= (const Channel &rhs) const |
| Check if two channels are the different. | |
| Channel & | operator+= (uint8_t rhs) |
| Add an offset. | |
| Channel | operator+ (uint8_t rhs) const |
| Add an offset to a channel. | |
| Channel & | operator-= (uint8_t rhs) |
| Subtract an offset. | |
| Channel | operator- (uint8_t rhs) const |
| Subtract an offset from a channel. | |
Static Public Member Functions | |
| static constexpr Channel | createChannel (uint8_t oneBasedChannel) |
| Create a channel. | |
Private Attributes | |
| uint8_t | zeroBasedChannel: 4 |
|
inlineexplicitconstexpr |
Create a MIDI Channel object.
| zeroBasedChannel | The zero-based channel (0 is the first channel). |
Definition at line 21 of file Channel.hpp.
|
inlineconstexpr |
Get the channel as an integer.
Definition at line 29 of file Channel.hpp.
|
inlineconstexpr |
Get the channel as an integer.
Definition at line 36 of file Channel.hpp.
|
inlinestaticconstexpr |
Create a channel.
| oneBasedChannel | The channel number (1 is the first channel). |
Definition at line 44 of file Channel.hpp.
|
inlineconstexpr |
Check if two channels are the same.
| rhs | The other channel to compare this channel to. |
Definition at line 54 of file Channel.hpp.
|
inlineconstexpr |
Check if two channels are the different.
| rhs | The other channel to compare this channel to. |
Definition at line 64 of file Channel.hpp.
|
inline |
Add an offset.
| rhs | The offset to add to this channel. |
Definition at line 74 of file Channel.hpp.
|
inline |
Add an offset to a channel.
| rhs | The offset to add to the channel. |
Definition at line 85 of file Channel.hpp.
|
inline |
Subtract an offset.
| rhs | The offset to subtract from this channel. |
Definition at line 97 of file Channel.hpp.
|
inline |
Subtract an offset from a channel.
| rhs | The offset to subtract from the channel. |
Definition at line 108 of file Channel.hpp.
|
private |
Definition at line 115 of file Channel.hpp.