Tag Parser  6.2.1
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 FLACSTREAM_H
2 #define FLACSTREAM_H
3 
4 #include "../abstracttrack.h"
5 
6 #include <iosfwd>
7 #include <memory>
8 
9 namespace Media {
10 
11 class MediaFileInfo;
12 class VorbisComment;
13 
15 {
16 public:
17  FlacStream(MediaFileInfo &mediaFileInfo, uint64 startOffset);
18  ~FlacStream();
19 
20  TrackType type() const;
21  VorbisComment *vorbisComment() const;
22  VorbisComment *createVorbisComment();
23  bool removeVorbisComment();
24  uint32 paddingSize() const;
25  uint32 streamOffset() const;
26 
27  uint32 makeHeader(std::ostream &stream);
28  static void makePadding(std::ostream &stream, uint32 size, bool isLast);
29 
30 protected:
31  void internalParseHeader();
32 
33 private:
34  MediaFileInfo &m_mediaFileInfo;
35  std::unique_ptr<VorbisComment> m_vorbisComment;
36  uint32 m_paddingSize;
37  uint32 m_streamOffset;
38 };
39 
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 }
74 
75 #endif // FLACSTREAM_H
Implementation of Media::Tag for Vorbis comments.
Definition: vorbiscomment.h:15
uint32 streamOffset() const
Returns the start offset of the actual FLAC frames.
Definition: flacstream.h:68
TrackType
Specifies the track type.
Definition: abstracttrack.h:28
The AbstractTrack class parses and stores technical information about video, audio and other kinds of...
Definition: abstracttrack.h:40
TrackType type() const
Returns the type of the track if known; otherwise returns TrackType::Unspecified. ...
Definition: flacstream.h:43
uint32 paddingSize() const
Returns the padding size.
Definition: flacstream.h:59
Implementation of Media::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:52
VorbisComment * vorbisComment() const
Returns the Vorbis comment if one is present in the stream.
Definition: flacstream.h:51
Contains all classes and functions of the TagInfo library.
Definition: exceptions.h:9
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.