[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/character.cpp server/cha...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/character.cpp server/cha... |
Date: |
Tue, 17 Jun 2008 12:34:21 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 08/06/17 12:34:20
Modified files:
. : ChangeLog
server : character.cpp character.h
Log message:
* server/character.{cpp,h}: add interface to get/set volume
of sounds associated to the character, both local and
concatenated one.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6956&r2=1.6957
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.cpp?cvsroot=gnash&r1=1.105&r2=1.106
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.h?cvsroot=gnash&r1=1.147&r2=1.148
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6956
retrieving revision 1.6957
diff -u -b -r1.6956 -r1.6957
--- ChangeLog 17 Jun 2008 12:31:42 -0000 1.6956
+++ ChangeLog 17 Jun 2008 12:34:19 -0000 1.6957
@@ -1,5 +1,11 @@
2008-06-17 Sandro Santilli <address@hidden>
+ * server/character.{cpp,h}: add interface to get/set volume
+ of sounds associated to the character, both local and
+ concatenated one.
+
+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.
Index: server/character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/character.cpp,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -b -r1.105 -r1.106
--- server/character.cpp 16 Jun 2008 07:22:20 -0000 1.105
+++ server/character.cpp 17 Jun 2008 12:34:20 -0000 1.106
@@ -76,6 +76,18 @@
return m;
}
+int
+character::getWorldVolume() const
+{
+ int volume=_volume;
+ if (m_parent != NULL)
+ {
+ volume *= (m_parent->getVolume()/100);
+ }
+
+ return volume;
+}
+
cxform
character::get_world_cxform() const
{
Index: server/character.h
===================================================================
RCS file: /sources/gnash/gnash/server/character.h,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -b -r1.147 -r1.148
--- server/character.h 2 Jun 2008 09:52:52 -0000 1.147
+++ server/character.h 17 Jun 2008 12:34:20 -0000 1.148
@@ -81,6 +81,17 @@
int m_depth;
cxform m_color_transform;
matrix m_matrix;
+
+ /// Volume control associated to this character
+ //
+ /// This is used by Sound objects
+ ///
+ /// NOTE: probably only ActionScript-referenceable characters
+ /// need this (assuming soft ref don't rebind to other
+ /// kind of characters).
+ ///
+ int _volume;
+
int m_ratio;
int m_clip_depth;
Events _event_handlers;
@@ -366,6 +377,9 @@
:
m_id(id),
m_depth(0),
+ m_color_transform(),
+ m_matrix(),
+ _volume(100),
m_ratio(0),
m_clip_depth(noClipDepthValue),
_unloaded(false),
@@ -420,12 +434,24 @@
void set_depth(int d) { m_depth = d; }
+ /// Get sound volume for this character
+ int getVolume() const { return _volume; }
+
+ /// Set sound volume for this character
+ void setVolume(int vol) { _volume=vol; }
+
+ /// Get concatenated sound volume for this character
+ int getWorldVolume() const;
+
+ /// Get local transform matrix for this character
const matrix& get_matrix() const { return m_matrix; }
+ /// Set local transform matrix for this character
void set_matrix(const matrix& m)
{
assert(m.is_valid());
- if (!(m == m_matrix)) {
+ if (!(m == m_matrix))
+ {
set_invalidated(__FILE__, __LINE__);
m_matrix = m;
}
@@ -1193,7 +1219,6 @@
};
-
} // end namespace gnash
#ifdef DEBUG_SET_INVALIDATED
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/character.cpp server/cha...,
Sandro Santilli <=