mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-09-03 00:53:47 -04:00
BST SE/STREAM replacement support
No SEQ yet since idk how I wanna handle it.
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
#define AUDIO_RES_SERVICE_MAJOR 1u
|
||||
#define AUDIO_RES_SERVICE_MINOR 0u
|
||||
|
||||
/*
|
||||
* WSYS structs
|
||||
*/
|
||||
|
||||
#define AUDIO_RES_DEFAULT_KEY 0x3C;
|
||||
|
||||
typedef enum AudioWaveBank : uint8_t {
|
||||
@@ -21,6 +25,7 @@ typedef enum AudioWaveFormat : uint8_t {
|
||||
} AudioWaveFormat;
|
||||
|
||||
typedef uint64_t AudioWaveHandle;
|
||||
typedef uint64_t AudioSoundTableHandle;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -41,9 +46,68 @@ typedef struct AudioWaveInfo {
|
||||
AudioRawWave const* raw_wave;
|
||||
} AudioWaveInfo;
|
||||
|
||||
/*
|
||||
* BST structs
|
||||
*/
|
||||
|
||||
typedef enum SoundEffectCategory : uint8_t {
|
||||
SE_CATEGORY_SYSTEM_SE,
|
||||
SE_CATEGORY_PLAYER_VOICE,
|
||||
SE_CATEGORY_PLAYER_SE,
|
||||
SE_CATEGORY_FOOTNOTE_SE,
|
||||
SE_CATEGORY_COLLISION_SE,
|
||||
SE_CATEGORY_CHARA_VOICE,
|
||||
SE_CATEGORY_CHARA_SE,
|
||||
SE_CATEGORY_ENEMY_SE,
|
||||
SE_CATEGORY_OBJECT_SE,
|
||||
SE_CATEGORY_ENV_SE
|
||||
} SoundEffectCategory;
|
||||
|
||||
typedef struct AudioSoundTableEffectInfo {
|
||||
uint8_t priority;
|
||||
float volume;
|
||||
float pitch;
|
||||
|
||||
bool always_max_priority;
|
||||
|
||||
bool ignore_distance_volume;
|
||||
bool ignore_distance_fx_mix;
|
||||
bool ignore_pan;
|
||||
bool ignore_dolby;
|
||||
|
||||
uint8_t random_volume;
|
||||
uint8_t random_pitch;
|
||||
|
||||
uint8_t doppler_power;
|
||||
|
||||
uint8_t volume_dist_class;
|
||||
bool clamp_min_volume;
|
||||
bool cull_at_max_distance;
|
||||
} AudioSoundTableEffectInfo;
|
||||
|
||||
typedef enum StreamPan : uint8_t {
|
||||
STREAM_PAN_CENTER,
|
||||
STREAM_PAN_LEFT,
|
||||
STREAM_PAN_RIGHT,
|
||||
} StreamPan;
|
||||
|
||||
#define STREAM_MAX_CHILDREN 6
|
||||
|
||||
typedef struct AudioSoundTableStreamInfo {
|
||||
uint8_t priority;
|
||||
float volume;
|
||||
StreamPan pan_parameters[STREAM_MAX_CHILDREN];
|
||||
char const* file_path;
|
||||
bool stop_on_scene_change;
|
||||
} AudioSoundTableStreamInfo;
|
||||
|
||||
typedef struct AudioResService {
|
||||
ServiceHeader header;
|
||||
|
||||
/*
|
||||
* WSYS API
|
||||
*/
|
||||
|
||||
ModResult (*replace_wave)(
|
||||
ModContext* ctx,
|
||||
AudioWaveBank bank,
|
||||
@@ -61,6 +125,38 @@ typedef struct AudioResService {
|
||||
uint16_t* out_wave_id);
|
||||
|
||||
ModResult (*remove_wave)(ModContext* ctx, AudioWaveHandle handle);
|
||||
|
||||
/*
|
||||
* BST API
|
||||
*/
|
||||
|
||||
ModResult (*replace_sound_table_effect)(
|
||||
ModContext* ctx,
|
||||
SoundEffectCategory category_id,
|
||||
uint16_t effect_id,
|
||||
AudioSoundTableEffectInfo const* info,
|
||||
AudioSoundTableHandle* out_handle);
|
||||
|
||||
ModResult (*add_sound_table_effect)(
|
||||
ModContext* ctx,
|
||||
SoundEffectCategory category_id,
|
||||
AudioSoundTableEffectInfo const* info,
|
||||
AudioSoundTableHandle* out_handle,
|
||||
uint16_t* out_effect_id);
|
||||
|
||||
ModResult (*replace_sound_table_stream)(
|
||||
ModContext* ctx,
|
||||
uint16_t stream_id,
|
||||
AudioSoundTableStreamInfo const* info,
|
||||
AudioSoundTableHandle* out_handle);
|
||||
|
||||
ModResult (*add_sound_table_stream)(
|
||||
ModContext* ctx,
|
||||
AudioSoundTableStreamInfo const* info,
|
||||
AudioSoundTableHandle* out_handle,
|
||||
uint16_t* out_stream_id);
|
||||
|
||||
ModResult (*remove_sound_table)(ModContext* ctx, AudioSoundTableHandle handle);
|
||||
} AudioResService;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user