Tag Parser: flac/flacstream.h Source File

Tag Parser 12.5.3 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
14 class 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
39 inline FlacStream::~FlacStream()
40{
41}
42
43 inline TrackType FlacStream::type() const
44{
45 return TrackType::FlacStream;
46}
47
51 inline VorbisComment *FlacStream::vorbisComment() const
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
abstracttrack.h
TagParser::AbortableProgressFeedback
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks.
Definition progressfeedback.h:186
TagParser::AbstractTrack::size
std::uint64_t size() const
Returns the size in bytes if known; otherwise returns 0.
Definition abstracttrack.h:394
TagParser::AbstractTrack::startOffset
std::uint64_t startOffset() const
Returns the start offset of the track in the associated stream.
Definition abstracttrack.h:316
TagParser::AbstractTrack::AbstractTrack
AbstractTrack(std::istream &inputStream, std::ostream &outputStream, std::uint64_t startOffset)
Constructs a new track.
Definition abstracttrack.cpp:33
TagParser::Diagnostics
The Diagnostics class is a container for DiagMessage.
Definition diagnostics.h:156
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::createVorbisComment
VorbisComment * createVorbisComment()
Creates a new Vorbis comment for the stream.
Definition flacstream.cpp:44
TagParser::FlacStream::paddingSize
std::uint32_t paddingSize() const
Returns the padding size.
Definition flacstream.h:59
TagParser::FlacStream::FlacStream
FlacStream(MediaFileInfo &mediaFileInfo, std::uint64_t startOffset)
Constructs a new track for the specified mediaFileInfo at the specified startOffset.
Definition flacstream.cpp:31
TagParser::FlacStream::internalParseHeader
void internalParseHeader(Diagnostics &diag, AbortableProgressFeedback &progress) override
This method is internally called to parse header information.
Definition flacstream.cpp:65
TagParser::FlacStream::removeVorbisComment
bool removeVorbisComment()
Removes the assigned Vorbis comment if one is assigned; does nothing otherwise.
Definition flacstream.cpp:56
TagParser::FlacStream::~FlacStream
~FlacStream() override
Definition flacstream.h:39
TagParser::FlacStream::vorbisComment
VorbisComment * vorbisComment() const
Returns the Vorbis comment if one is present in the stream.
Definition flacstream.h:51
TagParser::FlacStream::makeHeader
std::streamoff makeHeader(std::ostream &stream, Diagnostics &diag)
Writes the FLAC metadata header to the specified outputStream.
Definition flacstream.cpp:181
TagParser::FlacStream::streamOffset
std::uint32_t streamOffset() const
Returns the start offset of the actual FLAC frames.
Definition flacstream.h:68
TagParser::FlacStream::makePadding
static void makePadding(std::ostream &stream, std::uint32_t size, bool isLast, Diagnostics &diag)
Writes padding of the specified size to the specified stream.
Definition flacstream.cpp:303
TagParser::MediaFileInfo
The MediaFileInfo class allows to read and write tag information providing a container/tag format ind...
Definition mediafileinfo.h:83
TagParser::VorbisComment
Implementation of TagParser::Tag for Vorbis comments.
Definition vorbiscomment.h:27
TAG_PARSER_EXPORT
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Definition global.h:14
TagParser
Contains all classes and functions of the TagInfo library.
Definition aaccodebook.h:10
TagParser::TrackType
TrackType
The TrackType enum specifies the underlying file type of a track and the concrete class of the track ...
Definition abstracttrack.h:32
TagParser::TrackType::FlacStream
@ FlacStream
Definition abstracttrack.h:40