Build Fix -- Remove some duplicate symbol defs to appease ld.
[sxemacs] / src / media / sound.c
index 704fd59..0678fc2 100644 (file)
@@ -46,15 +46,12 @@ Lisp_Object Vsound_alist;
 Lisp_Object Vsynchronous_sounds;
 Lisp_Object Vnative_sound_only_on_console;
 Lisp_Object Q_volume, Q_pitch, Q_duration, Q_sound;
-Lisp_Object Q_device, Q_server, Q_client, Q_keep_open;
+Lisp_Object Q_server, Q_client, Q_keep_open;
 Lisp_Object Qplay_sound;
 
 #ifdef HAVE_AO_SOUND
 #include "sound-ao.h"
 #endif
-#ifdef HAVE_ARTS_SOUND
-#include "sound-arts.h"
-#endif
 #ifdef HAVE_POLYP_SOUND
 #include "sound-polyp.h"
 #endif
@@ -78,6 +75,9 @@ Lisp_Object Qplay_sound;
 #include "sound-oss.h"
 #endif
 
+/* for CHECK_NUMBER and COMPARABLEP */
+#include "ent/ent.h"
+
 Lisp_Object Qaudio_devicep;
 Lisp_Object Qaudio_jobp;
 Lisp_Object Vdefault_audio_device;
@@ -92,7 +92,7 @@ exec_sentinel(void *job, Lisp_Object, Lisp_Object, Lisp_Object);
 #include "events/worker-asyneq.h"
 
 /*****************************************************************/
-/*                     Audio Jobs                               */
+/*                     Audio Jobs                               */
 /*****************************************************************/
 /* sound-mst handler */
 \f
@@ -245,7 +245,7 @@ DEFUN("set-audio-job-sentinel", Fset_audio_job_sentinel, 2, 2, 0, /*
 Give JOB the sentinel SENTINEL; `nil' for none.
 The sentinel is called as a function whenever the stream state changes.
 
-The function should take three (optional four) arguments 
+The function should take three (optional four) arguments
   (JOB STREAM STATE &optional OLD-STATE)
 where
 - JOB is the worker job object currently coping with the stream,
@@ -272,7 +272,7 @@ If omitted DEVICE defaults to the value of `default-audio-device'.
 
 Optional third argument SENTINEL specifies a lisp function to be
 called whenever the stream state changes.  The function should
-take three (optional four) arguments 
+take three (optional four) arguments
   (JOB STREAM STATE &optional OLD-STATE)
 where
 - JOB is the worker job object currently coping with the stream,
@@ -408,8 +408,8 @@ make_audio_job(Lisp_Object stream, Lisp_Object device, Lisp_Object sentinel)
 
        aj->state = MTSTATE_UNKNOWN;
        aj->play_state = MTPSTATE_UNKNOWN;
-#ifdef EF_USE_ASYNEQ
        SXE_MUTEX_INIT(&aj->mtx);
+#ifdef EF_USE_ASYNEQ
        audio_job_queue(aj) = NULL;
 #endif
 
@@ -419,7 +419,9 @@ make_audio_job(Lisp_Object stream, Lisp_Object device, Lisp_Object sentinel)
        aj->buffer = NULL;
        aj->buffer_alloc_size = 0;
 
-       SOUND_DEBUG_AJ("created: 0x%lx\n", (long unsigned int)aj);
+       SOUND_DEBUG_AJ("created: 0x%lx stream 0x%lx device 0x%lx sentinel 0x%lx\n",
+                      (long unsigned int)aj, (long unsigned int)stream,
+                       (long unsigned int)device, (long unsigned int) sentinel);
        return aj;
 }
 
@@ -542,7 +544,7 @@ the playback volume.
        aj->queue = NULL;
 #endif
 
-       SOUND_DEBUG_AJ("calling play meth\n");
+       SOUND_DEBUG_AJ("sync calling play meth\n");
        XAUDIO_DEVICE(device)->meths->play(aj);
 
        if (!NILP(sentinel)) {
@@ -833,7 +835,7 @@ Return t if connected to NAS server for sounds on DEVICE.
 
 \f
 /*****************************************************************/
-/*                     audio device hack                        */
+/*                     audio device hack                        */
 /*****************************************************************/
 /* Indeed the console->device->frame->window structure is not what I'd call
  * applicable to audio devices. That is why this seamless fake here exists :)
@@ -857,7 +859,7 @@ audio_device_finalise(void *header, int for_disksave)
        SOUND_DEBUG_DEV("GCor asked me to finalise: 0x%lx\n",
                        (long unsigned int)ad);
 
-       if ( ad == NULL ) 
+       if ( ad == NULL )
                return;
 
        if (audio_device_data(ad) &&
@@ -883,10 +885,6 @@ audio_device_print(Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
                write_c_string("oss", printcharfun);
                break;
 
-       case ADRIVER_ARTS:
-               write_c_string("arts", printcharfun);
-               break;
-
        case ADRIVER_NAS:
                write_c_string("nas", printcharfun);
                break;
@@ -966,7 +964,7 @@ audio_device_hash (Lisp_Object obj, int SXE_UNUSED(depth))
 static const struct lrecord_description audio_device_description[] = {
        { XD_INT, offsetof(Lisp_Audio_Device, driver) },
        { XD_INT, offsetof(Lisp_Audio_Device, state) },
-        { XD_OPAQUE_PTR, offsetof(Lisp_Audio_Device, device_data) },
+       { XD_OPAQUE_PTR, offsetof(Lisp_Audio_Device, device_data) },
        { XD_END }
 };
 
@@ -1015,10 +1013,6 @@ audio_driver decode_audio_type(Lisp_Object type)
        else if (EQ(type, Qao))
                ad = ADRIVER_AO;
 #endif
-#ifdef HAVE_ARTS_SOUND
-       else if (EQ(type, Qarts))
-               ad = ADRIVER_ARTS;
-#endif
 #ifdef HAVE_JACK_SOUND
        else if (EQ(type, Qjack))
                ad = ADRIVER_JACK;
@@ -1066,10 +1060,6 @@ audio_driver decode_audio_device(Lisp_Object device)
                else if (DEVICE_CONNECTED_TO_ESD_P(d))
                        ad = ADRIVER_ESD;
 #endif
-#ifdef HAVE_ARTS_SOUND
-               else if (DEVICE_CONNECTED_TO_ARTS_P(d))
-                       ad = ADRIVER_ARTS;
-#endif
 #ifdef HAVE_ALSA_SOUND
                else if (DEVICE_CONNECTED_TO_ALSA_P(d))
                        ad = ADRIVER_ALSA;
@@ -1123,7 +1113,7 @@ DRIVER &rest DEVICE-OPTIONS
 
 Create a new device to output audio via DRIVER.
 DRIVER should be a symbol out of 'oss, 'nas, 'esd, 'pulse,
-'jack, 'alsa, 'arts or 'ao.
+'jack, 'alsa, or 'ao.
 
 The rest arguments may be used to pass options to the selected
 output driver. These should be `:keyword value' pairs.
@@ -1149,6 +1139,16 @@ Valid keywords for Pulse are:
 :sink - the name of the sink to connect to (e.g. "output")
 :source - the name of the source to record from (e.g. "mic_in")
 :client - how to call the client on the server (default "SXEmacs")
+:role - a one-word description of the "type" of media to be played
+  on the server. It can be one of:
+          "video" - for movie/video streams
+          "music" - for music streams (like mp3's, oga's etc)
+           "game" - for audio from games
+          "event" - for event sounds (this is the default)
+          "phone" - for VoIP and Instant Messaging audio
+      "animation" - for animations
+     "production" - for audio production applications
+           "a11y" - for accessibility applications
 :stream - how to call the stream on the server (e.g. "fancy-sound")
 :immediate - connect to sink immediately and keep the connection
   alive as long as the audio device exists (default `t')
@@ -1186,9 +1186,6 @@ sensible default in this order:
   - use the display specified in $DISPLAY
   - try "localhost:0.0"
 
-Valid keywords for aRts are:
-none at the moment
-
 */
       (int nargs, Lisp_Object *args))
 {
@@ -1208,11 +1205,6 @@ none at the moment
 #ifdef HAVE_NAS_SOUND
                XAUDIO_DEVICE_METHS(ad) = sound_nas;
                break;
-#endif
-       case ADRIVER_ARTS:
-#ifdef HAVE_ARTS_SOUND
-               XAUDIO_DEVICE_METHS(ad) = sound_arts;
-               break;
 #endif
        case ADRIVER_ALSA:
 #ifdef HAVE_ALSA_SOUND
@@ -1317,9 +1309,6 @@ void syms_of_sound(void)
 #ifdef HAVE_AO_SOUND
        defsymbol(&Qao, "ao");
 #endif
-#ifdef HAVE_ARTS_SOUND
-       defsymbol(&Qarts, "arts");
-#endif
 #ifdef HAVE_ALSA_SOUND
        defsymbol(&Qalsa, "alsa");
 #endif
@@ -1388,9 +1377,6 @@ void vars_of_sound(void)
 #ifdef HAVE_AO_SOUND
        Fprovide(intern("ao-sound"));
 #endif
-#ifdef HAVE_ARTS_SOUND
-       Fprovide(intern("arts-sound"));
-#endif
 #ifdef HAVE_ALSA_SOUND
        Fprovide(intern("alsa-sound"));
 #endif
@@ -1419,7 +1405,7 @@ Subsequent elements of the list are alternating keyword/value pairs:
 Keyword: Value:
 -------  -----
 sound    A string of raw sound data (deprecated), or the name of another
-         sound to play.   The symbol `t' here means use the default X beep.
+        sound to play.   The symbol `t' here means use the default X beep.
 volume   An integer from 0-100, defaulting to `bell-volume'
 pitch    If using the default X beep, the pitch (Hz) to generate.
 duration If using the default X beep, the duration (milliseconds).
@@ -1429,7 +1415,7 @@ You should probably add things to this list by calling the function
 load-sound-file.
 
 Note: SXEmacs must be built with sound support for your system.  Not all
-systems support sound. 
+systems support sound.
 Note: The pitch, duration, and volume options are available everywhere,
 but many X servers ignore the `pitch' option.