Tag Parser 12.5.0
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
15public:
16 FlacStream(MediaFileInfo &mediaFileInfo, std::uint64_t startOffset);
17 ~FlacStream() override;
18
19 TrackType type() const override;
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
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks.
std::uint64_t size() const
Returns the size in bytes if known; otherwise returns 0.
std::uint64_t startOffset() const
Returns the start offset of the track in the associated stream.
AbstractTrack(std::istream &inputStream, std::ostream &outputStream, std::uint64_t startOffset)
Constructs a new track.
The Diagnostics class is a container for DiagMessage.
TrackType type() const override
Returns the type of the track if known; otherwise returns TrackType::Unspecified.
Definition flacstream.h:43
VorbisComment * createVorbisComment()
Creates a new Vorbis comment for the stream.
std::uint32_t paddingSize() const
Returns the padding size.
Definition flacstream.h:59
FlacStream(MediaFileInfo &mediaFileInfo, std::uint64_t startOffset)
Constructs a new track for the specified mediaFileInfo at the specified startOffset.
void internalParseHeader(Diagnostics &diag, AbortableProgressFeedback &progress) override
This method is internally called to parse header information.
bool removeVorbisComment()
Removes the assigned Vorbis comment if one is assigned; does nothing otherwise.
~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::streamoff makeHeader(std::ostream &stream, Diagnostics &diag)
Writes the FLAC metadata header to the specified outputStream.
std::uint32_t streamOffset() const
Returns the start offset of the actual FLAC frames.
Definition flacstream.h:68
static void makePadding(std::ostream &stream, std::uint32_t size, bool isLast, Diagnostics &diag)
Writes padding of the specified size to the specified stream.
The MediaFileInfo class allows to read and write tag information providing a container/tag format ind...
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 ...