-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMPAFile.h
More file actions
53 lines (43 loc) · 1.62 KB
/
MPAFile.h
File metadata and controls
53 lines (43 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// GNU LESSER GENERAL PUBLIC LICENSE
// Version 3, 29 June 2007
//
// Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
//
// Everyone is permitted to copy and distribute verbatim copies of this license
// document, but changing it is not allowed.
//
// This version of the GNU Lesser General Public License incorporates the terms
// and conditions of version 3 of the GNU General Public License, supplemented
// by the additional permissions listed below.
#ifndef MPA_HEADER_INFO_MPA_FILE_H_
#define MPA_HEADER_INFO_MPA_FILE_H_
#include "MPAException.h"
#include "MPAFileStream.h"
#include "MPAFrame.h"
#include "Tags.h"
class CMPAFile {
public:
CMPAFile(LPCTSTR szFile, IMPAFileSystem *file_system);
~CMPAFile();
[[nodiscard]] unsigned GetBegin() const { return m_pTags->GetBegin(); };
[[nodiscard]] unsigned GetEnd() const { return m_pTags->GetEnd(); };
[[nodiscard]] unsigned GetFileSize() const {
return (GetEnd() - GetBegin());
};
[[nodiscard]] unsigned GetLengthSec() const {
return (GetFileSize() / m_dwBytesPerSec);
};
enum class GetType { First, Last, Next, Prev, Resync };
[[nodiscard]] CMPAFrame* GetFrame(GetType type, CMPAFrame* frame = nullptr,
bool should_delete_old_frame = true,
unsigned offset = 0);
private:
void CalcBytesPerSec();
CMPAStream* m_pStream;
unsigned m_dwBytesPerSec;
public:
CTags* m_pTags; // contain list of present tags
CMPAFrame* m_pFirstFrame; // always first frame
CVBRHeader* m_pVBRHeader; // XING or VBRI or nullptr
};
#endif // !MPA_HEADER_INFO_MPA_FILE_H_