CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/Core/HLE/sceAudio.h
Views: 1401
// 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 };2829#define SCE_ERROR_AUDIO_CHANNEL_NOT_INIT 0x8026000130#define SCE_ERROR_AUDIO_CHANNEL_BUSY 0x8026000231#define SCE_ERROR_AUDIO_INVALID_CHANNEL 0x8026000332#define SCE_ERROR_AUDIO_PRIV_REQUIRED 0x8026000433#define SCE_ERROR_AUDIO_NO_CHANNELS_AVAILABLE 0x8026000534#define SCE_ERROR_AUDIO_OUTPUT_SAMPLE_DATA_SIZE_NOT_ALIGNED 0x8026000635#define SCE_ERROR_AUDIO_INVALID_FORMAT 0x8026000736#define SCE_ERROR_AUDIO_CHANNEL_NOT_RESERVED 0x8026000837#define SCE_ERROR_AUDIO_NOT_OUTPUT 0x8026000938#define SCE_ERROR_AUDIO_INVALID_FREQUENCY 0x8026000A39#define SCE_ERROR_AUDIO_INVALID_VOLUME 0x8026000B40#define SCE_ERROR_AUDIO_CHANNEL_ALREADY_RESERVED 0x80268002414243const u32 PSP_AUDIO_CHANNEL_MAX = 8;4445const int PSP_AUDIO_CHANNEL_SRC = 8;46const int PSP_AUDIO_CHANNEL_OUTPUT2 = 8;47const int PSP_AUDIO_CHANNEL_VAUDIO = 8;4849struct AudioChannelWaitInfo {50SceUID threadID;51int numSamples;52};5354struct AudioChannel {55int index = 0;56bool reserved = false;5758// last sample address59u32 sampleAddress = 0;60u32 sampleCount = 0; // Number of samples written in each OutputBlocking61u32 leftVolume = 0;62u32 rightVolume = 0;63u32 format = 0;6465std::vector<AudioChannelWaitInfo> waitingThreads;6667void DoState(PointerWrap &p);6869void reset();70void clear();71};7273// The extra channel is for SRC/Output2/Vaudio (who all share, apparently.)74extern AudioChannel chans[PSP_AUDIO_CHANNEL_MAX + 1];7576void Register_sceAudio();77787980