mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Rename get_position => get_playback_position and seek_pos => seek on audio classes
This commit is contained in:
committed by
Rémi Verschelde
parent
650e0cf318
commit
46af050e93
@@ -247,7 +247,7 @@ void AudioStreamPlaybackOpus::play(float p_from) {
|
||||
frames_mixed = pre_skip;
|
||||
playing = true;
|
||||
if (p_from > 0) {
|
||||
seek_pos(p_from);
|
||||
seek(p_from);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ void AudioStreamPlaybackOpus::stop() {
|
||||
playing = false;
|
||||
}
|
||||
|
||||
void AudioStreamPlaybackOpus::seek_pos(float p_time) {
|
||||
void AudioStreamPlaybackOpus::seek(float p_time) {
|
||||
if (!playing) return;
|
||||
ogg_int64_t pcm_offset = (ogg_int64_t)(p_time * osrate);
|
||||
bool ok = op_pcm_seek(opus_file, pcm_offset) == 0;
|
||||
@@ -340,7 +340,7 @@ float AudioStreamPlaybackOpus::get_length() const {
|
||||
return length;
|
||||
}
|
||||
|
||||
float AudioStreamPlaybackOpus::get_position() const {
|
||||
float AudioStreamPlaybackOpus::get_playback_position() const {
|
||||
|
||||
int32_t frames = int32_t(frames_mixed);
|
||||
if (frames < 0)
|
||||
|
||||
@@ -99,8 +99,8 @@ public:
|
||||
|
||||
virtual int get_loop_count() const { return repeats; }
|
||||
|
||||
virtual float get_position() const;
|
||||
virtual void seek_pos(float p_time);
|
||||
virtual float get_playback_position() const;
|
||||
virtual void seek(float p_time);
|
||||
|
||||
virtual int get_channels() const { return stream_channels; }
|
||||
virtual int get_mix_rate() const { return osrate; }
|
||||
|
||||
Reference in New Issue
Block a user