Gnash  0.8.11dev
SoundInfo.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_LIBMEDIA_SOUNDINFO_H
20 #define GNASH_LIBMEDIA_SOUNDINFO_H
21 
22 #include "MediaParser.h" // for audioCodecType enum and AudioInfo
23 
24 namespace gnash {
25 namespace media {
26 
28 //
34 class SoundInfo {
35 public:
37  //
68  SoundInfo(audioCodecType format, bool stereo, std::uint32_t sampleRate,
69  std::uint32_t sampleCount, bool is16bit,
70  std::int16_t delaySeek=0)
71  :
72  _format(format),
73  _stereo(stereo),
74  _sampleRate(sampleRate),
75  _sampleCount(sampleCount),
76  _delaySeek(delaySeek),
77  _is16bit(is16bit)
78  {
79  }
80 
82  //
84  audioCodecType getFormat() const { return _format; }
85 
87  //
89  bool isStereo() const { return _stereo; }
90 
92  //
94  unsigned long getSampleRate() const { return _sampleRate; }
95 
97  //
103  unsigned long getSampleCount() const { return _sampleCount; }
104 
106  //
109  std::int16_t getDelaySeek() const { return _delaySeek; }
110 
112  //
114  bool is16bit() const { return _is16bit; }
115 
116 private:
118  audioCodecType _format;
119 
121  bool _stereo;
122 
124  std::uint32_t _sampleRate;
125 
127  std::uint32_t _sampleCount;
128 
130  std::int16_t _delaySeek;
131 
134  bool _is16bit;
135 };
136 
137 } // gnash.media namespace
138 } // namespace gnash
139 
140 #endif // __SOUNDINFO_H__
unsigned long getSampleRate() const
Returns the samplerate of the sound.
Definition: SoundInfo.h:94
Class containing information about an embedded sound definition.
Definition: SoundInfo.h:34
std::int16_t getDelaySeek() const
Return the number of samples to seek forward or delay.
Definition: SoundInfo.h:109
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
unsigned long getSampleCount() const
Returns the samplecount of the sound.
Definition: SoundInfo.h:103
audioCodecType
Audio codec ids as defined in flash.
Definition: MediaParser.h:122
bool isStereo() const
Returns the stereo status of the sound.
Definition: SoundInfo.h:89
SoundInfo(audioCodecType format, bool stereo, std::uint32_t sampleRate, std::uint32_t sampleCount, bool is16bit, std::int16_t delaySeek=0)
Constructor.
Definition: SoundInfo.h:68
audioCodecType getFormat() const
Returns the format of the sound.
Definition: SoundInfo.h:84
bool is16bit() const
Returns the 16bit status of the sound.
Definition: SoundInfo.h:114