Repository navigation
Expand file tree
/
Copy pathAudioOut2System.cpp
More file actions
46 lines (36 loc) · 1.54 KB
/
Copy pathAudioOut2System.cpp
File metadata and controls
46 lines (36 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <atomic>
#include <cstdint>
#include "SceTypes.hpp"
#include "prx/libc/include/General.hpp"
#include "AudioOut2Internal.hpp"
static constexpr std::uint32_t MAX_SUPPORTED_3D_OUTPUT = 2;
static constexpr int SCE_AUDIO_OUT2_ERROR_INVALID_PARAM = static_cast<int>(0x80268001);
static std::atomic<bool> g_chatEnabled{false};
extern "C" {
int APS5_VABI sceAudioOut2Initialize(void) {
return 0;
}
int APS5_VABI sceAudioOut2Set3DLatency(int userId, std::uint32_t output) {
(void)userId;
if (output > MAX_SUPPORTED_3D_OUTPUT) return SCE_AUDIO_OUT2_ERROR_INVALID_PARAM;
return 0;
}
int APS5_VABI sceAudioOut2GetSystemState(AudioOut2SystemState* state) {
if (!state) return static_cast<int>(0x80260502);
state->loudness = 0.0f;
return 0;
}
int APS5_VABI sceAudioOut2SetSystemDebugState(const AudioOut2SystemDebugStateParam* param) {
if (param == nullptr) return static_cast<int>(0x80260502);
AUDIOOUT2_TRACE("t=%.3f SetSystemDebugState: debug state %u recorded; the host has no system mix to apply it to\n", AudioOut2TraceSeconds(), param->debug_state_id);
return 0;
}
int APS5_VABI sceAudioOut2EnableChat(void) {
if (!g_chatEnabled.exchange(true)) AUDIOOUT2_TRACE("t=%.3f EnableChat: chat audio is allowed alongside the title's; the host mixes no chat audio\n", AudioOut2TraceSeconds());
return 0;
}
int APS5_VABI sceAudioOut2DisableChat(void) {
if (g_chatEnabled.exchange(false)) AUDIOOUT2_TRACE("t=%.3f DisableChat: chat audio is no longer allowed alongside the title's\n", AudioOut2TraceSeconds());
return 0;
}
}