Tag Parser  10.0.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
mp4container.h
Go to the documentation of this file.
1 #ifndef TAG_PARSER_MP4CONTAINER_H
2 #define TAG_PARSER_MP4CONTAINER_H
3 
4 #include "./mp4atom.h"
5 #include "./mp4tag.h"
6 #include "./mp4track.h"
7 
8 #include "../genericcontainer.h"
9 
10 #include <cstdint>
11 #include <memory>
12 #include <vector>
13 
14 namespace TagParser {
15 
16 class MediaFileInfo;
17 
18 class TAG_PARSER_EXPORT Mp4Container final : public GenericContainer<MediaFileInfo, Mp4Tag, Mp4Track, Mp4Atom> {
19 public:
20  Mp4Container(MediaFileInfo &fileInfo, std::uint64_t startOffset);
21  ~Mp4Container() override;
22 
23  bool supportsTrackModifications() const override;
24  bool isFragmented() const;
25  void reset() override;
26  ElementPosition determineTagPosition(Diagnostics &diag) const override;
27  ElementPosition determineIndexPosition(Diagnostics &diag) const override;
28 
29 protected:
30  void internalParseHeader(Diagnostics &diag, AbortableProgressFeedback &progress) override;
31  void internalParseTags(Diagnostics &diag, AbortableProgressFeedback &progress) override;
32  void internalParseTracks(Diagnostics &diag, AbortableProgressFeedback &progress) override;
33  void internalMakeFile(Diagnostics &diag, AbortableProgressFeedback &progress) override;
34 
35 private:
36  void updateOffsets(const std::vector<std::int64_t> &oldMdatOffsets, const std::vector<std::int64_t> &newMdatOffsets, Diagnostics &diag,
37  AbortableProgressFeedback &progress);
38 
39  bool m_fragmented;
40 };
41 
43 {
44  return true;
45 }
46 
51 inline bool Mp4Container::isFragmented() const
52 {
53  return m_fragmented;
54 }
55 
56 } // namespace TagParser
57 
58 #endif // TAG_PARSER_MP4CONTAINER_H
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks.
The Diagnostics class is a container for DiagMessage.
Definition: diagnostics.h:156
The GenericContainer class helps parsing header, track, tag and chapter information of a file.
The MediaFileInfo class allows to read and write tag information providing a container/tag format ind...
Definition: mediafileinfo.h:74
Implementation of GenericContainer<MediaFileInfo, Mp4Tag, Mp4Track, Mp4Atom>.
Definition: mp4container.h:18
bool supportsTrackModifications() const override
Returns whether the implementation supports adding or removing of tracks.
Definition: mp4container.h:42
bool isFragmented() const
Returns whether the file is fragmented.
Definition: mp4container.h:51
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Contains all classes and functions of the TagInfo library.
Definition: aaccodebook.h:10
ElementPosition
Definition: settings.h:13