sceAudio: Add per-channel mute checkboxes in the debugger

This commit is contained in:
Henrik Rydgård committed 2025-04-15 11:44:28 +02:00
1 parent c7f258f0ff
commit d9eab4e4a2
3 files changed
+16 -2

No files matched your search

+7 -1
View File
@@ -338,8 +338,9 @@ void __AudioUpdate(bool resetRecording) {
int16_t srcBuffer[srcBufferSize];
for (u32 i = 0; i < PSP_AUDIO_CHANNEL_MAX + 1; i++) {
if (!g_audioChans[i].reserved)
if (!g_audioChans[i].reserved) {
continue;
}
__AudioWakeThreads(g_audioChans[i], 0, hwBlockSize);
@@ -358,6 +359,11 @@ void __AudioUpdate(bool resetRecording) {
chanSampleQueues[i].popPointers(sz, &buf1, &sz1, &buf2, &sz2);
// We do this check as the very last thing before mixing, to maximize compatibility.
if (g_audioChans[i].mute) {
continue;
}
if (needsResample) {
auto read = [&](size_t i) {
if (i < sz1)
+3
View File
@@ -49,6 +49,9 @@ struct AudioChannel {
u32 rightVolume = 0;
u32 format = 0;
// For the debugger only. Not saved.
bool mute = false;
std::vector<AudioChannelWaitInfo> waitingThreads;
void DoState(PointerWrap &p);
+6 -1
View File
@@ -1245,8 +1245,9 @@ void DrawAudioChannels(ImConfig &cfg, ImControl &control) {
return;
}
if (ImGui::BeginTable("audios", 6, ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersH)) {
if (ImGui::BeginTable("audios", 7, ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersH)) {
ImGui::TableSetupColumn("Index", ImGuiTableColumnFlags_WidthFixed);
ImGui::TableSetupColumn("Mute", ImGuiTableColumnFlags_WidthFixed);
ImGui::TableSetupColumn("SampleAddr", ImGuiTableColumnFlags_WidthFixed);
ImGui::TableSetupColumn("SampleCount", ImGuiTableColumnFlags_WidthFixed);
ImGui::TableSetupColumn("Volume", ImGuiTableColumnFlags_WidthFixed);
@@ -1262,12 +1263,15 @@ void DrawAudioChannels(ImConfig &cfg, ImControl &control) {
}
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::PushID(i);
if (i == 8) {
ImGui::TextUnformatted("audio2");
} else {
ImGui::Text("%d", i);
}
ImGui::TableNextColumn();
ImGui::Checkbox("", &g_audioChans[i].mute);
ImGui::TableNextColumn();
char id[2]{};
id[0] = i + 1;
ImClickableValue(id, g_audioChans[i].sampleAddress, control, ImCmd::SHOW_IN_MEMORY_VIEWER);
@@ -1294,6 +1298,7 @@ void DrawAudioChannels(ImConfig &cfg, ImControl &control) {
ImGui::Text("%s: %d", thread->GetName(), t.numSamples);
}
}
ImGui::PopID();
}
ImGui::EndTable();