remove revno.h for distclean
[gnash.git] / libcore / swf / StartSoundTag.h
blob1129f525723e04c3e0911f25358b3ba6e9b503f7
1 //
2 // Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 #ifndef GNASH_SWF_STARTSOUND_TAG_H
19 #define GNASH_SWF_STARTSOUND_TAG_H
21 #include "ControlTag.h" // for inheritance
22 #include "sound_handler.h" // for sound_envelope (composition)
23 #include "SWF.h" // for TagType definition
24 #include "SoundInfoRecord.h"
26 #include <boost/cstdint.hpp> // for boost::uint16_t and friends
29 // Forward declarations
30 namespace gnash {
31 class SWFStream;
32 class movie_definition;
33 class sound_sample;
34 class RunResources;
37 namespace gnash {
38 namespace SWF {
40 /// SWF Tag StartSound (15)
42 /// See http://sswf.sourceforge.net/SWFalexref.html#tag_startsound
43 ///
44 class StartSoundTag : public ControlTag
46 /// This should be a reference to an earlier DefineSound tag id
47 /// but in this implementation is instead the sound_handler specific
48 /// identifier corresponding to it.
49 /// movie_definition keeps a mapping between SWF-defined DefineSound
50 /// identifier and sound_handler-provided identifier.
51 /// This one is the latter, probably so with the intention of avoiding
52 /// a lookup at every execution...
53 ///
54 boost::uint16_t m_handler_id;
56 /// Create a StartSoundTag for starting the given sound sample
58 /// The stream is assumed to be positioned right after the
59 /// sound_id field of the tag structure.
60 ///
61 /// @param in The SWFStream to initialize the tag from.
62 /// @param sound_handler_id
63 /// Sound sample identifier as provided by sound_handler (sic!)
64 ///
65 StartSoundTag(SWFStream& in, int sound_id)
67 m_handler_id(sound_id)
69 _soundInfo.read(in);
72 SoundInfoRecord _soundInfo;
74 public:
76 // This is not a state tag.
77 void executeActions(MovieClip* /* m */, DisplayList& /* dlist */) const;
79 /// Load a SWF::STARTSOUND tag.
80 static void loader(SWFStream& in, TagType tag, movie_definition& m,
81 const RunResources& r);
85 /// StartSound2Tag (SWF9)
87 /// Very similar to StartSoundTag, but uses a SoundClassName instead of
88 /// DisplayObject ID. This is not implemented.
89 class StartSound2Tag
91 public:
93 /// Load a SWF::STARTSOUND2 tag.
94 static void loader(SWFStream& in, TagType tag, movie_definition& m,
95 const RunResources& r);
98 } // namespace gnash::SWF
99 } // namespace gnash
102 #endif // GNASH_SWF_STARTSOUND_TAG_H
105 // Local Variables:
106 // mode: C++
107 // indent-tabs-mode: t
108 // End: