]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_bsd.c
support more level network eyes, and make them static instead of on-stack. Now 8k...
[xonotic/darkplaces.git] / snd_bsd.c
index 0dd7186a19ef0cae7ddcfc67243b0af8cccf5153..0e927f1e8d02fa01c37dd02482c272fa374794ce 100644 (file)
--- a/snd_bsd.c
+++ b/snd_bsd.c
@@ -68,7 +68,7 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested)
        }
 
        AUDIO_INITINFO (&info);
-#ifdef AUMODE_PLAY     // NetBSD / OpenBSD 
+#ifdef AUMODE_PLAY     // NetBSD / OpenBSD
        info.mode = AUMODE_PLAY;
 #endif
        info.play.sample_rate = requested->speed;
@@ -84,15 +84,17 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested)
 #ifdef SUNOS
                info.play.encoding = AUDIO_ENCODING_LINEAR;
 #else
-#      if BYTE_ORDER == BIG_ENDIAN
+       if (mem_bigendian)
                info.play.encoding = AUDIO_ENCODING_SLINEAR_BE;
-#      else
+       else
                info.play.encoding = AUDIO_ENCODING_SLINEAR_LE;
-#      endif
 #endif
 
-       if (ioctl (audio_fd, AUDIO_SETINFO, &info) == 0)
-               break;
+       if (ioctl (audio_fd, AUDIO_SETINFO, &info) != 0)
+       {
+               Con_Printf("Can't set up the sound device (%s)\n", snddev);
+               return false;
+       }
 
        // TODO: check the parameters with AUDIO_GETINFO
        // TODO: check AUDIO_ENCODINGFLAG_EMULATED with AUDIO_GETENC
@@ -137,7 +139,7 @@ void SndSys_Submit (void)
 {
        unsigned int startoffset, factor, limit, nbframes;
        int written;
-       
+
        if (audio_fd < 0 ||
                snd_renderbuffer->startframe == snd_renderbuffer->endframe)
                return;
@@ -165,7 +167,7 @@ void SndSys_Submit (void)
                        Con_Printf("SndSys_Submit: audio can't keep up! (%u < %u)\n", written, limit * factor);
                        return;
                }
-               
+
                nbframes -= limit;
                startoffset = 0;
        }
@@ -194,7 +196,7 @@ unsigned int SndSys_GetSoundTime (void)
        if (ioctl (audio_fd, AUDIO_GETINFO, &info) < 0)
        {
                Con_Print("Error: can't get audio info\n");
-               SNDDMA_Shutdown ();
+               SndSys_Shutdown ();
                return 0;
        }
 
@@ -227,3 +229,15 @@ void SndSys_UnlockRenderBuffer (void)
 {
        // Nothing to do
 }
+
+/*
+====================
+SndSys_SendKeyEvents
+
+Send keyboard events originating from the sound system (e.g. MIDI)
+====================
+*/
+void SndSys_SendKeyEvents(void)
+{
+       // not supported
+}