Tag Parser 12.3.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Loading...
Searching...
No Matches
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
9namespace TagParser {
10
11class MediaFileInfo;
12class VorbisComment;
13
14class TAG_PARSER_EXPORT FlacStream final : public AbstractTrack {
15public:
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
29protected:
30 void internalParseHeader(Diagnostics &diag, AbortableProgressFeedback &progress) override;
31
32private:
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{
46}
47
52{
53 return m_vorbisComment.get();
54}
55
59inline std::uint32_t FlacStream::paddingSize() const
60{
61 return m_paddingSize;
62}
63
68inline std::uint32_t FlacStream::streamOffset() const
69{
70 return m_streamOffset;
71}
72
73} // namespace TagParser
74
75#endif // TAG_PARSER_FLACSTREAM_H
TrackType type() const override
Returns the type of the track if known; otherwise returns TrackType::Unspecified.
Definition flacstream.h:43
std::uint32_t paddingSize() const
Returns the padding size.
Definition flacstream.h:59
~FlacStream() override
Definition flacstream.h:39
VorbisComment * vorbisComment() const
Returns the Vorbis comment if one is present in the stream.
Definition flacstream.h:51
std::uint32_t streamOffset() const
Returns the start offset of the actual FLAC frames.
Definition flacstream.h:68
Implementation of TagParser::Tag for Vorbis comments.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Definition global.h:14
Contains all classes and functions of the TagInfo library.
Definition aaccodebook.h:10
TrackType
The TrackType enum specifies the underlying file type of a track and the concrete class of the track ...