gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog libmedia/Makefile.am libmedia/s...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog libmedia/Makefile.am libmedia/s...
Date: Tue, 17 Jun 2008 12:31:44 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/06/17 12:31:43

Modified files:
        .              : ChangeLog 
        libmedia       : Makefile.am sound_handler.h 
Added files:
        libmedia       : NullSoundHandler.h 

Log message:
                * libmedia/: Makefile.am, NullSoundHandler.h, sound_handler.h:
                  Add interface to set/get final volume. Add NullSoundHandler
                  for use in gprocessor.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6955&r2=1.6956
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/Makefile.am?cvsroot=gnash&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/sound_handler.h?cvsroot=gnash&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/NullSoundHandler.h?cvsroot=gnash&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6955
retrieving revision 1.6956
diff -u -b -r1.6955 -r1.6956
--- ChangeLog   17 Jun 2008 11:34:58 -0000      1.6955
+++ ChangeLog   17 Jun 2008 12:31:42 -0000      1.6956
@@ -1,3 +1,9 @@
+2008-06-17 Sandro Santilli <address@hidden>
+
+       * libmedia/: Makefile.am, NullSoundHandler.h, sound_handler.h:
+         Add interface to set/get final volume. Add NullSoundHandler
+         for use in gprocessor.
+
 2008-06-17 Benjamin Wolsey <address@hidden>
 
        * server/vm/action_buffer.cpp: rewrite disasm_instruction so that it

Index: libmedia/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/libmedia/Makefile.am,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- libmedia/Makefile.am        9 Jun 2008 20:53:49 -0000       1.26
+++ libmedia/Makefile.am        17 Jun 2008 12:31:43 -0000      1.27
@@ -89,6 +89,7 @@
        AudioDecoderNellymoser.h \
        AudioDecoderSimple.h \
        sound_handler.h \
+       NullSoundHandler.h \
        SoundInfo.h \
        Util.h \
        $(NULL)

Index: libmedia/sound_handler.h
===================================================================
RCS file: /sources/gnash/gnash/libmedia/sound_handler.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- libmedia/sound_handler.h    11 Jun 2008 14:40:27 -0000      1.21
+++ libmedia/sound_handler.h    17 Jun 2008 12:31:43 -0000      1.22
@@ -176,6 +176,13 @@
        ///
        virtual int     get_volume(int sound_handle) = 0;
        
+       /// Get the volume to apply to mixed output
+       //
+       /// @return percent value. 100 is full, 0 is none.
+       ///        Can be negative or over 100 too.
+       ///
+       int getFinalVolume() { return _volume; }
+       
        /// Sets the volume for a given sound buffer slot.
        //
        /// Only used by the AS Sound class
@@ -190,6 +197,13 @@
        ///
        virtual void    set_volume(int sound_handle, int volume) = 0;
                
+       /// Set the volume to apply to mixed output
+       //
+       /// @param v percent value. 100 is full, 0 is none.
+       ///       Can be negative or over 100 too.
+       ///
+       void setFinalVolume(int v) { _volume=v; }
+               
        /// Remove scheduled requests to play the specified sound buffer slot
        //
        /// Stop the specified sound if it's playing.
@@ -302,7 +316,8 @@
        sound_handler()
                :
                _soundsStarted(0),
-               _soundsStopped(0)
+               _soundsStopped(0),
+               _volume(100)
        {}
 
        /// Special test-member. Stores count of started sounds.
@@ -310,6 +325,11 @@
 
        /// Special test-member. Stores count of stopped sounds.
        size_t _soundsStopped;
+
+private:
+
+       /// Final output volume
+       int _volume;
 };
 
 // TODO: move to appropriate specific sound handlers

Index: libmedia/NullSoundHandler.h
===================================================================
RCS file: libmedia/NullSoundHandler.h
diff -N libmedia/NullSoundHandler.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libmedia/NullSoundHandler.h 17 Jun 2008 12:31:43 -0000      1.1
@@ -0,0 +1,124 @@
+// NullSoundHandler - fake sound handler, for testing gnash
+// 
+//   Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+// 
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+// 
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+
+#ifndef NULL_SOUND_HANDLER_H
+#define NULL_SOUND_HANDLER_H
+
+#ifdef HAVE_CONFIG_H
+#include "gnashconfig.h"
+#endif
+
+#include "sound_handler.h" // for inheritance
+#include "dsodefs.h" // for DSOEXPORT
+
+#include <vector>
+#include <memory>
+#include <cassert>
+#include <cstring>
+
+namespace gnash {
+
+namespace media {
+
+/// Null Sound handler, for testing 
+class DSOEXPORT NullSoundHandler : public sound_handler
+{
+public:
+
+       // See dox in sound_handler.h 
+       virtual int     create_sound(
+               void*           /*data*/,
+               unsigned int    /*data_bytes*/,
+               std::auto_ptr<SoundInfo> /*sinfo*/
+               )
+       {
+               return 0;
+       }
+
+       // See dox in sound_handler.h 
+       // implement?
+       virtual long    fill_stream_data(unsigned char* /*data*/, unsigned int 
/*data_bytes*/, unsigned int /*sample_count*/, int /*handle_id*/)
+       {
+               return 0;
+       }
+
+       // See dox in sound_handler.h 
+       virtual SoundInfo* get_sound_info(int /*sound_handle*/) { return 0; }
+
+       // See dox in sound_handler.h 
+       virtual void play_sound(int /*sound_handle*/, int /*loop_count*/, int 
/*secondOffset*/, long /*start*/,
+               const std::vector<sound_envelope>* /*envelopes*/)
+       {
+       }
+
+       // See dox in sound_handler.h 
+       virtual void    stop_all_sounds() {}
+
+       // See dox in sound_handler.h 
+       // TODO: implement here
+       virtual int     get_volume(int /*sound_handle*/) { return 0; }
+
+       // See dox in sound_handler.h 
+       // TODO: implement here
+       virtual void    set_volume(int /*sound_handle*/, int /*volume*/) {}
+
+       // See dox in sound_handler.h 
+       virtual void    stop_sound(int /*sound_handle*/) {}
+               
+       // See dox in sound_handler.h 
+       virtual void    delete_sound(int /*sound_handle*/) {}
+
+       // See dox in sound_handler.h 
+       virtual void reset() {}
+               
+       // See dox in sound_handler.h (why is this virtual anyway ?)
+       virtual void    mute() {}
+
+       // See dox in sound_handler.h (why is this virtual anyway ?)
+       virtual void    unmute() {}
+
+       // See dox in sound_handler.h (why is this virtual anyway ?)
+       virtual bool    is_muted() { return false; }
+
+#ifdef USE_FFMPEG
+       // See dox in sound_handler.h
+       virtual void    attach_aux_streamer(aux_streamer_ptr /*ptr*/, void* 
/*owner*/) {}
+
+       // See dox in sound_handler.h
+       virtual void    detach_aux_streamer(void* /*udata*/) {}
+#endif
+
+       // See dox in sound_handler.h
+       virtual unsigned int get_duration(int /*sound_handle*/) { return 0; }
+
+       // See dox in sound_handler.h
+       virtual unsigned int tell(int /*sound_handle*/) { return 0; }
+
+};
+       
+} // gnash.media namespace 
+}      // namespace gnash
+
+#endif // NULL_SOUND_HANDLER_H
+
+
+// Local Variables:
+// mode: C++
+// indent-tabs-mode: t
+// End:




reply via email to

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