22 #ifndef AGS_ENGINE_MEDIA_AUDIO_AUDIO_H 23 #define AGS_ENGINE_MEDIA_AUDIO_AUDIO_H 25 #include "common/std/array.h" 26 #include "ags/engine/media/audio/audio_defines.h" 27 #include "ags/shared/ac/dynobj/script_audio_clip.h" 28 #include "ags/engine/ac/dynobj/script_audio_channel.h" 29 #include "ags/engine/media/audio/ambient_sound.h" 30 #include "ags/engine/ac/timer.h" 41 static SOUNDCLIP *GetChannelIfPlaying(
int index);
45 static SOUNDCLIP *MoveChannel(
int to,
int from);
48 static inline bool ChannelHasClip(
int index) {
49 return GetChannel(index) !=
nullptr;
52 static inline bool ChannelIsPlaying(
int index) {
53 return GetChannelIfPlaying(index) !=
nullptr;
61 void calculate_reserved_channel_count();
63 void start_fading_in_new_track_if_applicable(
int fadeInChannel,
ScriptAudioClip *newSound);
64 void stop_or_fade_out_channel(
int fadeOutChannel,
int fadeInChannel = -1,
ScriptAudioClip *newSound =
nullptr);
67 void remove_clips_of_type_from_queue(
int audioType);
68 void update_queued_clips_volume(
int audioType,
int new_vol);
70 void update_volume_drop_if_voiceover();
73 void stop_and_destroy_channel_ex(
int chid,
bool resetLegacyMusicSettings);
74 void stop_and_destroy_channel(
int chid);
76 void export_missing_audiochans();
79 int get_old_style_number_for_sound(
int sound_number);
80 SOUNDCLIP *load_sound_clip_from_old_style_number(
bool isMusic,
int indexNumber,
bool repeat);
84 int get_volume_adjusted_for_distance(
int volume,
int sndX,
int sndY,
int sndMaxDist);
85 void update_directional_sound_vol();
86 void update_ambient_sound_vol();
88 bool is_audiotype_allowed_to_play(AudioFileType type);
92 void stop_all_sound_and_music();
93 void shutdown_sound();
94 int play_sound(
int val1);
98 void clear_music_cache();
99 void play_next_queued();
100 int calculate_max_volume();
102 void apply_volume_drop_modifier(
bool applyModifier);
104 void sync_audio_playback();
107 void update_audio_system_on_game_loop();
109 void update_music_volume();
110 void post_new_music_check();
113 int prepare_for_new_music();
116 SOUNDCLIP *load_music_from_disk(
int mnum,
bool doRepeat);
117 void newmusic(
int mnum);
119 extern void cancel_scheduled_music_update();
120 extern void schedule_music_update_at(AGS_Clock::time_point);
121 extern void postpone_scheduled_music_update_by(std::chrono::milliseconds);
Definition: sound_clip.h:53
Definition: script_audio_channel.h:27
Definition: script_audio_clip.h:52