Mercurial > sdl-ios-xcode
annotate src/audio/nds/SDL_ndsaudio.c @ 2689:e065c9f6a393 gsoc2008_nds
Some audio work, setting default frequency, volume, etc. and calling a generic playback function that uses them.
author | Darren Alton <dalton@stevens.edu> |
---|---|
date | Fri, 15 Aug 2008 10:44:31 +0000 |
parents | 2190b873ff00 |
children | c9121b04cffa |
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 |
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
|
34 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
|
35 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
|
36 { |
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
|
37 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
|
38 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
|
39 |
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 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
|
41 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
|
42 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
|
43 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
|
44 } |
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 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
|
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 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
|
48 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
|
49 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
|
50 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
|
51 /*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
|
52 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
|
53 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
|
54 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
|
55 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
|
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 } |
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 } |
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 |
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 /* 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
|
61 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
|
62 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
|
63 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
|
64 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
|
65 |
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 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
|
67 } |
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
|
68 |
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
|
69 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
|
70 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
|
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 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
|
73 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
|
74 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
|
75 } |
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
|
76 |
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
|
77 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
|
78 |
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
|
79 // 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
|
80 // 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
|
81 // 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
|
82 // 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
|
83 // 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
|
84 // 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
|
85 // 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
|
86 } |
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
|
87 |
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
|
88 |
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
|
89 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
|
90 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
|
91 { /* is this 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
|
92 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
|
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 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
|
96 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
|
97 { |
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
|
98 /* stub */ |
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
|
99 } |
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 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
|
102 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
|
103 { |
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 /* stub */ |
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 } |
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
|
106 |
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 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
|
108 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
|
109 { |
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 /* 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
|
111 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
|
112 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
|
113 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
|
114 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
|
115 impl->CloseDevice = NDSAUD_CloseDevice; |
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 impl->OnlyHasDefaultOutputDevice = 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
|
117 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
|
118 } |
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
|
119 |
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
|
120 AudioBootStrap NDSAUD_bootstrap = { |
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 "nds", "SDL NDS audio driver", NDSAUD_Init, 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
|
122 }; |
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 |
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 /* vi: set ts=4 sw=4 expandtab: */ |