28 #ifndef AGS_ENGINE_MEDIA_AUDIO_SOUNDCLIP_H 29 #define AGS_ENGINE_MEDIA_AUDIO_SOUNDCLIP_H 31 #include "audio/mixer.h" 32 #include "audio/audiostream.h" 33 #include "common/stream.h" 50 SoundClipInitial, SoundClipPlaying, SoundClipPaused, SoundClipStopped
62 int _xSource, _ySource;
63 int _maximumPossibleDistanceAway;
69 int _panningAsPercentage;
70 int _directionalVolModifier;
72 virtual int play() = 0;
73 virtual void pause() = 0;
74 virtual void resume() = 0;
83 virtual void seek(
int offset) = 0;
88 virtual void seek_ms(
int pos_ms) = 0;
90 virtual int play_from(
int position) = 0;
91 virtual bool is_playing() = 0;
92 virtual bool is_paused() = 0;
114 virtual void set_panning(
int newPanning) = 0;
115 virtual void set_speed(
int new_speed) = 0;
116 virtual void poll() = 0;
182 inline bool is_ready() {
return is_playing(); }
190 virtual void adjust_volume() = 0;
199 bool _paramsChanged =
false;
202 inline int get_final_volume()
const {
203 int final_vol = _vol255 + _volModifier + _directionalVolModifier;
204 return final_vol >= 0 ? final_vol : 0;
212 int pos_to_posms(
int pos)
const;
218 SoundClipState _state;
219 bool _waitingToPlay =
false;
226 void poll()
override;
228 int play_from(
int position)
override;
229 void pause()
override;
230 void resume()
override;
231 bool is_playing()
override;
232 bool is_paused()
override;
233 void seek(
int offset)
override;
234 void seek_ms(
int pos_ms)
override;
238 void set_panning(
int newPanning)
override;
239 void set_speed(
int new_speed)
override;
240 void adjust_volume()
override;
243 template<
int SOUND_TYPE>
void apply_volume_modifier(int mod)
virtual int get_sound_type() const =0
void set_volume_direct(int vol_percent, int vol_absolute)
virtual int get_length_ms()=0
int get_volume255() const
Definition: sound_clip.h:127
bool is_muted() const
Definition: sound_clip.h:142
int get_volume100() const
Definition: sound_clip.h:122
void set_volume100(int volume)
Definition: sound_clip.h:208
Definition: sound_clip.h:53
SoundType
Definition: mixer.h:62
int get_sound_type() const
Definition: sound_clip.h:247
virtual int get_pos_ms()=0
Definition: sound_clip.h:244
Definition: audiostream.h:50
virtual void seek_ms(int pos_ms)=0
int get_speed() const
Definition: sound_clip.h:137
int get_panning() const
Definition: sound_clip.h:132
virtual void seek(int offset)=0
void apply_directional_modifier(int mod)
void set_volume255(int volume)