aboutsummaryrefslogtreecommitdiff
path: root/Src/replicant/nsmp3/MPEGHeader.h
diff options
context:
space:
mode:
authorJean-Francois Mauguit <jfmauguit@mac.com>2024-09-24 09:03:25 -0400
committerGitHub <noreply@github.com>2024-09-24 09:03:25 -0400
commitbab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/replicant/nsmp3/MPEGHeader.h
parent4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff)
parent20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff)
downloadwinamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz
Merge pull request #5 from WinampDesktop/community
Merge to main
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;
+};