Gnash 0.8.10dev
SoundInfo.h
Go to the documentation of this file.
00001 // 
00002 //   Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
00003 // 
00004 // This program is free software; you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation; either version 3 of the License, or
00007 // (at your option) any later version.
00008 // 
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 // 
00014 // You should have received a copy of the GNU General Public License
00015 // along with this program; if not, write to the Free Software
00016 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00017 
00018 #ifndef GNASH_LIBMEDIA_SOUNDINFO_H
00019 #define GNASH_LIBMEDIA_SOUNDINFO_H
00020 
00021 #include "MediaParser.h" // for audioCodecType enum and AudioInfo
00022 
00023 namespace gnash {
00024 namespace media {
00025 
00027 //
00033 class SoundInfo {
00034 public:
00036         //
00067         SoundInfo(audioCodecType format, bool stereo, boost::uint32_t sampleRate,
00068             boost::uint32_t sampleCount, bool is16bit,
00069             boost::int16_t delaySeek=0)
00070             :
00071         _format(format),
00072                 _stereo(stereo),
00073                 _sampleRate(sampleRate),
00074                 _sampleCount(sampleCount),
00075                 _delaySeek(delaySeek),
00076                 _is16bit(is16bit)
00077         {
00078         }
00079 
00081         //
00083         audioCodecType getFormat() const { return _format; }
00084 
00086         //
00088         bool isStereo() const { return _stereo; }
00089 
00091         //
00093         unsigned long getSampleRate() const { return _sampleRate; }
00094 
00096         //
00102         unsigned long getSampleCount() const { return _sampleCount; }
00103 
00105         // 
00108         boost::int16_t getDelaySeek() const { return _delaySeek; }
00109 
00111         //
00113         bool is16bit() const { return _is16bit; }
00114 
00115 private:
00117         audioCodecType _format;
00118 
00120         unsigned long _dataSize;
00121 
00123         bool _stereo;
00124 
00126         boost::uint32_t _sampleRate;
00127 
00129         boost::uint32_t _sampleCount;
00130 
00132         boost::int16_t _delaySeek;
00133 
00136         bool _is16bit;
00137 };
00138 
00139 } // gnash.media namespace 
00140 } // namespace gnash
00141 
00142 #endif // __SOUNDINFO_H__