This is a multi-part message in MIME format.
--------------DFEC5305F0DCB865300A6048
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
There is a flag (EXCLUSIVE something, IIRC) involved when setting up
DirectSound, but I don’t know what SDL does with it.
Thanks for the tip - with this lead, I figured it out …
Here is a patch to SDL-1.1.7 the will enable it. Works fine now. This is a
useful feature for things other than full-screen games and should become an
option to the sound API in my view.
Ciao
Andreas–
| Andreas Schiffler aschiffler at home.com |
| Senior Systems Engineer - Deskplayer Inc., Buffalo |
| 4707 Eastwood Cres., Niagara Falls, Ont L2E 1B4, Canada |
| +1-905-371-3652 (private) - +1-905-371-8834 (work/fax) |
--------------DFEC5305F0DCB865300A6048
Content-Type: text/plain; charset=us-ascii;
name="SDL-1.1.7-relaxedsound.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename=“SDL-1.1.7-relaxedsound.patch”
diff -rbd -U 5 SDL-1.1.7-orig/configure.in SDL-1.1.7-patched/configure.in
— SDL-1.1.7-orig/configure.in Tue Feb 6 15:53:03 2001
+++ SDL-1.1.7-patched/configure.in Tue Feb 6 15:57:16 2001
@@ -134,10 +134,11 @@
[ --enable-audio Enable the audio subsystem [default=yes]],
, enable_audio=yes)
if test x$enable_audio = xyes; then
SDL_EXTRADIRS="$SDL_EXTRADIRS audio"
SDL_EXTRALIBS="$SDL_EXTRALIBS audio/libaudio.la"
- CFLAGS="$CFLAGS -DRELAXED_DX5AUDIO"
else
CFLAGS="$CFLAGS -DDISABLE_AUDIO"
fi
AC_ARG_ENABLE(video,
[ --enable-video Enable the video subsystem [default=yes]],
diff -rbd -U 5 SDL-1.1.7-orig/src/audio/windx5/SDL_dx5audio.c SDL-1.1.7-patched/src/audio/windx5/SDL_dx5audio.c
— SDL-1.1.7-orig/src/audio/windx5/SDL_dx5audio.c Tue Feb 6 15:53:03 2001
+++ SDL-1.1.7-patched/src/audio/windx5/SDL_dx5audio.c Tue Feb 6 15:52:11 2001
@@ -426,23 +426,32 @@
DSBUFFERDESC format;
DSBCAPS caps;
int numchunks;
/* Try to set primary mixing privileges */
+#ifdef RELAXED_DX5AUDIO
- result = IDirectSound_SetCooperativeLevel(sndObj, focus,
-
DSSCL_NORMAL);
+#else
result = IDirectSound_SetCooperativeLevel(sndObj, focus,
DSSCL_WRITEPRIMARY);
+#endif
if ( result != DS_OK ) {
#ifdef DEBUG_SOUND
SetDSerror(“DirectSound SetCooperativeLevel”, result);
#endif
return(-1);
}
/* Try to create the primary buffer */
memset(&format, 0, sizeof(format));
format.dwSize = sizeof(format);
+#ifdef RELAXED_DX5AUDIO
-
format.dwFlags=(DSBCAPS_PRIMARYBUFFER|DSBCAPS_GETCURRENTPOSITION2|DSBCAPS_GLOBALFOCUS);
+#else
format.dwFlags=(DSBCAPS_PRIMARYBUFFER|DSBCAPS_GETCURRENTPOSITION2);
+#endif
#ifdef USE_POSITION_NOTIFY
format.dwFlags |= DSBCAPS_CTRLPOSITIONNOTIFY;
#endif
result = IDirectSound_CreateSoundBuffer(sndObj, &format, sndbuf, NULL);
if ( result != DS_OK ) {
@@ -499,12 +508,17 @@
DSBUFFERDESC format;
const int numchunks = 2;
/* Try to set primary mixing privileges */
if ( focus ) {
+#ifdef RELAXED_DX5AUDIO
-
result = IDirectSound_SetCooperativeLevel(sndObj,
-
focus, DSSCL_NORMAL);
+#else
result = IDirectSound_SetCooperativeLevel(sndObj,
focus, DSSCL_PRIORITY);
+#endif
} else {
result = IDirectSound_SetCooperativeLevel(sndObj,
GetDesktopWindow(), DSSCL_NORMAL);
}
if ( result != DS_OK ) {
@@ -515,11 +529,15 @@
}
/* Try to create the secondary buffer */
memset(&format, 0, sizeof(format));
format.dwSize = sizeof(format);
+#ifdef RELAXED_DX5AUDIO
- format.dwFlags=(DSBCAPS_GETCURRENTPOSITION2|DSBCAPS_GLOBALFOCUS);
+#else
format.dwFlags = DSBCAPS_GETCURRENTPOSITION2;
+#endif
#ifdef USE_POSITION_NOTIFY
format.dwFlags |= DSBCAPS_CTRLPOSITIONNOTIFY;
#endif
if ( ! focus ) {
format.dwFlags |= DSBCAPS_GLOBALFOCUS;
--------------DFEC5305F0DCB865300A6048–