File Audio.c

FileList > core > Audio.c

Go to the source code of this file

  • #include "Audio.h"
  • #include <stdio.h>
  • #include <errno.h>
  • #include <string.h>
  • #include <float.h>
  • #include "AL/al.h"
  • #include "AL/alc.h"
  • #include "AL/alext.h"
  • #include "Log.h"
  • #include <stdlib.h>
  • #include <math.h>
  • #include "EngineUtils.h"
  • #include "AssertLib.h"
  • #include "Thread.h"
  • #include "ThreadSafeQueue.h"
  • #include "ObjectPool.h"
  • #include <cglm/cglm.h>
  • #include "HandleDefs.h"

Classes

Type Name
struct AudioQueueItem
struct SFXBuffer
struct SoundEffect
struct StreamedSoundPlayerCommand

Public Types

Type Name
enum AudioQueueItemType
typedef int HSFXBuffer
enum SoundEffectType

Public Attributes

Type Name
CrossPlatformThread gAudioThread
struct ThreadSafeQueue gAudioTxQueue
ALuint gBasicSource = -1
ALCint gDevRate = 0

Public Static Attributes

Type Name
HSFXBuffer gPlayingBuffersListHead = -1
int gPlayingBuffersListLen = 0
ALuint gSFXSource = -1

Public Functions

Type Name
void Au_DeInit ()
int Au_Init (char *** argv, int * argc)
void Au_PlayZzFX (const struct ZZFXSound * pSound)
DECLARE_THREAD_PROC (AudioThread, arg)
void OnAudioThreadQueueWrapped (void * pItemToBeLost)
void zzfx_Update (float deltaT)
float zzfx_struct (struct ZZFXSound * pSound)

Public Static Functions

Type Name
void AllocateWorkingSampleBuffer ()
HSFXBuffer AquireSFXBuffer ()
HSFXBuffer FindReusableBuffer ()
void InsertBufferIntoPlayingList (HSFXBuffer hBuf)
static OBJECT_POOL (struct SFXBuffer)
void RemoveBufferFromPlayingList (HSFXBuffer hBuf)

Macros

Type Name
define PI 3.14159265358979323846
define PI2 (2.0 \* PI)

Public Types Documentation

enum AudioQueueItemType

enum AudioQueueItemType {
    AQI_PlaySFX,
    AQI_StreamPlayerCommand,
    AQI_ShutdownAudioThread
};

typedef HSFXBuffer

typedef int HSFXBuffer;

enum SoundEffectType

enum SoundEffectType {
    SET_ZzFX,
    SET_PreloadedWav
};

Public Attributes Documentation

variable gAudioThread

CrossPlatformThread gAudioThread;

variable gAudioTxQueue

struct ThreadSafeQueue gAudioTxQueue;

variable gBasicSource

ALuint gBasicSource;

variable gDevRate

ALCint gDevRate;

Public Static Attributes Documentation

variable gPlayingBuffersListHead

HSFXBuffer gPlayingBuffersListHead;

variable gPlayingBuffersListLen

int gPlayingBuffersListLen;

variable gSFXSource

ALuint gSFXSource;

Public Functions Documentation

function Au_DeInit

void Au_DeInit () 

function Au_Init

int Au_Init (
    char *** argv,
    int * argc
) 

function Au_PlayZzFX

void Au_PlayZzFX (
    const struct ZZFXSound * pSound
) 

function DECLARE_THREAD_PROC

DECLARE_THREAD_PROC (
    AudioThread,
    arg
) 

function OnAudioThreadQueueWrapped

void OnAudioThreadQueueWrapped (
    void * pItemToBeLost
) 

function zzfx_Update

void zzfx_Update (
    float deltaT
) 

function zzfx_struct

float zzfx_struct (
    struct ZZFXSound * pSound
) 

Public Static Functions Documentation

function AllocateWorkingSampleBuffer

static void AllocateWorkingSampleBuffer () 

function AquireSFXBuffer

static HSFXBuffer AquireSFXBuffer () 

function FindReusableBuffer

static HSFXBuffer FindReusableBuffer () 

function InsertBufferIntoPlayingList

static void InsertBufferIntoPlayingList (
    HSFXBuffer hBuf
) 

function OBJECT_POOL

static static OBJECT_POOL (
    struct SFXBuffer
) 

function RemoveBufferFromPlayingList

static void RemoveBufferFromPlayingList (
    HSFXBuffer hBuf
) 

Macro Definition Documentation

define PI

#define PI `3.14159265358979323846`

define PI2

#define PI2 `(2.0 * PI)`


The documentation for this class was generated from the following file /home/runner/work/2DFarmingRPG/2DFarmingRPG/Stardew/engine/src/core/Audio.c