瀏覽代碼

[raudio] Implement GetMasterVolume() (#3434)

It feels a little unfinished when you can SetMasterVolume but can't
really Get it. So to finish the symmetry here is the GetMasterVolume
implementation.
pull/3438/head
Alexey Kutepov 1 年之前
committed by GitHub
父節點
當前提交
d7d04a07a2
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 2 個檔案被更改,包括 9 行新增0 行删除
  1. +8
    -0
      src/raudio.c
  2. +1
    -0
      src/raylib.h

+ 8
- 0
src/raudio.c 查看文件

@ -536,6 +536,14 @@ void SetMasterVolume(float volume)
ma_device_set_master_volume(&AUDIO.System.device, volume);
}
// Get master volume (listener)
float GetMasterVolume(void)
{
float volume = 0.0f;
ma_device_get_master_volume(&AUDIO.System.device, &volume);
return volume;
}
//----------------------------------------------------------------------------------
// Module Functions Definition - Audio Buffer management
//----------------------------------------------------------------------------------

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

@ -1538,6 +1538,7 @@ RLAPI void InitAudioDevice(void); // Initial
RLAPI void CloseAudioDevice(void); // Close the audio device and context
RLAPI bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully
RLAPI void SetMasterVolume(float volume); // Set master volume (listener)
RLAPI float GetMasterVolume(void); // Get master volume (listener)
// Wave/Sound loading/unloading functions
RLAPI Wave LoadWave(const char *fileName); // Load wave data from file

Loading…
取消
儲存