Update with current status
[gnash.git] / libsound / SoundEnvelope.h
blob88971795ad9a7800e97ea4803cd923aff047f7b8
1 // SoundEnvelope.h - sound envelopes
2 //
3 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
4 // Free Software Foundation, Inc
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef SOUND_SOUNDENVELOPE_H
21 #define SOUND_SOUNDENVELOPE_H
23 #include <cstdint> // For C99 int types
24 #include <vector> // for SoundEnvelopes typedef
27 namespace gnash {
28 namespace sound {
30 /// A %sound envelope
32 /// Used to control volume for event sounds. It basically tells that from
33 /// sample X the volume for left out is Y and for right out is Z. Several
34 /// envelopes can be assigned to a sound to make a fade out or similar stuff.
36 /// See http://www.m2osw.com/en/swf_alexref.html#swf_envelope
37 ///
38 class SoundEnvelope
40 public:
42 /// Byte offset this envelope applies to
44 /// The offset is always given as if the sample data
45 /// was defined with a rate of 44100 bytes per seconds.
46 /// For instance, the sample number 1 in a sound effect
47 /// with a sample rate of 5.5K is given as position 8 in
48 /// the envelope.
49 ///
50 std::uint32_t m_mark44;
52 /// Volume for the left channel (0..32768)
53 std::uint16_t m_level0;
55 /// Volume for the right channel (0..32768)
56 std::uint16_t m_level1;
59 /// A vector of SoundEnvelope objects
60 typedef std::vector<SoundEnvelope> SoundEnvelopes;
64 } // gnash.sound namespace
65 } // namespace gnash
67 #endif // SOUND_SOUNDENVELOPE_H