// Copyright (c) 2012- PPSSPP Project.12// This program is free software: you can redistribute it and/or modify3// it under the terms of the GNU General Public License as published by4// the Free Software Foundation, version 2.0 or later versions.56// This program is distributed in the hope that it will be useful,7// but WITHOUT ANY WARRANTY; without even the implied warranty of8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9// GNU General Public License 2.0 for more details.1011// A copy of the GPL 2.0 should have been included with the program.12// If not, see http://www.gnu.org/licenses/1314// Official git repository and contact information can be found at15// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.1617#pragma once1819#include <queue>2021#include "CommonTypes.h"22#include "sceKernel.h"2324class PointerWrap;2526enum PspAudioFormats { PSP_AUDIO_FORMAT_STEREO = 0, PSP_AUDIO_FORMAT_MONO = 0x10 };27enum PspAudioFrequencies { PSP_AUDIO_FREQ_44K = 44100, PSP_AUDIO_FREQ_48K = 48000 };2829const u32 PSP_AUDIO_CHANNEL_MAX = 8;3031const int PSP_AUDIO_CHANNEL_SRC = 8;32const int PSP_AUDIO_CHANNEL_OUTPUT2 = 8;33const int PSP_AUDIO_CHANNEL_VAUDIO = 8;3435struct AudioChannelWaitInfo {36SceUID threadID;37int numSamples;38};3940struct AudioChannel {41int index = 0;42bool reserved = false;4344// last sample address45u32 sampleAddress = 0;46u32 sampleCount = 0; // Number of samples written in each OutputBlocking47u32 leftVolume = 0;48u32 rightVolume = 0;49u32 format = 0;5051// For the debugger only. Not saved.52bool mute = false;5354std::vector<AudioChannelWaitInfo> waitingThreads;5556void DoState(PointerWrap &p);5758void reset();59void clear();60};6162// The extra channel is for SRC/Output2/Vaudio (who all share, apparently.)63extern AudioChannel g_audioChans[PSP_AUDIO_CHANNEL_MAX + 1];6465void Register_sceAudio();66676869