[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/Makefile.am server/impl....
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/Makefile.am server/impl.... |
Date: |
Fri, 23 Nov 2007 22:23:25 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/11/23 22:23:25
Modified files:
. : ChangeLog
server : Makefile.am impl.cpp
server/parser : sound_definition.cpp sound_definition.h
server/swf : tag_loaders.cpp tag_loaders.h
Added files:
server/swf : StartSoundTag.cpp StartSoundTag.h
Log message:
Moved StartSoundTag in its own file, cleaned up.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4945&r2=1.4946
http://cvs.savannah.gnu.org/viewcvs/gnash/server/Makefile.am?cvsroot=gnash&r1=1.131&r2=1.132
http://cvs.savannah.gnu.org/viewcvs/gnash/server/impl.cpp?cvsroot=gnash&r1=1.124&r2=1.125
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/sound_definition.cpp?cvsroot=gnash&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/sound_definition.h?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/tag_loaders.cpp?cvsroot=gnash&r1=1.151&r2=1.152
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/tag_loaders.h?cvsroot=gnash&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/StartSoundTag.cpp?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/StartSoundTag.h?cvsroot=gnash&rev=1.1
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4945
retrieving revision 1.4946
diff -u -b -r1.4945 -r1.4946
--- ChangeLog 23 Nov 2007 21:19:40 -0000 1.4945
+++ ChangeLog 23 Nov 2007 22:23:24 -0000 1.4946
@@ -1,3 +1,9 @@
+2007-11-23 Sandro Santilli <address@hidden>
+
+ * server/: Makefile.am, impl.cpp, parser/sound_definition.{cpp,h}
+ swf/StartSoundTag.{cpp,h}, swf/tag_loaders.{cpp,h}:
+ Moved StartSoundTag in its own file, cleaned up.
+
2007-11-23 Benjamin Wolsey <address@hidden>
* testsuite/misc-ming.all/NetStream-SquareTest: fix expected results for
Index: server/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/server/Makefile.am,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -b -r1.131 -r1.132
--- server/Makefile.am 23 Nov 2007 13:25:05 -0000 1.131
+++ server/Makefile.am 23 Nov 2007 22:23:24 -0000 1.132
@@ -18,7 +18,7 @@
#
#
-# $Id: Makefile.am,v 1.131 2007/11/23 13:25:05 strk Exp $
+# $Id: Makefile.am,v 1.132 2007/11/23 22:23:24 strk Exp $
AUTOMAKE_OPTIONS =
@@ -91,6 +91,7 @@
swf/DefineFontAlignZonesTag.cpp \
swf/PlaceObject2Tag.cpp \
swf/RemoveObjectTag.cpp \
+ swf/StartSoundTag.cpp \
swf_function.cpp \
video_stream_instance.cpp \
StreamProvider.cpp \
@@ -181,6 +182,7 @@
swf/DoActionTag.h \
swf/DoInitActionTag.h \
swf/SetBackgroundColorTag.h \
+ swf/StartSoundTag.h \
swf_event.h \
swf_function.h \
tesselate.h \
Index: server/impl.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/impl.cpp,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -b -r1.124 -r1.125
--- server/impl.cpp 23 Nov 2007 13:25:05 -0000 1.124
+++ server/impl.cpp 23 Nov 2007 22:23:24 -0000 1.125
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: impl.cpp,v 1.124 2007/11/23 13:25:05 strk Exp $ */
+/* $Id: impl.cpp,v 1.125 2007/11/23 22:23:24 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -53,6 +53,7 @@
#include "DoActionTag.h"
#include "DoInitActionTag.h"
#include "SetBackgroundColorTag.h"
+#include "StartSoundTag.h"
#include "swf/tag_loaders.h" // for all tag loaders..
#include "sound_handler.h" // for get_sound_handler
#ifdef GNASH_USE_GC
@@ -183,7 +184,7 @@
register_tag_loader(SWF::DEFINEFONTINFO, define_font_info_loader);
register_tag_loader(SWF::DEFINEFONTINFO2, define_font_info_loader); //
62
register_tag_loader(SWF::DEFINESOUND, define_sound_loader);
- register_tag_loader(SWF::STARTSOUND, start_sound_loader);
+ register_tag_loader(SWF::STARTSOUND, StartSoundTag::loader);
register_tag_loader(SWF::STOPSOUND, fixme_loader); // 16
Index: server/parser/sound_definition.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/sound_definition.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- server/parser/sound_definition.cpp 23 Nov 2007 12:21:27 -0000 1.8
+++ server/parser/sound_definition.cpp 23 Nov 2007 22:23:24 -0000 1.9
@@ -9,7 +9,7 @@
#include "sound_definition.h"
#include "stream.h"
#include "impl.h"
-#include "ControlTag.h" // for start_sound_tag inheritance
+//#include "ControlTag.h" // for start_sound_tag inheritance
#include "movie_definition.h"
#include "sprite_instance.h"
@@ -26,79 +26,6 @@
}
//
-// SWF Tag StartSound (15)
-//
-void
-start_sound_tag::read(stream* in, int /* tag_type */, movie_definition* m,
- const sound_sample* sam)
-{
- assert(sam);
-
- in->read_uint(2); // skip reserved bits.
- m_stop_playback = in->read_bit();
- bool no_multiple = in->read_bit();
- bool has_envelope = in->read_bit();
- bool has_loops = in->read_bit();
- bool has_out_point = in->read_bit();
- bool has_in_point = in->read_bit();
-
- UNUSED(no_multiple);
- UNUSED(has_envelope);
-
- uint32_t in_point = 0;
- uint32_t out_point = 0;
- if (has_in_point) { in_point = in->read_u32(); }
- if (has_out_point) { out_point = in->read_u32(); }
- if (has_loops) { m_loop_count = in->read_u16(); }
-
- if (has_envelope)
- {
- int nPoints = in->read_u8();
- m_envelopes.resize(nPoints);
- for (int i=0; i < nPoints; i++)
- {
- m_envelopes[i].m_mark44 = in->read_u32();
- m_envelopes[i].m_level0 = in->read_u16();
- m_envelopes[i].m_level1 = in->read_u16();
- }
- }
- else
- {
- m_envelopes.resize(0);
- }
-
- m_handler_id = sam->m_sound_handler_id;
- m->addControlTag(this);
-}
-
-
-void
-start_sound_tag::execute(sprite_instance* /* m */) const
-{
- // Make static ?
- sound_handler* handler = get_sound_handler();
-
- //GNASH_REPORT_FUNCTION;
-
- if (handler)
- {
- if (m_stop_playback)
- {
- handler->stop_sound(m_handler_id);
- }
- else
- {
- handler->play_sound(m_handler_id, m_loop_count, 0,0,
(m_envelopes.size() == 0 ? NULL : &m_envelopes));
- }
- }
-}
-
-void
-start_sound_tag::execute_state(sprite_instance* /* m */) const
-{
-}
-
-//
// SWF Tag SoundStreamBlock (19)
//
Index: server/parser/sound_definition.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/sound_definition.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- server/parser/sound_definition.h 23 Nov 2007 12:21:27 -0000 1.7
+++ server/parser/sound_definition.h 23 Nov 2007 22:23:25 -0000 1.8
@@ -32,6 +32,11 @@
namespace gnash {
+/// TODO: document this
+//
+/// QUESTION: why is this a resource ?
+/// does it really need to be ref-counted ?
+///
class sound_sample: public resource
{
public:
@@ -48,47 +53,6 @@
sound_sample* cast_to_sound_sample() { return this; }
};
-/// SWF Tag StartSound (15)
-//
-/// TODO: move in it's own StartSoundTag files...
-///
-class start_sound_tag : public ControlTag
-{
-public:
- uint16_t m_handler_id;
- int m_loop_count;
- bool m_stop_playback;
- std::vector<sound_handler::sound_envelope> m_envelopes;
-
- // envelopes for the current sound instance
- uint32_t* envelopes;
-
- start_sound_tag()
- :
- m_handler_id(0),
- m_loop_count(0),
- m_stop_playback(false)
- {
- }
-
-
- /// \brief
- /// Initialize this StartSound tag from
- /// the stream & given sample.
- //
- /// Insert ourself into the movie.
- void read(stream* in, int tag_type,
- movie_definition* m, const sound_sample* sam);
-
- void execute(sprite_instance* m) const;
-
- /// StartStreamSound is not a "state" tag?
- void execute_state(sprite_instance* m) const;
-
- /// TODO: provide execute_reverse ?
- /// (for StartSound would StopSound and vice-versa)
-};
-
/// SWF Tag SoundStreamBlock (19)
//
/// TODO: move in it's own SoundStreamBlockTag files...
Index: server/swf/tag_loaders.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf/tag_loaders.cpp,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -b -r1.151 -r1.152
--- server/swf/tag_loaders.cpp 23 Nov 2007 13:25:05 -0000 1.151
+++ server/swf/tag_loaders.cpp 23 Nov 2007 22:23:25 -0000 1.152
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: tag_loaders.cpp,v 1.151 2007/11/23 13:25:05 strk Exp $ */
+/* $Id: tag_loaders.cpp,v 1.152 2007/11/23 22:23:25 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1188,40 +1188,6 @@
}
}
-
-// Load a StartSound tag.
-void
-start_sound_loader(stream* in, tag_type tag, movie_definition* m)
-{
- sound_handler* handler = get_sound_handler();
-
- assert(tag == SWF::STARTSOUND); // 15
-
- uint16_t sound_id = in->read_u16();
-
- sound_sample* sam = m->get_sound_sample(sound_id);
- if (sam)
- {
- start_sound_tag* sst = new start_sound_tag();
- sst->read(in, tag, m, sam);
-
- IF_VERBOSE_PARSE
- (
- log_parse(_("start_sound tag: id=%d, stop = %d, loop ct = %d"),
- sound_id, int(sst->m_stop_playback), sst->m_loop_count);
- );
- }
- else
- {
- if (handler)
- {
- IF_VERBOSE_MALFORMED_SWF(
- log_swferror(_("start_sound_loader: sound_id %d is not
defined"), sound_id);
- );
- }
- }
-}
-
// Load a SoundStreamHead(2) tag.
void
sound_stream_head_loader(stream* in, tag_type tag, movie_definition* m)
Index: server/swf/tag_loaders.h
===================================================================
RCS file: /sources/gnash/gnash/server/swf/tag_loaders.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- server/swf/tag_loaders.h 23 Nov 2007 13:25:05 -0000 1.23
+++ server/swf/tag_loaders.h 23 Nov 2007 22:23:25 -0000 1.24
@@ -19,7 +19,7 @@
//
//
-/* $Id: tag_loaders.h,v 1.23 2007/11/23 13:25:05 strk Exp $ */
+/* $Id: tag_loaders.h,v 1.24 2007/11/23 22:23:25 strk Exp $ */
#ifndef GNASH_SWF_TAG_LOADERS_H
#define GNASH_SWF_TAG_LOADERS_H
@@ -134,9 +134,6 @@
/// Load a SWF::DEFINESOUND tag.
void define_sound_loader(stream*, tag_type, movie_definition*);
-/// Load a SWF::STARTSOUND tag.
-void start_sound_loader(stream*, tag_type, movie_definition*);
-
void button_sound_loader(stream*, tag_type, movie_definition*);
void do_init_action_loader(stream*, tag_type, movie_definition*);
Index: server/swf/StartSoundTag.cpp
===================================================================
RCS file: server/swf/StartSoundTag.cpp
diff -N server/swf/StartSoundTag.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ server/swf/StartSoundTag.cpp 23 Nov 2007 22:23:25 -0000 1.1
@@ -0,0 +1,138 @@
+// StartSoundTag.cpp: for Gnash.
+//
+// Copyright (C) 2007 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
+//
+
+/* $Id: StartSoundTag.cpp,v 1.1 2007/11/23 22:23:25 strk Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "StartSoundTag.h"
+#include "stream.h"
+#include "movie_definition.h"
+#include "log.h" // for log_parse
+#include "sound_definition.h" // for sound_sample
+
+namespace gnash {
+namespace SWF {
+
+void
+StartSoundTag::loader(stream* in, tag_type tag, movie_definition* m)
+{
+ sound_handler* handler = get_sound_handler();
+
+ assert(tag == SWF::STARTSOUND); // 15
+
+ uint16_t sound_id = in->read_u16();
+
+ sound_sample* sam = m->get_sound_sample(sound_id);
+ if (sam)
+ {
+ StartSoundTag* sst = new StartSoundTag();
+ sst->read(in, tag, m, sam);
+
+ IF_VERBOSE_PARSE
+ (
+ log_parse(_("start_sound tag: id=%d, stop = %d, loop ct = %d"),
+ sound_id, int(sst->m_stop_playback), sst->m_loop_count);
+ );
+ }
+ else
+ {
+ if (handler)
+ {
+ IF_VERBOSE_MALFORMED_SWF(
+ log_swferror(_("start_sound_loader: sound_id %d is not
defined"), sound_id);
+ );
+ }
+ }
+}
+
+void
+StartSoundTag::read(stream* in, int /* tag_type */, movie_definition* m,
+ const sound_sample* sam)
+{
+ assert(sam);
+
+ in->read_uint(2); // skip reserved bits.
+ m_stop_playback = in->read_bit();
+ bool no_multiple = in->read_bit();
+ bool has_envelope = in->read_bit();
+ bool has_loops = in->read_bit();
+ bool has_out_point = in->read_bit();
+ bool has_in_point = in->read_bit();
+
+ UNUSED(no_multiple);
+ UNUSED(has_envelope);
+
+ uint32_t in_point = 0;
+ uint32_t out_point = 0;
+ if (has_in_point) { in_point = in->read_u32(); }
+ if (has_out_point) { out_point = in->read_u32(); }
+ if (has_loops) { m_loop_count = in->read_u16(); }
+
+ if (has_envelope)
+ {
+ int nPoints = in->read_u8();
+ m_envelopes.resize(nPoints);
+ for (int i=0; i < nPoints; i++)
+ {
+ m_envelopes[i].m_mark44 = in->read_u32();
+ m_envelopes[i].m_level0 = in->read_u16();
+ m_envelopes[i].m_level1 = in->read_u16();
+ }
+ }
+ else
+ {
+ m_envelopes.resize(0);
+ }
+
+ m_handler_id = sam->m_sound_handler_id;
+ m->addControlTag(this);
+}
+
+
+void
+StartSoundTag::execute(sprite_instance* /* m */) const
+{
+ // Make static ?
+ sound_handler* handler = get_sound_handler();
+
+ //GNASH_REPORT_FUNCTION;
+
+ if (handler)
+ {
+ if (m_stop_playback)
+ {
+ handler->stop_sound(m_handler_id);
+ }
+ else
+ {
+ handler->play_sound(m_handler_id, m_loop_count, 0,0,
(m_envelopes.size() == 0 ? NULL : &m_envelopes));
+ }
+ }
+}
+
+} // namespace gnash::SWF
+} // namespace gnash
+
+// Local Variables:
+// mode: C++
+// indent-tabs-mode: t
+// End:
Index: server/swf/StartSoundTag.h
===================================================================
RCS file: server/swf/StartSoundTag.h
diff -N server/swf/StartSoundTag.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ server/swf/StartSoundTag.h 23 Nov 2007 22:23:25 -0000 1.1
@@ -0,0 +1,99 @@
+//
+// Copyright (C) 2007 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 GNASH_SWF_STARTSOUND_TAG_H
+#define GNASH_SWF_STARTSOUND_TAG_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "ControlTag.h" // for inheritance
+#include "sound_handler.h" // for sound_envelope (composition)
+#include "swf.h" // for tag_type definition
+
+#include <vector> // for composition
+#include <boost/cstdint.hpp> // for uint16_t and friends
+
+
+// Forward declarations
+namespace gnash {
+ class stream;
+ class movie_definition;
+ class sound_sample;
+}
+
+namespace gnash {
+namespace SWF {
+
+/// SWF Tag StartSound (15)
+class StartSoundTag : public ControlTag
+{
+ uint16_t m_handler_id;
+ int m_loop_count;
+ bool m_stop_playback;
+ std::vector<sound_handler::sound_envelope> m_envelopes;
+
+ /// Envelopes for the current sound instance
+ //
+ /// TODO: define ownership
+ ///
+ uint32_t* envelopes;
+
+ /// \brief
+ /// Initialize this StartSoundTag from
+ /// the stream & given sample.
+ //
+ /// Insert ourself into the movie.
+ ///
+ void read(stream* in, int tag_type,
+ movie_definition* m, const sound_sample* sam);
+
+
+ StartSoundTag()
+ :
+ m_handler_id(0),
+ m_loop_count(0),
+ m_stop_playback(false)
+ {
+ }
+
+public:
+
+ void execute(sprite_instance* m) const;
+
+ /// Load a SWF::STARTSOUND tag.
+ static void loader(stream* in, tag_type tag, movie_definition* m);
+
+};
+
+
+} // namespace gnash::SWF
+} // namespace gnash
+
+
+#endif // GNASH_SWF_STARTSOUND_TAG_H
+
+
+// Local Variables:
+// mode: C++
+// indent-tabs-mode: t
+// End: