72 return SDL_clamp(
dttr_config.mss_sample_gain, 0.0f, 2.0f);
76 return SDL_clamp(
dttr_config.mss_sample_preemphasis, -1.0f, 2.0f);
102 const SDL_AudioSpec fallback = {
109 mixer = MIX_CreateMixerDevice(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, desired);
111 DTTR_LOG_ERROR(
"MIX_CreateMixerDevice failed: %s", SDL_GetError());
115 SDL_AudioSpec actual = {0};
116 if (!MIX_GetMixerFormat(
mixer, &actual)) {
123 "MSS mixer opened: format=0x%04X channels=%d freq=%d",
124 (
unsigned)actual.format,
133 MIX_DestroyMixer(
mixer);
DTTR_Graphics_COM_DirectDrawSurface7 DWORD flags void NULL
#define DTTR_LOG_INFO(...)
#define DTTR_LOG_ERROR(...)
void dttr_mss_core_reset_driver_open_count()
void dttr_mss_core_set_desired_spec(const SDL_AudioSpec *spec)
void dttr_mss_core_set_master_gain(float gain)
float dttr_mss_core_sample_headroom_gain()
static void clear_desired_spec()
void dttr_mss_core_ensure_preferences()
float dttr_mss_core_master_gain()
float dttr_mss_core_sample_preemphasis()
static bool has_desired_spec
static int * preference_slot(unsigned int preference)
int dttr_mss_core_set_preference(unsigned int preference, int value)
void dttr_mss_core_decrement_driver_open_count()
SDL_AudioSpec dttr_mss_core_mixer_spec()
bool dttr_mss_core_ensure_mixer()
static int preferences[DTTR_MSS_PREFERENCES_CAPACITY]
static SDL_AudioSpec mixer_spec
static SDL_AudioSpec desired_spec
static int driver_open_count
void dttr_mss_core_destroy_mixer()
void dttr_mss_core_increment_driver_open_count()
static bool preferences_initialized
static bool mix_initialized
bool dttr_mss_core_ensure_mix_initialized()
int dttr_mss_core_get_preference(unsigned int preference)
int dttr_mss_core_driver_open_count()
MIX_Mixer * dttr_mss_core_mixer()
bool dttr_mss_core_has_driver()
void dttr_mss_core_reset_preferences()
#define DTTR_MSS_MIXER_RATE
#define DTTR_MSS_MIXER_CHANNELS
static void dttr_mss_reset_preferences(int *preferences, size_t count)
#define DTTR_MSS_MIXER_FORMAT
#define DTTR_MSS_DEFAULT_MASTER_GAIN
#define DTTR_MSS_PREFERENCES_CAPACITY