annotate src/audio/nds/SDL_ndsaudio.c @ 2697:c9121b04cffa gsoc2008_nds

Some more work on the audio driver.
author Darren Alton <dalton@stevens.edu>
date Thu, 21 Aug 2008 12:38:21 +0000
parents e065c9f6a393
children e1da92da346c
rev   line source
2680
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
1 /*
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
3 Copyright (C) 1997-2006 Sam Lantinga
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
4
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
6 modify it under the terms of the GNU Lesser General Public
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
9
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
13 Lesser General Public License for more details.
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
14
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
15 You should have received a copy of the GNU Lesser General Public
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
16 License along with this library; if not, write to the Free Software
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
18
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
19 Sam Lantinga
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
20 slouken@libsdl.org
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
21
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
22 This file written by Ryan C. Gordon (icculus@icculus.org)
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
23 */
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
24 #include "SDL_config.h"
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
25
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
26 /* Output audio to NDS */
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
27
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
28 #include <nds.h>
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
29
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
30 #include "SDL_audio.h"
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
31 #include "../SDL_audio_c.h"
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
32 #include "SDL_ndsaudio.h"
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
33
2697
c9121b04cffa Some more work on the audio driver.
Darren Alton <dalton@stevens.edu>
parents: 2689
diff changeset
34 #define TRACE printf
c9121b04cffa Some more work on the audio driver.
Darren Alton <dalton@stevens.edu>
parents: 2689
diff changeset
35
2680
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
36 static int
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
37 NDSAUD_OpenDevice(_THIS, const char *devname, int iscapture)
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
38 {
2689
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
39 SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format);
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
40 int valid_datatype = 0;
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
41
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
42 this->hidden = SDL_malloc(sizeof(*(this->hidden)));
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
43 if(!this->hidden) {
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
44 SDL_OutOfMemory();
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
45 return 0;
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
46 }
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
47 SDL_memset(this->hidden, 0, (sizeof *this->hidden));
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
48
2697
c9121b04cffa Some more work on the audio driver.
Darren Alton <dalton@stevens.edu>
parents: 2689
diff changeset
49 TRACE("+NDSAUD_OpenDevice\n");
2689
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
50 while ((!valid_datatype) && (test_format)) {
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
51 this->spec.format = test_format;
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
52 switch (test_format) {
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
53 case AUDIO_S8:
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
54 /*case AUDIO_S16LSB:*/
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
55 valid_datatype = 1;
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
56 break;
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
57 default:
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
58 test_format = SDL_NextAudioFormat();
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
59 break;
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
60 }
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
61 }
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
62
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
63 /* set the generic sound parameters */
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
64 setGenericSound(22050, /* sample rate */
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
65 127, /* volume */
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
66 64, /* panning/balance */
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
67 0); /* sound format*/
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
68
2697
c9121b04cffa Some more work on the audio driver.
Darren Alton <dalton@stevens.edu>
parents: 2689
diff changeset
69 TRACE("-NDSAUD_OpenDevice\n");
2689
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
70 return 1;
2680
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
71 }
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
72
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
73 static void
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
74 NDSAUD_PlayDevice(_THIS)
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
75 {
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
76 TransferSoundData* sound = SDL_malloc(sizeof(TransferSoundData));
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
77 if(!sound) {
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
78 SDL_OutOfMemory();
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
79 }
2697
c9121b04cffa Some more work on the audio driver.
Darren Alton <dalton@stevens.edu>
parents: 2689
diff changeset
80 TRACE("+NDSAUD_PlayDevice\n");
2689
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
81
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
82 playGenericSound(this->hidden->mixbuf, this->hidden->mixlen);
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
83
2697
c9121b04cffa Some more work on the audio driver.
Darren Alton <dalton@stevens.edu>
parents: 2689
diff changeset
84 TRACE("-NDSAUD_PlayDevice\n");
2689
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
85 // sound->data = this->hidden->mixbuf;/* pointer to raw audio data */
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
86 // sound->len = this->hidden->mixlen; /* size of raw data pointed to above */
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
87 // sound->rate = 22050; /* sample rate = 22050Hz */
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
88 // sound->vol = 127; /* volume [0..127] for [min..max] */
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
89 // sound->pan = 64; /* balance [0..127] for [left..right] */
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
90 // sound->format = 0; /* 0 for 16-bit, 1 for 8-bit */
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
91 // playSound(sound);
2680
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
92 }
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
93
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
94
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
95 static Uint8 *
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
96 NDSAUD_GetDeviceBuf(_THIS)
2689
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
97 { /* is this right? */
2697
c9121b04cffa Some more work on the audio driver.
Darren Alton <dalton@stevens.edu>
parents: 2689
diff changeset
98 TRACE("!NDSAUD_GetDeviceBuf\n");
2689
e065c9f6a393 Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
Darren Alton <dalton@stevens.edu>
parents: 2685
diff changeset
99 return this->hidden->mixbuf;
2680
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
100 }
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
101
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
102 static void
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
103 NDSAUD_WaitDevice(_THIS)
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
104 {
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
105 /* stub */
2697
c9121b04cffa Some more work on the audio driver.
Darren Alton <dalton@stevens.edu>
parents: 2689
diff changeset
106 TRACE("!NDSAUD_WaitDevice\n");
2680
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
107 }
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
108
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
109 static void
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
110 NDSAUD_CloseDevice(_THIS)
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
111 {
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
112 /* stub */
2697
c9121b04cffa Some more work on the audio driver.
Darren Alton <dalton@stevens.edu>
parents: 2689
diff changeset
113 TRACE("!NDSAUD_CloseDevice\n");
2680
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
114 }
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
115
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
116 static int
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
117 NDSAUD_Init(SDL_AudioDriverImpl * impl)
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
118 {
2697
c9121b04cffa Some more work on the audio driver.
Darren Alton <dalton@stevens.edu>
parents: 2689
diff changeset
119 TRACE("+NDSAUD_Init\n");
c9121b04cffa Some more work on the audio driver.
Darren Alton <dalton@stevens.edu>
parents: 2689
diff changeset
120
2680
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
121 /* Set the function pointers */
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
122 impl->OpenDevice = NDSAUD_OpenDevice;
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
123 impl->PlayDevice = NDSAUD_PlayDevice;
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
124 impl->WaitDevice = NDSAUD_WaitDevice;
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
125 impl->GetDeviceBuf = NDSAUD_GetDeviceBuf;
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
126 impl->CloseDevice = NDSAUD_CloseDevice;
2697
c9121b04cffa Some more work on the audio driver.
Darren Alton <dalton@stevens.edu>
parents: 2689
diff changeset
127
c9121b04cffa Some more work on the audio driver.
Darren Alton <dalton@stevens.edu>
parents: 2689
diff changeset
128 /* and the capabilities */
c9121b04cffa Some more work on the audio driver.
Darren Alton <dalton@stevens.edu>
parents: 2689
diff changeset
129 impl->HasCaptureSupport = 1;
2680
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
130 impl->OnlyHasDefaultOutputDevice = 1;
2697
c9121b04cffa Some more work on the audio driver.
Darren Alton <dalton@stevens.edu>
parents: 2689
diff changeset
131 impl->OnlyHasDefaultInputDevice = 1;
c9121b04cffa Some more work on the audio driver.
Darren Alton <dalton@stevens.edu>
parents: 2689
diff changeset
132
c9121b04cffa Some more work on the audio driver.
Darren Alton <dalton@stevens.edu>
parents: 2689
diff changeset
133 TRACE("-NDSAUD_Init\n");
2680
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
134 return 1;
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
135 }
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
136
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
137 AudioBootStrap NDSAUD_bootstrap = {
2697
c9121b04cffa Some more work on the audio driver.
Darren Alton <dalton@stevens.edu>
parents: 2689
diff changeset
138 "nds", "SDL NDS audio driver", NDSAUD_Init, 0 /*1?*/
2680
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
139 };
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
140
4135aa9c5645 More work on the accelerated 2D video driver, beginnings of sprite-based rendering support. Also some initial work on an audio driver.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
141 /* vi: set ts=4 sw=4 expandtab: */