openTRI 0.1
triAudioLib.h
1/*
2 * triAudioLib.h: Header for audio library (based on pspaudiolib)
3 * This file is part of the "tri Engine".
4 *
5 * Copyright (C) 2007 tri
6 * Copyright (C) 2007 InsertWittyName <tias_dp@hotmail.com>
7 *
8 * $Id: $
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24
25#ifndef __TRIAUDIOLIB_H__
26#define __TRIAUDIOLIB_H__
27
28#include "triTypes.h"
29
34#define TRI_NUM_AUDIO_CHANNELS 4
35#define TRI_NUM_AUDIO_SAMPLES 1024
36#define TRI_VOLUME_MAX 0x8000
37
38typedef triVoid (* triAudioLibCallback)(triVoid *buf, triUInt reqn, triVoid *pdata);
39
40typedef struct
41{
42 triSInt threadHandle;
43 triSInt handle;
44 triSInt volumeLeft;
45 triSInt volumeRight;
46 triAudioLibCallback callback;
47 triVoid *data;
49
57triBool triAudioLibInit(triSInt priority); // 0x12
58
63
73triVoid triAudioLibSetVolume(triSInt channel, triSInt left, triSInt right);
74
84triVoid triAudioLibSetChannelCallback(triSInt channel, triAudioLibCallback callback, triVoid *data);
85
95triSInt triAudioLibOutBlocking(triUInt channel, triUInt left, triUInt right, triVoid *data);
96
99#endif // __TRIAUDIOLIB_H__
triBool triAudioLibInit(triSInt priority)
Initialise the Audio Library.
triVoid triAudioLibSetChannelCallback(triSInt channel, triAudioLibCallback callback, triVoid *data)
Setup a callback.
triVoid triAudioLibShutdown()
Shutdown the Audio Library.
triVoid triAudioLibSetVolume(triSInt channel, triSInt left, triSInt right)
Set channel volume.
triSInt triAudioLibOutBlocking(triUInt channel, triUInt left, triUInt right, triVoid *data)
Panned Output.
Definition triAudioLib.h:41