Tag Parser  9.2.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
flacstream.h
Go to the documentation of this file.
1 #ifndef TAG_PARSER_FLACSTREAM_H
2 #define TAG_PARSER_FLACSTREAM_H
3 
4 #include "../abstracttrack.h"
5 
6 #include <iosfwd>
7 #include <memory>
8 
9 namespace TagParser {
10 
11 class MediaFileInfo;
12 class VorbisComment;
13 
15 public:
16  FlacStream(MediaFileInfo &mediaFileInfo, std::uint64_t startOffset);
17  ~FlacStream() override;
18 
19  TrackType type() const override;
20  VorbisComment *vorbisComment() const;
21  VorbisComment *createVorbisComment();
22  bool removeVorbisComment();
23  std::uint32_t paddingSize() const;
24  std::uint32_t streamOffset() const;
25 
26  std::streamoff makeHeader(std::ostream &stream, Diagnostics &diag);
27  static void makePadding(std::ostream &stream, std::uint32_t size, bool isLast, Diagnostics &diag);
28 
29 protected:
30  void internalParseHeader(Diagnostics &diag) override;
31 
32 private:
33  MediaFileInfo &m_mediaFileInfo;
34  std::unique_ptr<VorbisComment> m_vorbisComment;
35  std::uint32_t m_paddingSize;
36  std::uint32_t m_streamOffset;
37 };
38 
40 {
41 }
42 
44 {
45  return TrackType::FlacStream;
46 }
47 
52 {
53  return m_vorbisComment.get();
54 }
55 
59 inline std::uint32_t FlacStream::paddingSize() const
60 {
61  return m_paddingSize;
62 }
63 
68 inline std::uint32_t FlacStream::streamOffset() const
69 {
70  return m_streamOffset;
71 }
72 
73 } // namespace TagParser
74 
75 #endif // TAG_PARSER_FLACSTREAM_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::FlacStream::vorbisComment
VorbisComment * vorbisComment() const
Returns the Vorbis comment if one is present in the stream.
Definition: flacstream.h:51
TagParser::FlacMetaDataBlockType::VorbisComment
@ VorbisComment
TagParser::FlacStream::streamOffset
std::uint32_t streamOffset() const
Returns the start offset of the actual FLAC frames.
Definition: flacstream.h:68
TagParser::TrackType
TrackType
Specifies the track type.
Definition: abstracttrack.h:27
TagParser::FlacStream
Implementation of TagParser::AbstractTrack for raw FLAC streams.
Definition: flacstream.h:14
TagParser::AbstractTrack
The AbstractTrack class parses and stores technical information about video, audio and other kinds of...
Definition: abstracttrack.h:39
TagParser::FlacStream::type
TrackType type() const override
Returns the type of the track if known; otherwise returns TrackType::Unspecified.
Definition: flacstream.h:43
TagParser::FlacStream::paddingSize
std::uint32_t paddingSize() const
Returns the padding size.
Definition: flacstream.h:59
TagParser::TrackType::FlacStream
@ FlacStream
TAG_PARSER_EXPORT
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
TagParser::VorbisComment
Implementation of TagParser::Tag for Vorbis comments.
Definition: vorbiscomment.h:25
TagParser::MediaFileInfo
The MediaFileInfo class allows to read and write tag information providing a container/tag format ind...
Definition: mediafileinfo.h:45
TagParser::FlacStream::~FlacStream
~FlacStream() override
Definition: flacstream.h:39