Tag Parser  9.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 : 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) override;
31  void internalParseTags(Diagnostics &diag) override;
32  void internalParseTracks(Diagnostics &diag) 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 
38  bool m_fragmented;
39 };
40 
42 {
43  return true;
44 }
45 
50 inline bool Mp4Container::isFragmented() const
51 {
52  return m_fragmented;
53 }
54 
55 } // namespace TagParser
56 
57 #endif // TAG_PARSER_MP4CONTAINER_H
TagParser::Mp4Container
Implementation of GenericContainer<MediaFileInfo, Mp4Tag, Mp4Track, Mp4Atom>.
Definition: mp4container.h:18
mp4atom.h
TagParser::AbortableProgressFeedback
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks....
Definition: progressfeedback.h:186
mp4track.h
TagParser::Diagnostics
The Diagnostics class is a container for DiagMessage.
Definition: diagnostics.h:156
TagParser
Contains all classes and functions of the TagInfo library.
Definition: aaccodebook.h:10
TagParser::GenericContainer
The GenericContainer class helps parsing header, track, tag and chapter information of a file.
Definition: genericcontainer.h:22
TagParser::ElementPosition
ElementPosition
Definition: settings.h:13
TAG_PARSER_EXPORT
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
TagParser::Mp4Container::supportsTrackModifications
bool supportsTrackModifications() const override
Returns whether the implementation supports adding or removing of tracks.
Definition: mp4container.h:41
TagParser::Mp4Container::isFragmented
bool isFragmented() const
Returns whether the file is fragmented.
Definition: mp4container.h:50
TagParser::MediaFileInfo
The MediaFileInfo class allows to read and write tag information providing a container/tag format ind...
Definition: mediafileinfo.h:45
mp4tag.h