pspsdk-1.0+beta2
pspaudiolib.h
Go to the documentation of this file.
1 /*
2  * PSP Software Development Kit - http://www.pspdev.org
3  * -----------------------------------------------------------------------
4  * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5  *
6  * pspaudiolib.h - Audio library build on top of sceAudio, but to provide
7  * multiple thread usage and callbacks.
8  *
9  * Copyright (c) 2005 Adresd
10  * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
11  *
12  * $Id: pspaudiolib.h 1874 2006-04-18 13:20:58Z tyranid $
13  */
14 #ifndef __AUDIOLIB_H__
15 #define __AUDIOLIB_H__
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 #define PSP_NUM_AUDIO_CHANNELS 4
22 
24 #define PSP_NUM_AUDIO_SAMPLES 1024
25 #define PSP_VOLUME_MAX 0x8000
26 
27 typedef void (* pspAudioCallback_t)(void *buf, unsigned int reqn, void *pdata);
28 
29 typedef struct {
31  int handle;
35  void *pdata;
37 
38 typedef int (* pspAudioThreadfunc_t)(int args, void *argp);
39 
40 int pspAudioInit();
41 void pspAudioEndPre();
42 void pspAudioEnd();
43 
44 void pspAudioSetVolume(int channel, int left, int right);
45 void pspAudioChannelThreadCallback(int channel, void *buf, unsigned int reqn);
46 void pspAudioSetChannelCallback(int channel, pspAudioCallback_t callback, void *pdata);
47 int pspAudioOutBlocking(unsigned int channel, unsigned int vol1, unsigned int vol2, void *buf);
48 
49 #ifdef __cplusplus
50 }
51 #endif
52 
53 #endif