Merge pull request #12457 from Noshyaar/buffer

Refactor bufer to buffer

[ci skip]
This commit is contained in:
Rémi Verschelde 2017-10-28 14:16:41 +02:00 committed by GitHub
commit 00168e3e33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 17 additions and 17 deletions

View File

@ -267,7 +267,7 @@ void AudioStreamPlaybackOpus::seek(float p_time) {
frames_mixed = osrate * p_time;
}
int AudioStreamPlaybackOpus::mix(int16_t *p_bufer, int p_frames) {
int AudioStreamPlaybackOpus::mix(int16_t *p_buffer, int p_frames) {
if (!playing)
return 0;
@ -281,7 +281,7 @@ int AudioStreamPlaybackOpus::mix(int16_t *p_bufer, int p_frames) {
break;
}
int ret = op_read(opus_file, (opus_int16 *)p_bufer, todo * stream_channels, &current_section);
int ret = op_read(opus_file, (opus_int16 *)p_buffer, todo * stream_channels, &current_section);
if (ret < 0) {
playing = false;
ERR_EXPLAIN("Error reading Opus File: " + file);
@ -325,7 +325,7 @@ int AudioStreamPlaybackOpus::mix(int16_t *p_bufer, int p_frames) {
frames_mixed += ret;
p_bufer += ret * stream_channels;
p_buffer += ret * stream_channels;
p_frames -= ret;
}

View File

@ -107,7 +107,7 @@ public:
virtual int get_minimum_buffer_size() const;
virtual int mix(int16_t *p_bufer, int p_frames);
virtual int mix(int16_t *p_buffer, int p_frames);
AudioStreamPlaybackOpus();
~AudioStreamPlaybackOpus();

View File

@ -92,7 +92,7 @@ long AudioStreamPlaybackOGGVorbis::_ov_tell_func(void *_f) {
return fa->get_position();
}
int AudioStreamPlaybackOGGVorbis::mix(int16_t *p_bufer, int p_frames) {
int AudioStreamPlaybackOGGVorbis::mix(int16_t *p_buffer, int p_frames) {
if (!playing)
return 0;
@ -109,9 +109,9 @@ int AudioStreamPlaybackOGGVorbis::mix(int16_t *p_bufer, int p_frames) {
//printf("to mix %i - mix me %i bytes\n",to_mix,to_mix*stream_channels*sizeof(int16_t));
#ifdef BIG_ENDIAN_ENABLED
long ret = ov_read(&vf, (char *)p_bufer, todo * stream_channels * sizeof(int16_t), 1, 2, 1, &current_section);
long ret = ov_read(&vf, (char *)p_buffer, todo * stream_channels * sizeof(int16_t), 1, 2, 1, &current_section);
#else
long ret = ov_read(&vf, (char *)p_bufer, todo * stream_channels * sizeof(int16_t), 0, 2, 1, &current_section);
long ret = ov_read(&vf, (char *)p_buffer, todo * stream_channels * sizeof(int16_t), 0, 2, 1, &current_section);
#endif
if (ret < 0) {
@ -162,7 +162,7 @@ int AudioStreamPlaybackOGGVorbis::mix(int16_t *p_bufer, int p_frames) {
frames_mixed += ret;
p_bufer += ret * stream_channels;
p_buffer += ret * stream_channels;
p_frames -= ret;
}

View File

@ -103,7 +103,7 @@ public:
virtual int get_mix_rate() const { return stream_srate; }
virtual int get_minimum_buffer_size() const { return 0; }
virtual int mix(int16_t *p_bufer, int p_frames);
virtual int mix(int16_t *p_buffer, int p_frames);
AudioStreamPlaybackOGGVorbis();
~AudioStreamPlaybackOGGVorbis();

View File

@ -60,7 +60,7 @@ public:
virtual void set_audio_track(int p_idx) = 0;
//virtual int mix(int16_t* p_bufer,int p_frames)=0;
//virtual int mix(int16_t* p_buffer,int p_frames)=0;
virtual Ref<Texture> get_texture() = 0;
virtual void update(float p_delta) = 0;

View File

@ -191,12 +191,12 @@ void AudioStreamPlaybackRandomPitch::seek(float p_time) {
}
}
void AudioStreamPlaybackRandomPitch::mix(AudioFrame *p_bufer, float p_rate_scale, int p_frames) {
void AudioStreamPlaybackRandomPitch::mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) {
if (playing.is_valid()) {
playing->mix(p_bufer, p_rate_scale * pitch_scale, p_frames);
playing->mix(p_buffer, p_rate_scale * pitch_scale, p_frames);
} else {
for (int i = 0; i < p_frames; i++) {
p_bufer[i] = AudioFrame(0, 0);
p_buffer[i] = AudioFrame(0, 0);
}
}
}

View File

@ -48,7 +48,7 @@ public:
virtual float get_playback_position() const = 0;
virtual void seek(float p_time) = 0;
virtual void mix(AudioFrame *p_bufer, float p_rate_scale, int p_frames) = 0;
virtual void mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) = 0;
virtual float get_length() const = 0; //if supported, otherwise return 0
};
@ -70,7 +70,7 @@ class AudioStreamPlaybackResampled : public AudioStreamPlayback {
protected:
void _begin_resample();
virtual void _mix_internal(AudioFrame *p_bufer, int p_frames) = 0;
virtual void _mix_internal(AudioFrame *p_buffer, int p_frames) = 0;
virtual float get_stream_sampling_rate() = 0;
public:
@ -136,7 +136,7 @@ public:
virtual float get_playback_position() const;
virtual void seek(float p_time);
virtual void mix(AudioFrame *p_bufer, float p_rate_scale, int p_frames);
virtual void mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames);
virtual float get_length() const; //if supported, otherwise return 0

View File

@ -281,7 +281,7 @@ class VisualServerRaster : public VisualServer {
Set<Instance*> owned_instances;
BakedLightSampler *sampler;
int resolution;
Vector<Color> light_bufer;
Vector<Color> light_buffer;
RID sampled_light;
uint64_t last_pass;
Transform xform; // viewspace normal to lightspace, might not use one.