Tag Parser  8.0.1
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 <c++utilities/conversion/types.h>
11 
12 #include <memory>
13 #include <vector>
14 
15 namespace TagParser {
16 
17 class MediaFileInfo;
18 
19 class TAG_PARSER_EXPORT Mp4Container : public GenericContainer<MediaFileInfo, Mp4Tag, Mp4Track, Mp4Atom> {
20 public:
21  Mp4Container(MediaFileInfo &fileInfo, uint64 startOffset);
22  ~Mp4Container() override;
23 
24  bool supportsTrackModifications() const override;
25  bool isFragmented() const;
26  void reset() override;
27  ElementPosition determineTagPosition(Diagnostics &diag) const override;
28  ElementPosition determineIndexPosition(Diagnostics &diag) const override;
29 
30 protected:
31  void internalParseHeader(Diagnostics &diag) override;
32  void internalParseTags(Diagnostics &diag) override;
33  void internalParseTracks(Diagnostics &diag) override;
34  void internalMakeFile(Diagnostics &diag, AbortableProgressFeedback &progress) override;
35 
36 private:
37  void updateOffsets(const std::vector<int64> &oldMdatOffsets, const std::vector<int64> &newMdatOffsets, Diagnostics &diag);
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
Implementation of GenericContainer<MediaFileInfo, Mp4Tag, Mp4Track, Mp4Atom>.
Definition: mp4container.h:19
The MediaFileInfo class allows to read and write tag information providing a container/tag format ind...
Definition: mediafileinfo.h:44
bool supportsTrackModifications() const override
Returns whether the implementation supports adding or removing of tracks.
Definition: mp4container.h:42
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks...
Contains all classes and functions of the TagInfo library.
Definition: aaccodebook.h:9
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
ElementPosition
Definition: settings.h:10
The Diagnostics class is a container for DiagMessage.
Definition: diagnostics.h:156
bool isFragmented() const
Returns whether the file is fragmented.
Definition: mp4container.h:51
The GenericContainer class helps parsing header, track, tag and chapter information of a file...