-
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.
IMusicDriver getDevice | IDevice::getName | devices::Opl::getEmulator…
…Type (#263) * IMusicDriver getDevice * IMusicDriverTest * update version * getDeviceName * IDeviceTypesFormatter * Renderer OPL through device * Renderer OPL through device test * code rev
- Loading branch information
Showing
31 changed files
with
284 additions
and
54 deletions.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -7,4 +7,12 @@ namespace HyperSonicDrivers::devices | |
Opl = 0, | ||
Mt32, | ||
}; | ||
|
||
enum class eDeviceName | ||
{ | ||
Adlib, | ||
SbPro, | ||
SbPro2, | ||
MT32 | ||
}; | ||
} |
14 changes: 14 additions & 0 deletions
14
sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/IMusicDriver.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,14 @@ | ||
#include <HyperSonicDrivers/drivers/IMusicDriver.hpp> | ||
#include <HyperSonicDrivers/utils/ILogger.hpp> | ||
|
||
namespace HyperSonicDrivers::drivers | ||
{ | ||
IMusicDriver::IMusicDriver(const std::shared_ptr<devices::IDevice>& device) : | ||
m_device(device) | ||
{ | ||
if (m_device == nullptr) | ||
{ | ||
utils::throwLogC<std::runtime_error>("device is null"); | ||
} | ||
} | ||
} |
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
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
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
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
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
38 changes: 38 additions & 0 deletions
38
sdl2-hyper-sonic-drivers/src/std/IDeviceTypesFormatter.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,38 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <format> | ||
#include <HyperSonicDrivers/devices/types.hpp> | ||
|
||
namespace std | ||
{ | ||
template<> | ||
struct formatter<HyperSonicDrivers::devices::eDeviceName> : formatter<string_view> | ||
{ | ||
template<typename FormatContext> | ||
auto format(HyperSonicDrivers::devices::eDeviceName device_name, FormatContext& fc) const | ||
{ | ||
string str; | ||
|
||
switch (device_name) | ||
{ | ||
using enum HyperSonicDrivers::devices::eDeviceName; | ||
|
||
case Adlib: | ||
str = "Adlib"; | ||
break; | ||
case SbPro: | ||
str = "SbPro"; | ||
break; | ||
case SbPro2: | ||
str = "SbPro2"; | ||
break; | ||
case MT32: | ||
str = "MT32"; | ||
break; | ||
} | ||
|
||
return formatter<std::string_view>::format(str, fc); | ||
} | ||
}; | ||
} |
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
Oops, something went wrong.