gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r11155: Add support for multiple sou


From: Andrea Palmatè
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11155: Add support for multiple sound handler and not only sdl in configure file. Changed some audio files to support AmigaOS4 AHI audio
Date: Fri, 19 Jun 2009 20:46:22 +0200
User-agent: Bazaar (1.13.1)

------------------------------------------------------------
revno: 11155
committer: Andrea Palmatè <address@hidden>
branch nick: gnash
timestamp: Fri 2009-06-19 20:46:22 +0200
message:
  Add support for multiple sound handler and not only sdl in configure file. 
Changed some audio files to support AmigaOS4 AHI audio
modified:
  configure.ac
  gui/Player.cpp
  libsound/Makefile.am
  libsound/aos4/sound_handler_ahi.cpp
  libsound/sound_handler.h
=== modified file 'configure.ac'
--- a/configure.ac      2009-06-18 08:46:14 +0000
+++ b/configure.ac      2009-06-19 18:46:22 +0000
@@ -642,6 +642,25 @@
        add_renderer=agg
 )
 
+add_sound=
+build_sound_sdl=no
+build_sound_ahi=no
+AC_ARG_ENABLE(sound,
+  AC_HELP_STRING([--enable-sound=[[sdl|ahi]]], [Use the specified sound 
handler (default=sdl)]),
+     [case "${enableval}" in
+      sdl|SDL|Sdl)
+        build_sound_sdl=yes
+        add_sound="sdl"
+        ;;
+      ahi|AHI|Ahi)
+        build_sound_ahi=yes
+        add_sound="ahi"
+        ;;
+     esac],
+  build_sound_sdl=yes
+  add_sound=sdl
+)
+
 if test x$build_ogl = xyes; then
   if test x$build_fb = xyes; then
     AC_MSG_ERROR([OpenGL renderer is not supported by FB gui. Use 
--enable-renderer=AGG or --enable-gui=kde,gtk,sdl]);
@@ -1750,7 +1769,7 @@
 dnl currently unused
 dnl GNASH_PKG_FIND(ogg, [ogg.h], [decode ogg streams], ogg_stream_init)
 
-if test x$build_sdl = xyes -o x"$media_handler" = xffmpeg -o x"$media_handler" 
= xgst; then
+if test x$build_sdl = xyes -o x$build_sound_sdl = xyes; then
   GNASH_PATH_SDL
 fi
 
@@ -1993,15 +2012,19 @@
 
 AM_CONDITIONAL(HAVE_CAIRO, [test x"${CAIRO_LIBS}" != x])
 
-AM_CONDITIONAL(USE_SOUND_SDL, test x"$media_handler" = xffmpeg -o 
x"$media_handler" = xgst)
+AM_CONDITIONAL(USE_SOUND_SDL, test x$build_sound_sdl = xyes)
+AM_CONDITIONAL(USE_SOUND_AHI, test x$build_sound_ahi = xyes)
 AM_CONDITIONAL(USE_FFMPEG_ENGINE, test x"$media_handler" = xffmpeg)
 AM_CONDITIONAL(USE_GST_ENGINE, test x"$media_handler" = xgst)
 AM_CONDITIONAL(HAVE_OPENGL, test x"${OPENGL_LIBS}" != x)
 
-case "${media_handler}" in
-  ffmpeg|gst) AC_DEFINE([SOUND_SDL],  [1], [Use SDL for sound handling]) ;;
-  *)
-esac
+if test x$build_sound_sdl = xyes; then
+  AC_DEFINE([SOUND_SDL],  [1], [Use SDL for sound handling])
+fi
+
+if test x$build_sound_ahi = xyes; then
+  AC_DEFINE([SOUND_AHI],  [1], [Use AmigaOS AHI for sound handling])
+fi
 
 case "${media_handler}" in
   ffmpeg)  AC_DEFINE([USE_FFMPEG],  [1], [Use FFMPEG for media decoding]) ;;
@@ -2463,7 +2486,7 @@
 echo "        GUI toolkits supported: ${SUPPORTED_GUIS}"
 echo "        Renderers supported: ${add_renderer}"
 echo "        Media handler: "$media_handler
-echo "        Using SDL for sound handling"
+echo "        Using ${add_sound} for sound handling"
 echo "        Using $with_shm mode for shared memory"
 echo ""
 echo "Configured paths for ${build} are:"
@@ -2883,8 +2906,7 @@
 # See whether SDL is required
 need_sdl=false
 test x$build_sdl = xyes                        && need_sdl=true
-test x"$media_handler" = x"ffmpeg"     && need_sdl=true
-test x"$media_handler" = x"gst"                && need_sdl=true
+test x$build_sound_sdl = xyes  && need_sdl=true
 
 if $need_sdl; then
   if test x"$SDL_LIBS" != x; then

=== modified file 'gui/Player.cpp'
--- a/gui/Player.cpp    2009-06-15 14:53:11 +0000
+++ b/gui/Player.cpp    2009-06-19 18:46:22 +0000
@@ -189,6 +189,19 @@
             // are playing on the stage
             _soundHandler->attach_aux_streamer(silentStream, (void*) this);
         }
+#elif defined(SOUND_AHI)
+        try {
+            _soundHandler.reset(sound::create_sound_handler_aos4(_audioDump));
+        } catch (SoundException& ex) {
+            log_error(_("Could not create sound handler: %s."
+                " Will continue w/out sound."), ex.what());
+        }
+        if (! _audioDump.empty()) {
+            // add a silent stream to the audio pool so that our output file
+            // is homogenous;  we actually want silent wave data when no sounds
+            // are playing on the stage
+            _soundHandler->attach_aux_streamer(silentStream, (void*) this);
+        }
 #elif defined(SOUND_GST)
         _soundHandler.reset(media::create_sound_handler_gst());
 #else

=== modified file 'libsound/Makefile.am'
--- a/libsound/Makefile.am      2009-02-25 22:33:03 +0000
+++ b/libsound/Makefile.am      2009-06-19 18:46:22 +0000
@@ -59,7 +59,10 @@
  libgnashsound_la_SOURCES += sdl/sound_handler_sdl.cpp 
  noinst_HEADERS += sdl/sound_handler_sdl.h
 endif
-
+if USE_SOUND_AHI
+ libgnashsound_la_SOURCES += aos4/sound_handler_ahi.cpp 
+ noinst_HEADERS += aos4/sound_handler_ahi.h
+endif
 
 libgnashsound_la_LDFLAGS = -release $(VERSION)
 

=== modified file 'libsound/aos4/sound_handler_ahi.cpp'
--- a/libsound/aos4/sound_handler_ahi.cpp       2009-06-18 21:30:10 +0000
+++ b/libsound/aos4/sound_handler_ahi.cpp       2009-06-19 18:46:22 +0000
@@ -25,7 +25,7 @@
 #include "gnashconfig.h"
 #endif
 
-#include "sound_handler_sdl.h"
+#include "sound_handler_ahi.h"
 #include "SoundInfo.h"
 #include "EmbedSound.h"
 #include "AuxStream.h" // for use..

=== modified file 'libsound/sound_handler.h'
--- a/libsound/sound_handler.h  2009-06-12 10:51:04 +0000
+++ b/libsound/sound_handler.h  2009-06-19 18:46:22 +0000
@@ -571,12 +571,19 @@
 
 // TODO: move to appropriate specific sound handlers
 
+#ifdef SOUND_SDL
 /// @throw a SoundException if fails to initialize audio card.
 DSOEXPORT sound_handler* create_sound_handler_sdl();
 
 /// @throw a SoundException if fails to initialize audio card.
 DSOEXPORT sound_handler* create_sound_handler_sdl(const std::string& 
wave_file);
-    
+#elif defined(SOUND_AHI)
+/// @throw a SoundException if fails to initialize audio card.
+DSOEXPORT sound_handler* create_sound_handler_aos4();
+
+/// @throw a SoundException if fails to initialize audio card.
+DSOEXPORT sound_handler* create_sound_handler_aos4(const std::string& 
wave_file);
+#endif
 
 } // gnash.sound namespace 
 } // namespace gnash


reply via email to

[Prev in Thread] Current Thread [Next in Thread]