-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* eChannelGroupFormatter * update version * code rev * fix switch fallthrouh
- Loading branch information
Showing
2 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
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
41 changes: 41 additions & 0 deletions
41
sdl2-hyper-sonic-drivers/src/std/eChannelGroupFormatter.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,41 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <format> | ||
#include <HyperSonicDrivers/audio/mixer/ChannelGroup.hpp> | ||
|
||
namespace std | ||
{ | ||
template<> | ||
struct formatter<HyperSonicDrivers::audio::mixer::eChannelGroup> : formatter<string_view> | ||
{ | ||
template<typename FormatContext> | ||
auto format(HyperSonicDrivers::audio::mixer::eChannelGroup ch_group, FormatContext& fc) const | ||
{ | ||
string str; | ||
|
||
switch (ch_group) | ||
{ | ||
using enum HyperSonicDrivers::audio::mixers::eChannelGroup; | ||
|
||
case Plain: | ||
str = "Plain"; | ||
break; | ||
case Music: | ||
str = "Music"; | ||
break; | ||
case Sfx: | ||
str = "Sfx"; | ||
break; | ||
case Speech: | ||
str = "Speech"; | ||
break; | ||
case Unknown: | ||
str = "Unknown"; | ||
break; | ||
} | ||
|
||
return formatter<std::string_view>::format(str, fc); | ||
} | ||
}; | ||
} |