audio.c: get_audio_args()
This commit is contained in:
parent
e6ba50ab82
commit
6cb8736fc1
@ -190,6 +190,15 @@ void play_audio_ex(const char *path, const char *channel, t_play_audio_args args
|
||||
}
|
||||
|
||||
|
||||
t_play_audio_args *get_audio_args(const char *channel) {
|
||||
struct audio_channel_pair *pair = shgetp_null(ctx.audio_channels, channel);
|
||||
if (!pair)
|
||||
return NULL;
|
||||
|
||||
return &pair->value.args;
|
||||
}
|
||||
|
||||
|
||||
t_play_audio_args get_default_audio_args(void) {
|
||||
return (t_play_audio_args){
|
||||
.repeat = false,
|
||||
|
@ -27,9 +27,9 @@ void play_audio(const char *path, const char *channel);
|
||||
|
||||
void play_audio_ex(const char *path, const char *channel, t_play_audio_args args);
|
||||
|
||||
void set_audio_args(const char *channel, t_play_audio_args args);
|
||||
|
||||
t_play_audio_args get_audio_args(const char *channel);
|
||||
/* could be used for modifying args */
|
||||
/* warn: is only valid if no other calls to audio are made */
|
||||
t_play_audio_args *get_audio_args(const char *channel);
|
||||
|
||||
t_play_audio_args get_default_audio_args(void);
|
||||
|
||||
|
@ -10,6 +10,8 @@ static void ingame_tick(struct state *state) {
|
||||
|
||||
world_drawdef(scn->world);
|
||||
player_calc(scn->player);
|
||||
|
||||
get_audio_args("soundtrack")->volume -= 0.01f;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user