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