mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
2d623e179b
## Link to GitHub Issue or related Pull Request, if one exists ## Description of change Deprecate backend conversion options and replace with one unified option for enabling WASAPI exclusive conversion to ASIO. The new option takes in a string (ASIO driver name) and when filled out, it automatically enables the ASIO backend. This is to avoid confusion that was caused by the previous option - the fact that it was split into two (one to enable the conversion, another to optionally pick which ASIO driver to use) and that user needed to specify an integer as opposed to the driver name. ## Testing Tested on IIDX33. Old options should continue to work.
42 lines
916 B
C++
42 lines
916 B
C++
#pragma once
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
#include <windows.h>
|
|
#include <mmreg.h>
|
|
#ifndef _MSC_VER
|
|
#include <ks.h>
|
|
#include <ksmedia.h>
|
|
#endif
|
|
|
|
namespace hooks::audio {
|
|
enum class Backend {
|
|
Asio,
|
|
WaveOut,
|
|
};
|
|
|
|
extern bool ENABLED;
|
|
extern bool VOLUME_HOOK_ENABLED;
|
|
extern bool USE_DUMMY;
|
|
extern WAVEFORMATEXTENSIBLE FORMAT;
|
|
extern std::optional<Backend> BACKEND;
|
|
extern std::optional<size_t> ASIO_DRIVER_ID;
|
|
extern std::string ASIO_DRIVER_NAME;
|
|
extern bool ASIO_FORCE_UNLOAD_ON_STOP;
|
|
extern bool LOW_LATENCY_SHARED_WASAPI;
|
|
|
|
void init();
|
|
void stop();
|
|
|
|
inline std::optional<Backend> name_to_backend(const char *value) {
|
|
if (_stricmp(value, "asio") == 0) {
|
|
return Backend::Asio;
|
|
} else if (_stricmp(value, "waveout") == 0) {
|
|
return Backend::WaveOut;
|
|
}
|
|
|
|
return std::nullopt;
|
|
}
|
|
}
|