2
// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
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.
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.
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
22
#include "resource.h" // for sound_sample inheritance
23
#include "sound_handler.h"
24
#include "ControlTag.h" // for sound tags inheritance
26
// Forward declarations
28
class movie_definition;
35
/// This class is simply an identifier for a sound sample managed
36
/// by a sound_handler, so should likely be defined in sound_handler.h
38
/// Definition tags will maintain a mapping between SWF-defined id
39
/// of the sound and these identifiers.
41
/// Specifying an identifier for use by sound_handler would likely be
42
/// claner, anyway this is what it is *currently*.
44
/// NOTE that the destructor of this identifier (thus becoming a "smart"
45
/// identifier) requests the currently registered sound_handler removal
46
/// of the identified sound_sample. This *might* be the reason why
47
/// it is a ref-counted thing (hard to belive...).
50
/// QUESTION: why is this a resource ?
51
/// does it really need to be ref-counted ?
53
/// TODO: move definition to sound_handler.h and possibly nest inside sound_handler itself ?
55
class sound_sample: public resource
58
int m_sound_handler_id;
62
m_sound_handler_id(id)
66
/// delete the actual sound sample from the currently registered
70
sound_sample* cast_to_sound_sample() { return this; }
73
/// SWF Tag SoundStreamBlock (19)
75
/// TODO: move in it's own SoundStreamBlockTag files...
77
class start_stream_sound_tag : public ControlTag
80
boost::uint16_t m_handler_id;
84
start_stream_sound_tag()
94
/// Initialize this StartSound tag
95
/// from the stream & given sample.
97
/// Insert ourself into the movie.
98
void read(movie_definition* m, int handler_id, long start);
100
void execute(sprite_instance* m) const;
102
/// StartStreamSound is not a "state" tag?
103
void execute_state(sprite_instance* m) const;
109
#endif // GNASH_SOUND_H