瀏覽代碼

RENAMED: IsAudioBufferProcessed() -> IsAudioStreamProcessed()

Renamed for consistency with similar functions
pull/946/head
raysan5 6 年之前
父節點
當前提交
c387bc586d
共有 3 個檔案被更改,包括 6 行新增6 行删除
  1. +1
    -1
      examples/audio/audio_raw_stream.c
  2. +4
    -4
      src/raudio.c
  3. +1
    -1
      src/raylib.h

+ 1
- 1
examples/audio/audio_raw_stream.c 查看文件

@ -99,7 +99,7 @@ int main(void)
} }
// Refill audio stream if required // Refill audio stream if required
if (IsAudioBufferProcessed(stream))
if (IsAudioStreamProcessed(stream))
{ {
// Synthesize a buffer that is exactly the requested size // Synthesize a buffer that is exactly the requested size
int writeCursor = 0; int writeCursor = 0;

+ 4
- 4
src/raudio.c 查看文件

@ -1418,7 +1418,7 @@ void UpdateMusicStream(Music music)
int samplesCount = 0; // Total size of data steamed in L+R samples for xm floats, individual L or R for ogg shorts int samplesCount = 0; // Total size of data steamed in L+R samples for xm floats, individual L or R for ogg shorts
while (IsAudioBufferProcessed(music.stream))
while (IsAudioStreamProcessed(music.stream))
{ {
if ((music.sampleLeft/music.stream.channels) >= subBufferSizeInFrames) samplesCount = subBufferSizeInFrames*music.stream.channels; if ((music.sampleLeft/music.stream.channels) >= subBufferSizeInFrames) samplesCount = subBufferSizeInFrames*music.stream.channels;
else samplesCount = music.sampleLeft; else samplesCount = music.sampleLeft;
@ -1605,7 +1605,7 @@ void CloseAudioStream(AudioStream stream)
// Update audio stream buffers with data // Update audio stream buffers with data
// NOTE 1: Only updates one buffer of the stream source: unqueue -> update -> queue // NOTE 1: Only updates one buffer of the stream source: unqueue -> update -> queue
// NOTE 2: To unqueue a buffer it needs to be processed: IsAudioBufferProcessed()
// NOTE 2: To unqueue a buffer it needs to be processed: IsAudioStreamProcessed()
void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount) void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount)
{ {
AudioBuffer *audioBuffer = stream.buffer; AudioBuffer *audioBuffer = stream.buffer;
@ -1663,11 +1663,11 @@ void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount)
} }
// Check if any audio stream buffers requires refill // Check if any audio stream buffers requires refill
bool IsAudioBufferProcessed(AudioStream stream)
bool IsAudioStreamProcessed(AudioStream stream)
{ {
if (stream.buffer == NULL) if (stream.buffer == NULL)
{ {
TraceLog(LOG_ERROR, "IsAudioBufferProcessed() : No audio buffer");
TraceLog(LOG_ERROR, "IsAudioStreamProcessed() : No audio buffer");
return false; return false;
} }

+ 1
- 1
src/raylib.h 查看文件

@ -1392,7 +1392,7 @@ RLAPI float GetMusicTimePlayed(Music music); // Get cur
RLAPI AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Init audio stream (to stream raw audio pcm data) RLAPI AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Init audio stream (to stream raw audio pcm data)
RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount); // Update audio stream buffers with data RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount); // Update audio stream buffers with data
RLAPI void CloseAudioStream(AudioStream stream); // Close audio stream and free memory RLAPI void CloseAudioStream(AudioStream stream); // Close audio stream and free memory
RLAPI bool IsAudioBufferProcessed(AudioStream stream); // Check if any audio stream buffers requires refill
RLAPI bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill
RLAPI void PlayAudioStream(AudioStream stream); // Play audio stream RLAPI void PlayAudioStream(AudioStream stream); // Play audio stream
RLAPI void PauseAudioStream(AudioStream stream); // Pause audio stream RLAPI void PauseAudioStream(AudioStream stream); // Pause audio stream
RLAPI void ResumeAudioStream(AudioStream stream); // Resume audio stream RLAPI void ResumeAudioStream(AudioStream stream); // Resume audio stream

Loading…
取消
儲存