mpegheader.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef TAGLIB_MPEGHEADER_H
00027 #define TAGLIB_MPEGHEADER_H
00028
00029 #include "taglib_export.h"
00030
00031 namespace TagLib {
00032
00033 class ByteVector;
00034 class File;
00035
00036 namespace MPEG {
00037
00039
00047 class TAGLIB_EXPORT Header
00048 {
00049 public:
00055 Header(const ByteVector &data);
00056
00064 Header(File *file, long offset, bool checkLength = true);
00065
00069 Header(const Header &h);
00070
00074 virtual ~Header();
00075
00080 bool isValid() const;
00081
00085 enum Version {
00087 Version1 = 0,
00089 Version2 = 1,
00091 Version2_5 = 2
00092 };
00093
00097 Version version() const;
00098
00102 int layer() const;
00103
00107 bool protectionEnabled() const;
00108
00112 int bitrate() const;
00113
00117 int sampleRate() const;
00118
00122 bool isPadded() const;
00123
00128 enum ChannelMode {
00130 Stereo = 0,
00132 JointStereo = 1,
00134 DualChannel = 2,
00136 SingleChannel = 3
00137 };
00138
00142 ChannelMode channelMode() const;
00143
00147 bool isCopyrighted() const;
00148
00152 bool isOriginal() const;
00153
00157 int frameLength() const;
00158
00162 int samplesPerFrame() const;
00163
00167 Header &operator=(const Header &h);
00168
00169 private:
00170 void parse(File *file, long offset, bool checkLength);
00171
00172 class HeaderPrivate;
00173 HeaderPrivate *d;
00174 };
00175 }
00176 }
00177
00178 #endif