ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
Loading...
Searching...
No Matches
sound.cpp File Reference
#include "./asw/modules/sound.h"
#include <SDL3_mixer/SDL_mixer.h>
#include <algorithm>
#include <array>
#include <atomic>
#include <cmath>
#include "./asw/modules/display.h"
#include "./asw/modules/log.h"
#include "./asw/modules/random.h"
Include dependency graph for sound.cpp:

Go to the source code of this file.

Classes

struct  anonymous_namespace{sound.cpp}::LowPass
 
struct  anonymous_namespace{sound.cpp}::Voice
 
struct  anonymous_namespace{sound.cpp}::Voice::Sent
 
struct  anonymous_namespace{sound.cpp}::Duck
 
struct  asw::sound::HandleAccess
 

Namespaces

namespace  anonymous_namespace{sound.cpp}
 

Functions

float anonymous_namespace{sound.cpp}::bus_gain (asw::sound::Bus bus)
 
bool anonymous_namespace{sound.cpp}::is_active (const Voice &v)
 
void SDLCALL anonymous_namespace{sound.cpp}::low_pass_callback (void *userdata, MIX_Track *, const SDL_AudioSpec *spec, float *pcm, int samples)
 
float anonymous_namespace{sound.cpp}::attenuate (const asw::sound::Attenuation &att, float distance)
 
float anonymous_namespace{sound.cpp}::doppler (const Voice &v)
 
void anonymous_namespace{sound.cpp}::set_stereo_pan (Voice &v, float pan)
 
void anonymous_namespace{sound.cpp}::set_point (Voice &v, float x, float z)
 
void anonymous_namespace{sound.cpp}::apply (Voice &v)
 
void anonymous_namespace{sound.cpp}::apply_music ()
 
int anonymous_namespace{sound.cpp}::find_voice (int priority)
 
float anonymous_namespace{sound.cpp}::vary (float value, float variation)
 
Voice * anonymous_namespace{sound.cpp}::resolve (int voice, uint32_t generation)
 
asw::sound::SoundHandle anonymous_namespace{sound.cpp}::start (const asw::Sample &sample, const asw::sound::PlayOptions &options, const asw::Vec2< float > *position)
 

Variables

constexpr size_t anonymous_namespace{sound.cpp}::NUM_VOICES = 32
 
constexpr size_t anonymous_namespace{sound.cpp}::NUM_BUSES = static_cast<size_t>(asw::sound::Bus::Count)
 
constexpr int anonymous_namespace{sound.cpp}::MAX_FILTER_CHANNELS = 8
 
constexpr float anonymous_namespace{sound.cpp}::OCCLUDED_CUTOFF_HZ = 500.0F
 
constexpr float anonymous_namespace{sound.cpp}::OPEN_CUTOFF_HZ = 20000.0F
 
constexpr float anonymous_namespace{sound.cpp}::OCCLUDED_GAIN = 0.5F
 
constexpr float anonymous_namespace{sound.cpp}::MIN_DOPPLER = 0.5F
 
constexpr float anonymous_namespace{sound.cpp}::MAX_DOPPLER = 2.0F
 
float anonymous_namespace{sound.cpp}::master_volume = 1.0F
 
std::array< float, NUM_BUSES > anonymous_namespace{sound.cpp}::bus_volume = { 1.0F, 1.0F, 1.0F, 1.0F, 1.0F }
 
std::array< Duck, NUM_BUSES > anonymous_namespace{sound.cpp}::ducks {}
 
std::array< Voice, NUM_VOICES > anonymous_namespace{sound.cpp}::voices
 
MIX_Track * anonymous_namespace{sound.cpp}::music_track = nullptr
 
float anonymous_namespace{sound.cpp}::music_base_volume = 1.0F
 
float anonymous_namespace{sound.cpp}::music_sent_gain = -1.0F
 
MIX_Mixer * anonymous_namespace{sound.cpp}::mixer = nullptr
 
uint32_t anonymous_namespace{sound.cpp}::session = 0
 
asw::Vec2< float > anonymous_namespace{sound.cpp}::listener_position
 
asw::Vec2< float > anonymous_namespace{sound.cpp}::listener_velocity
 
asw::sound::SpatialMode anonymous_namespace{sound.cpp}::spatial_mode = asw::sound::SpatialMode::Stereo
 
float anonymous_namespace{sound.cpp}::doppler_factor = 1.0F
 
float anonymous_namespace{sound.cpp}::speed_of_sound = 3000.0F
 
uint64_t anonymous_namespace{sound.cpp}::last_update_ns = 0