aboutsummaryrefslogtreecommitdiff
path: root/Src/replicant/nsmp3/MPEGHeader.h
diff options
context:
space:
mode:
Diffstat (limited to 'Src/replicant/nsmp3/MPEGHeader.h')
-rw-r--r--Src/replicant/nsmp3/MPEGHeader.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/Src/replicant/nsmp3/MPEGHeader.h b/Src/replicant/nsmp3/MPEGHeader.h
new file mode 100644
index 00000000..d69271e1
--- /dev/null
+++ b/Src/replicant/nsmp3/MPEGHeader.h
@@ -0,0 +1,47 @@
+#pragma once
+#include "foundation/types.h"
+
+class MPEGHeader
+{
+public:
+ void ReadBuffer(const uint8_t *buffer);
+ int GetNumChannels() const;
+ bool IsSync() const;
+ int GetBitrate() const;
+ int HeaderSize() const;
+ int GetSampleRate() const;
+ int FrameSize() const;
+ int GetLayer() const;
+ bool IsCRC() const;
+ bool IsCopyright() const;
+ bool IsOriginal() const;
+ int GetSamplesPerFrame() const;
+ enum
+ {
+ NotPadded=0,
+ Padded=1,
+ CRC = 0,
+ NoProtection = 1,
+ Stereo = 0,
+ JointStereo = 1,
+ DualChannel = 2,
+ Mono = 3,
+ MPEG1 = 3,
+ MPEG2 = 2,
+ MPEG_Error = 1,
+ MPEG2_5 = 0,
+ Layer1 = 3,
+ Layer2 = 2,
+ Layer3 = 1,
+ LayerError = 0,
+ Emphasis_None = 0,
+ Emphasis_50_15_ms = 1,
+ Emphasis_reserved = 2,
+ Emphasis_CCIT_J_17 = 3,
+ };
+
+ uint16_t sync;
+ uint8_t mpeg_version, layer, protection, bitrate_index;
+ uint8_t padding_bit, private_bit, channel_mode, mode_extension;
+ uint8_t sample_rate_index, copyright, original, emphasis;
+};