Tag Parser  7.1.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, uint64 startOffset);
17  ~FlacStream() override;
18 
19  TrackType type() const override;
20  VorbisComment *vorbisComment() const;
21  VorbisComment *createVorbisComment();
22  bool removeVorbisComment();
23  uint32 paddingSize() const;
24  uint32 streamOffset() const;
25 
26  uint32 makeHeader(std::ostream &stream, Diagnostics &diag);
27  static void makePadding(std::ostream &stream, uint32 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  uint32 m_paddingSize;
36  uint32 m_streamOffset;
37 };
38 
40 {
41 }
42 
44 {
45  return TrackType::FlacStream;
46 }
47 
52 {
53  return m_vorbisComment.get();
54 }
55 
59 inline uint32 FlacStream::paddingSize() const
60 {
61  return m_paddingSize;
62 }
63 
68 inline uint32 FlacStream::streamOffset() const
69 {
70  return m_streamOffset;
71 }
72 
73 } // namespace TagParser
74 
75 #endif // TAG_PARSER_FLACSTREAM_H
~FlacStream() override
Definition: flacstream.h:39
uint32 paddingSize() const
Returns the padding size.
Definition: flacstream.h:59
Implementation of TagParser::AbstractTrack for raw FLAC streams.
Definition: flacstream.h:14
The MediaFileInfo class allows to read and write tag information providing a container/tag format ind...
Definition: mediafileinfo.h:44
VorbisComment * vorbisComment() const
Returns the Vorbis comment if one is present in the stream.
Definition: flacstream.h:51
Implementation of TagParser::Tag for Vorbis comments.
Definition: vorbiscomment.h:25
The AbstractTrack class parses and stores technical information about video, audio and other kinds of...
Definition: abstracttrack.h:39
TrackType type() const override
Returns the type of the track if known; otherwise returns TrackType::Unspecified. ...
Definition: flacstream.h:43
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.
TrackType
Specifies the track type.
Definition: abstracttrack.h:28
uint32 streamOffset() const
Returns the start offset of the actual FLAC frames.
Definition: flacstream.h:68
The Diagnostics class is a container for DiagMessage.
Definition: diagnostics.h:154