Review formating
This commit is contained in:
parent
5ac07122bd
commit
15b36e04b2
2 changed files with 16 additions and 15 deletions
21
src/raudio.c
21
src/raudio.c
|
@ -317,7 +317,7 @@ struct rAudioBuffer {
|
||||||
|
|
||||||
float volume; // Audio buffer volume
|
float volume; // Audio buffer volume
|
||||||
float pitch; // Audio buffer pitch
|
float pitch; // Audio buffer pitch
|
||||||
float pan; // Audio buffer pan (0 to 1)
|
float pan; // Audio buffer pan (0.0f to 1.0f)
|
||||||
|
|
||||||
bool playing; // Audio buffer state: AUDIO_PLAYING
|
bool playing; // Audio buffer state: AUDIO_PLAYING
|
||||||
bool paused; // Audio buffer state: AUDIO_PAUSED
|
bool paused; // Audio buffer state: AUDIO_PAUSED
|
||||||
|
@ -398,8 +398,8 @@ void StopAudioBuffer(AudioBuffer *buffer);
|
||||||
void PauseAudioBuffer(AudioBuffer *buffer);
|
void PauseAudioBuffer(AudioBuffer *buffer);
|
||||||
void ResumeAudioBuffer(AudioBuffer *buffer);
|
void ResumeAudioBuffer(AudioBuffer *buffer);
|
||||||
void SetAudioBufferVolume(AudioBuffer *buffer, float volume);
|
void SetAudioBufferVolume(AudioBuffer *buffer, float volume);
|
||||||
void SetAudioBufferPan(AudioBuffer *buffer, float pan);
|
|
||||||
void SetAudioBufferPitch(AudioBuffer *buffer, float pitch);
|
void SetAudioBufferPitch(AudioBuffer *buffer, float pitch);
|
||||||
|
void SetAudioBufferPan(AudioBuffer *buffer, float pan);
|
||||||
void TrackAudioBuffer(AudioBuffer *buffer);
|
void TrackAudioBuffer(AudioBuffer *buffer);
|
||||||
void UntrackAudioBuffer(AudioBuffer *buffer);
|
void UntrackAudioBuffer(AudioBuffer *buffer);
|
||||||
|
|
||||||
|
@ -645,12 +645,6 @@ void SetAudioBufferVolume(AudioBuffer *buffer, float volume)
|
||||||
if (buffer != NULL) buffer->volume = volume;
|
if (buffer != NULL) buffer->volume = volume;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set pan for an audio buffer
|
|
||||||
void SetAudioBufferPan(AudioBuffer *buffer, float pan)
|
|
||||||
{
|
|
||||||
if (buffer != NULL) buffer->pan = pan;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set pitch for an audio buffer
|
// Set pitch for an audio buffer
|
||||||
void SetAudioBufferPitch(AudioBuffer *buffer, float pitch)
|
void SetAudioBufferPitch(AudioBuffer *buffer, float pitch)
|
||||||
{
|
{
|
||||||
|
@ -667,6 +661,15 @@ void SetAudioBufferPitch(AudioBuffer *buffer, float pitch)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set pan for an audio buffer
|
||||||
|
void SetAudioBufferPan(AudioBuffer *buffer, float pan)
|
||||||
|
{
|
||||||
|
if (pan < 0.0f) pan = 0.0f;
|
||||||
|
else if (pan > 1.0f) pan = 1.0f;
|
||||||
|
|
||||||
|
if (buffer != NULL) buffer->pan = pan;
|
||||||
|
}
|
||||||
|
|
||||||
// Track audio buffer to linked list next position
|
// Track audio buffer to linked list next position
|
||||||
void TrackAudioBuffer(AudioBuffer *buffer)
|
void TrackAudioBuffer(AudioBuffer *buffer)
|
||||||
{
|
{
|
||||||
|
@ -2016,11 +2019,9 @@ void SetAudioStreamPitch(AudioStream stream, float pitch)
|
||||||
// Set pan for audio stream
|
// Set pan for audio stream
|
||||||
void SetAudioStreamPan(AudioStream stream, float pan)
|
void SetAudioStreamPan(AudioStream stream, float pan)
|
||||||
{
|
{
|
||||||
if (pan < 0.0f) pan = 0.0f; else if (pan > 1.0f) pan = 1.0f;
|
|
||||||
SetAudioBufferPan(stream.buffer, pan);
|
SetAudioBufferPan(stream.buffer, pan);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Default size for new audio streams
|
// Default size for new audio streams
|
||||||
void SetAudioStreamBufferSizeDefault(int size)
|
void SetAudioStreamBufferSizeDefault(int size)
|
||||||
{
|
{
|
||||||
|
|
10
src/raylib.h
10
src/raylib.h
|
@ -1498,12 +1498,12 @@ RLAPI void StopSoundMulti(void); // Stop an
|
||||||
RLAPI int GetSoundsPlaying(void); // Get number of sounds playing in the multichannel
|
RLAPI int GetSoundsPlaying(void); // Get number of sounds playing in the multichannel
|
||||||
RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing
|
RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing
|
||||||
RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level)
|
RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level)
|
||||||
RLAPI void SetSoundPan(Sound sound, float pan); // Set pan for a sound (0.5 = center)
|
|
||||||
RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level)
|
RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level)
|
||||||
RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format
|
RLAPI void SetSoundPan(Sound sound, float pan); // Set pan for a sound (0.5 is center)
|
||||||
RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave
|
RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave
|
||||||
RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range
|
RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range
|
||||||
RLAPI float *LoadWaveSamples(Wave wave); // Load samples data from wave as a floats array
|
RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format
|
||||||
|
RLAPI float *LoadWaveSamples(Wave wave); // Load samples data from wave as a 32bit float data array
|
||||||
RLAPI void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples()
|
RLAPI void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples()
|
||||||
|
|
||||||
// Music management functions
|
// Music management functions
|
||||||
|
@ -1518,8 +1518,8 @@ RLAPI void PauseMusicStream(Music music); // Pause m
|
||||||
RLAPI void ResumeMusicStream(Music music); // Resume playing paused music
|
RLAPI void ResumeMusicStream(Music music); // Resume playing paused music
|
||||||
RLAPI void SeekMusicStream(Music music, float position); // Seek music to a position (in seconds)
|
RLAPI void SeekMusicStream(Music music, float position); // Seek music to a position (in seconds)
|
||||||
RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level)
|
RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level)
|
||||||
RLAPI void SetMusicPan(Music music, float pan); // Set pan for a music (0.5 = center)
|
|
||||||
RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level)
|
RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level)
|
||||||
|
RLAPI void SetMusicPan(Music music, float pan); // Set pan for a music (0.5 is center)
|
||||||
RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds)
|
RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds)
|
||||||
RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds)
|
RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds)
|
||||||
|
|
||||||
|
@ -1535,7 +1535,7 @@ RLAPI bool IsAudioStreamPlaying(AudioStream stream); // Check i
|
||||||
RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream
|
RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream
|
||||||
RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level)
|
RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level)
|
||||||
RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level)
|
RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level)
|
||||||
RLAPI void SetAudioStreamPan(AudioStream stream, float pan); // Set pan for audio stream (0.5 = centered)
|
RLAPI void SetAudioStreamPan(AudioStream stream, float pan); // Set pan for audio stream (0.5 is centered)
|
||||||
RLAPI void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams
|
RLAPI void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue