diff --git a/configure.ac b/configure.ac index d4c70e91..941aba2b 100644 --- a/configure.ac +++ b/configure.ac @@ -114,8 +114,7 @@ fi if test "x$enable_sound" = "xpulseaudio"; then PKG_CHECK_MODULES(PA, libpulse, - AC_DEFINE(HAVE_SOUND, 1, [Sound support]) - AC_DEFINE(HAVE_SOUND_PA, 1, [PulseAudio sound support]), + AC_DEFINE(USE_SOUND_PULSE, 1, [PulseAudio sound support]), enable_sound=no) fi AM_CONDITIONAL(USE_LIBPA, test "x$enable_sound" = "xpulseaudio") @@ -126,8 +125,7 @@ if test "x$enable_sound" = "xesound"; then AC_MSG_WARN([EsounD sound support was requested but not found.]) ]) if test "x$enable_sound" = "xesound"; then - AC_DEFINE(HAVE_SOUND, 1, [Sound support]) - AC_DEFINE(HAVE_SOUND_ESD, 1, [EsounD sound support]) + AC_DEFINE(USE_SOUND_ESD, 1, [EsounD sound support]) fi fi AM_CONDITIONAL(USE_LIBESD, test "x$enable_sound" = "xesound") @@ -138,16 +136,19 @@ if test "x$enable_sound" = "xsndio"; then AC_CHECK_LIB(sndio, sio_open, SNDIO_LIBS="-lsndio", enable_sound=no) AC_SUBST(SNDIO_LIBS) if test "x$enable_sound" = "xsndio"; then - AC_DEFINE(HAVE_SOUND, 1, [Sound support]) - AC_DEFINE(HAVE_SOUND_SNDIO, 1, [Sndio sound support]) - enable_sound=sndio + AC_DEFINE(USE_SOUND_SNDIO, 1, [Sndio sound support]) fi fi AM_CONDITIONAL(USE_LIBSNDIO, test "x$enable_sound" = "xsndio") -if test "x$enable_sound" != "xno" -a "x$with_sndldr" = "xnone"; then - AC_MSG_ERROR([Sound support requires a sound loader]) -fi +case x$enable_sound in +xpulseaudio|xesound|xsndio) + if test "x$with_sndldr" = "xnone"; then + AC_MSG_ERROR([Sound support requires a sound loader]) + fi + AC_DEFINE(ENABLE_SOUND, 1, [Sound support]) + ;; +esac # Save CPPFLAGS/LDFLAGS and add X_... to each SAVE_CPPFLAGS="$CPPFLAGS" diff --git a/src/ipc.c b/src/ipc.c index b9a094bf..5c7bcfed 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors - * Copyright (C) 2004-2019 Kim Woelders + * Copyright (C) 2004-2020 Kim Woelders * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -1508,7 +1508,7 @@ IPC_Compat(const char *params) _("composite")); } #endif -#if !HAVE_SOUND +#if !ENABLE_SOUND else if (!strcmp(param1, "sound")) { DialogOK(_("Message"), _("e16 was built without %s support"), diff --git a/src/mod-misc.c b/src/mod-misc.c index 0a8b8478..131d84d1 100644 --- a/src/mod-misc.c +++ b/src/mod-misc.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2018 Kim Woelders + * Copyright (C) 2003-2020 Kim Woelders * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -57,7 +57,7 @@ extern const EModule ModMisc; extern const EModule ModPagers; extern const EModule ModSlideouts; -#if HAVE_SOUND +#if ENABLE_SOUND extern const EModule ModSound; #endif extern const EModule ModTextclass; @@ -91,7 +91,7 @@ const EModule *const p_modules[] = { &ModMisc, &ModPagers, &ModSlideouts, -#if HAVE_SOUND +#if ENABLE_SOUND &ModSound, #endif &ModTextclass, diff --git a/src/settings.c b/src/settings.c index cfd8fddc..dfa34c08 100644 --- a/src/settings.c +++ b/src/settings.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors - * Copyright (C) 2004-2019 Kim Woelders + * Copyright (C) 2004-2020 Kim Woelders * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -697,7 +697,7 @@ static const DialogDef *const dialogs[] = { &DlgPagers, &DlgMenus, &DlgTooltips, -#if HAVE_SOUND +#if ENABLE_SOUND &DlgSound, #endif &DlgGroupDefaults, diff --git a/src/sound.c b/src/sound.c index 2433f6a0..cbe9e78f 100644 --- a/src/sound.c +++ b/src/sound.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors - * Copyright (C) 2004-2018 Kim Woelders + * Copyright (C) 2004-2020 Kim Woelders * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -22,7 +22,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "E.h" -#if HAVE_SOUND +#if ENABLE_SOUND #include "dialog.h" #include "emodule.h" #include "list.h" @@ -30,11 +30,11 @@ #include "sound.h" #include "sounds.h" -#if HAVE_SOUND_ESD +#if USE_SOUND_ESD #define SOUND_SERVER_NAME "esd" -#elif HAVE_SOUND_PA +#elif USE_SOUND_PULSE #define SOUND_SERVER_NAME "pulseaudio" -#elif HAVE_SOUND_SNDIO +#elif USE_SOUND_SNDIO #define SOUND_SERVER_NAME "sndio" #else #error Invalid sound configuration @@ -69,13 +69,13 @@ static LIST_HEAD(sound_list); #if USE_MODULES static const SoundOps *ops = NULL; #else -#if HAVE_SOUND_ESD +#if USE_SOUND_ESD extern const SoundOps SoundOps_esd; static const SoundOps *ops = &SoundOps_esd; -#elif HAVE_SOUND_PA +#elif USE_SOUND_PULSE extern const SoundOps SoundOps_pa; static const SoundOps *ops = &SoundOps_pa; -#elif HAVE_SOUND_SNDIO +#elif USE_SOUND_SNDIO extern const SoundOps SoundOps_sndio; static const SoundOps *ops = &SoundOps_sndio; #endif @@ -299,9 +299,9 @@ SoundInit(void) err = -1; #if USE_MODULES if (!ops) -#if HAVE_SOUND_ESD +#if USE_SOUND_ESD ops = ModLoadSym("sound", "SoundOps", "esd"); -#elif HAVE_SOUND_PA +#elif USE_SOUND_PULSE ops = ModLoadSym("sound", "SoundOps", "pa"); #endif #endif @@ -565,4 +565,4 @@ const EModule ModSound = { {N_CFG_ITEMS, SoundCfgItems} }; -#endif /* HAVE_SOUND */ +#endif /* ENABLE_SOUND */ diff --git a/src/sound_esd.c b/src/sound_esd.c index 46426aa2..28c67717 100644 --- a/src/sound_esd.c +++ b/src/sound_esd.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors - * Copyright (C) 2004-2018 Kim Woelders + * Copyright (C) 2004-2020 Kim Woelders * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -22,7 +22,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "E.h" -#if defined(HAVE_SOUND) && defined(HAVE_SOUND_ESD) +#if defined(ENABLE_SOUND) && defined(USE_SOUND_ESD) #include "sound.h" #include @@ -147,4 +147,4 @@ const SoundOps SoundOps_esd = { _sound_esd_Play, }; -#endif /* HAVE_SOUND && HAVE_SOUND_ESD */ +#endif /* ENABLE_SOUND && USE_SOUND_ESD */ diff --git a/src/sound_load.c b/src/sound_load.c index 3217e2b8..62657d4a 100644 --- a/src/sound_load.c +++ b/src/sound_load.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors - * Copyright (C) 2004-2018 Kim Woelders + * Copyright (C) 2004-2020 Kim Woelders * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -23,7 +23,7 @@ */ #include "E.h" -#if HAVE_SOUND +#if ENABLE_SOUND #include "sound.h" #if USE_SOUND_LOADER_AUDIOFILE @@ -122,4 +122,4 @@ SoundSampleGetData(const char *file, SoundSampleData * ssd) #endif /* USE_SOUND_LOADER_SNDFILE */ -#endif /* HAVE_SOUND */ +#endif /* ENABLE_SOUND */ diff --git a/src/sound_pa.c b/src/sound_pa.c index d0bd7c86..7814a7fd 100644 --- a/src/sound_pa.c +++ b/src/sound_pa.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2019 Kim Woelders + * Copyright (C) 2008-2020 Kim Woelders * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "E.h" -#if defined(HAVE_SOUND) && defined(HAVE_SOUND_PA) +#if defined(ENABLE_SOUND) && defined(USE_SOUND_PULSE) #include "sound.h" #include #include @@ -354,4 +354,4 @@ const SoundOps SoundOps_pa = { _sound_pa_Play, }; -#endif /* HAVE_SOUND && HAVE_SOUND_PA */ +#endif /* ENABLE_SOUND && USE_SOUND_PULSE */ diff --git a/src/sound_sndio.c b/src/sound_sndio.c index 2f557367..0155818b 100644 --- a/src/sound_sndio.c +++ b/src/sound_sndio.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012 Jonathan Armani + * Copyright (C) 2020 Kim Woelders * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -22,7 +23,7 @@ */ #include "E.h" -#if defined(HAVE_SOUND) && defined(HAVE_SOUND_SNDIO) +#if defined(ENABLE_SOUND) && defined(USE_SOUND_SNDIO) #include "sound.h" #include @@ -125,4 +126,4 @@ const SoundOps SoundOps_sndio = { _sound_sndio_Destroy, _sound_sndio_Play, }; -#endif /* HAVE_SOUND && HAVE_SOUND_SNDIO */ +#endif /* ENABLE_SOUND && USE_SOUND_SNDIO */ diff --git a/src/sounds.h b/src/sounds.h index d96b6e3b..9323e5bb 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2010 Kim Woelders + * Copyright (C) 2008-2020 Kim Woelders * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -89,7 +89,7 @@ typedef enum { SOUND_NOT_USED } esound_e; -#if HAVE_SOUND +#if ENABLE_SOUND void SoundPlay(int sound);