@@ -67,7 +67,10 @@ const ALCchar* alcGetString(ALCdevice* device, ALCenum param)
6767ALCdevice* alcOpenDevice (const ALCchar* devicename)
6868{
6969 ALCdevice* alcDevice = new ALCdevice;
70- strncpy (alcDevice->deviceName , devicename, 255 );
70+ if (devicename)
71+ {
72+ strncpy (alcDevice->deviceName , devicename, 255 );
73+ }
7174 return alcDevice;
7275}
7376
@@ -79,6 +82,7 @@ ALCcontext* alcCreateContext(const ALCdevice* device, const ALCint* attrlist)
7982 }
8083
8184 ALCint freq = 22050 ;
85+ ALCint monoSources = 32 ;
8286
8387 if (attrlist)
8488 {
@@ -89,6 +93,9 @@ ALCcontext* alcCreateContext(const ALCdevice* device, const ALCint* attrlist)
8993 case ALC_FREQUENCY:
9094 freq = attrlist[i * 2 + 1 ];
9195 break ;
96+ case ALC_MONO_SOURCES:
97+ monoSources = attrlist[i * 2 + 1 ];
98+ break ;
9299 default :
93100 break ;
94101 }
@@ -108,7 +115,7 @@ ALCcontext* alcCreateContext(const ALCdevice* device, const ALCint* attrlist)
108115 }
109116 else if (strcmp (device->deviceName , " gus" ) == 0 )
110117 {
111- alcContext->minialInterface = new MinialGUS ();
118+ alcContext->minialInterface = new MinialGUS (monoSources );
112119 }
113120 else
114121 {
@@ -120,6 +127,7 @@ ALCcontext* alcCreateContext(const ALCdevice* device, const ALCint* attrlist)
120127 {
121128 if (!alcContext->minialInterface ->valid ())
122129 {
130+ printf (" a%d\n " , __LINE__);
123131 delete alcContext->minialInterface ;
124132 delete alcContext;
125133 return 0 ;
@@ -228,6 +236,12 @@ void alSourcePlay(ALuint source)
228236 minialInterface->SourcePlay (source);
229237}
230238
239+ void alSourcePause (ALuint source)
240+ {
241+ if (minialInterface)
242+ minialInterface->SourcePause (source);
243+ }
244+
231245void alSourceStop (ALuint source)
232246{
233247 if (minialInterface)
@@ -248,3 +262,47 @@ ALint alGetInteger(ALenum param)
248262 }
249263 return -1 ;
250264}
265+
266+ void alGetSourcef (ALuint source, ALenum param, ALfloat* value)
267+ {
268+ if (minialInterface)
269+ {
270+ return minialInterface->GetSourcef (source, param, value);
271+ }
272+ }
273+
274+ ALenum alGetError (void )
275+ {
276+ if (minialInterface)
277+ {
278+ return minialInterface->GetError ();
279+ }
280+ else
281+ {
282+ return AL_NO_ERROR;
283+ }
284+ }
285+
286+ void alListenerf (ALenum param, ALfloat value)
287+ {
288+ if (minialInterface)
289+ {
290+ return minialInterface->Listenerf (param, value);
291+ }
292+ }
293+
294+ void alGetSourcei (ALuint source, ALenum param, ALint *value)
295+ {
296+ if (minialInterface)
297+ {
298+ return minialInterface->GetSourcei (source, param, value);
299+ }
300+ }
301+
302+ void alGetListenerf (ALenum param, ALfloat *value)
303+ {
304+ if (minialInterface)
305+ {
306+ return minialInterface->GetListenerf (param, value);
307+ }
308+ }
0 commit comments