Gnash  0.8.11dev
StreamSoundBlockTag.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012
3 // Free Software Foundation, Inc.
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 
19 #ifndef GNASH_SWF_STREAMSOUNDBLOCK_TAG_H
20 #define GNASH_SWF_STREAMSOUNDBLOCK_TAG_H
21 
22 #include <cstdint>
23 
24 #include "ControlTag.h" // for inheritance
25 #include "SWF.h" // for TagType definition
26 #include "sound_handler.h" // for StreamBlockId identifier
27 
28 // Forward declarations
29 namespace gnash {
30  class SWFStream;
31  class movie_definition;
32  class RunResources;
33 }
34 
35 namespace gnash {
36 namespace SWF {
37 
39 //
51 {
52 public:
53 
55  void executeActions(MovieClip* m, DisplayList& dlist) const;
56 
58  static void loader(SWFStream& in, TagType tag, movie_definition& m,
59  const RunResources& r);
60 
61 private:
62 
64  //
69  StreamSoundBlockTag(std::uint16_t streamId,
71  :
72  _handler_id(streamId),
73  _blockId(blockId)
74  {}
75 
77  const std::uint16_t _handler_id;
78 
81 
82 };
83 
84 
85 } // namespace gnash::SWF
86 } // namespace gnash
87 
88 
89 #endif // GNASH_SWF_STREAMSOUNDBLOCK_TAG_H
90 
91 
92 // Local Variables:
93 // mode: C++
94 // indent-tabs-mode: nil
95 // End:
sound_handler.h
movie_root.h
gnash::SWF::ControlTag
Control tags are swf tags that control the operation of the movie.
Definition: ControlTag.h:44
SoundInfo.h
ControlTag.h
gnash::log_swferror
void log_swferror(StringType msg, Args... args)
Definition: log.h:325
gnash::SWF::StreamSoundBlockTag
SWF Tag StreamSoundBlock (19).
Definition: StreamSoundBlockTag.h:51
gnash::media::SoundInfo::getSampleCount
unsigned long getSampleCount() const
Returns the samplecount of the sound.
Definition: SoundInfo.h:103
gnash::SWF::TagType
TagType
SWF tag types. Symbolic names copied from Ming.
Definition: SWF.h:31
gnash::media::SoundInfo
Class containing information about an embedded sound definition.
Definition: SoundInfo.h:34
_
#define _(String)
Definition: log.h:44
MediaHandler.h
gnash
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
gnash::key::m
@ m
Definition: GnashKey.h:159
utility.h
gnash::key::s
@ s
Definition: GnashKey.h:165
gnash::SWFStream::read
unsigned read(char *buf, unsigned count)
Read <count> bytes from the source stream and copy that data to <buf>.
Definition: SWFStream.cpp:68
gnash::MovieClip
A MovieClip is a container for DisplayObjects.
Definition: MovieClip.h:84
StreamSoundBlockTag.h
gnash::movie_definition
Client program's interface to the definition of a movie or sprite.
Definition: movie_definition.h:96
gnash::media::AUDIO_CODEC_MP3
@ AUDIO_CODEC_MP3
MP3 format.
Definition: MediaParser.h:164
IF_VERBOSE_MALFORMED_SWF
#define IF_VERBOSE_MALFORMED_SWF(x)
Definition: log.h:404
gnash::media::MediaHandler
The MediaHandler class acts as a factory to provide parser and decoders.
Definition: MediaHandler.h:70
gnash::DisplayList
A list of on-stage DisplayObjects, ordered by depth.
Definition: DisplayList.h:65
gnash::key::r
@ r
Definition: GnashKey.h:164
gnash::getRunResources
const RunResources & getRunResources(const as_object &o)
Get the RunResources from an as_object.
Definition: as_object.cpp:1142
gnash::SWFStream::tell
unsigned long tell()
Return our current (byte) position in the input stream.
Definition: SWFStream.cpp:447
gnash::media::audioCodecType
audioCodecType
Audio codec ids as defined in flash.
Definition: MediaParser.h:123
gnash::movie_root::setStreamBlock
void setStreamBlock(int id, int block)
Set the current stream block for the driving streaming sound.
Definition: movie_root.cpp:259
MovieClip.h
gnash::SimpleBuffer::data
std::uint8_t * data()
Get a pointer to start of data. May be NULL if size==0.
Definition: SimpleBuffer.h:81
gnash::ParserException
An SWF parsing exception.
Definition: GnashException.h:90
gnash::RunResources
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:54
gnash::SWFStream::get_tag_end_position
unsigned long get_tag_end_position()
Return the file position of the end of the current tag.
Definition: SWFStream.cpp:497
log.h
gnash::getRoot
movie_root & getRoot(const as_environment &env)
Definition: as_environment.cpp:645
gnash::sound::sound_handler
Sound mixer.
Definition: sound_handler.h:88
gnash::getObject
as_object * getObject(const DisplayObject *d)
Return the as_object associated with a DisplayObject if it exists.
Definition: DisplayObject.h:1160
gnash::sound::sound_handler::StreamBlockId
unsigned long StreamBlockId
Identifier of a streaming sound block.
Definition: sound_handler.h:97
SWF.h
gnash::SWFStream::read_u16
std::uint16_t read_u16()
Read a aligned unsigned 16-bit value from the stream.
Definition: SWFStream.cpp:332
RunResources.h
gnash::media::MediaHandler::getInputPaddingSize
virtual size_t getInputPaddingSize() const
Return the number of bytes padding needed for input buffers.
Definition: MediaHandler.h:141
gnash::sound::sound_handler::addSoundBlock
virtual StreamBlockId addSoundBlock(SimpleBuffer data, size_t sampleCount, int seekSamples, int streamId)
Definition: sound_handler.cpp:147
movie_definition.h
gnash::RunResources::soundHandler
sound::sound_handler * soundHandler() const
Get a pointer to a sound::sound_handler set by a hosting application.
Definition: RunResources.h:96
gnash::SWF::SOUNDSTREAMBLOCK
@ SOUNDSTREAMBLOCK
Definition: SWF.h:51
gnash::sound::sound_handler::playStream
void playStream(int handle, StreamBlockId blockId)
Start playback of a streaming sound, if not playing already.
Definition: sound_handler.cpp:497
gnash::SWF::StreamSoundBlockTag::executeActions
void executeActions(MovieClip *m, DisplayList &dlist) const
Start the associated block of sound.
Definition: StreamSoundBlockTag.cpp:40
gnash::sound::sound_handler::get_sound_info
virtual media::SoundInfo * get_sound_info(int handle) const
Returns a SoundInfo object for the sound with the given id.
Definition: sound_handler.cpp:258
gnash::SWFStream
SWF stream wrapper class.
Definition: SWFStream.h:59
gnash::SWFStream::ensureBytes
void ensureBytes(unsigned long needed)
Ensure the requested number of bytes are available for an aligned read in the currently opened tag.
Definition: SWFStream.cpp:50
gnash::key::SWF
@ SWF
Definition: GnashKey.h:331
gnash::media::SoundInfo::getFormat
audioCodecType getFormat() const
Returns the format of the sound.
Definition: SoundInfo.h:84
gnash::SimpleBuffer::resize
void resize(size_t newSize)
Resize the buffer.
Definition: SimpleBuffer.h:87
SWFStream.h
gnash::SimpleBuffer
A simple buffer of bytes.
Definition: SimpleBuffer.h:38
gnash::SWF::StreamSoundBlockTag::loader
static void loader(SWFStream &in, TagType tag, movie_definition &m, const RunResources &r)
Load an SWF::SOUNDSTREAMBLOCK (19) tag.
Definition: StreamSoundBlockTag.cpp:57