Tag Parser  6.1.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 <c++utilities/misc/memory.h>
7 
8 #include <iosfwd>
9 
10 namespace Media {
11 
12 class MediaFileInfo;
13 class VorbisComment;
14 
16 {
17 public:
18  FlacStream(MediaFileInfo &mediaFileInfo, uint64 startOffset);
19  ~FlacStream();
20 
21  TrackType type() const;
22  VorbisComment *vorbisComment() const;
23  VorbisComment *createVorbisComment();
24  bool removeVorbisComment();
25  uint32 paddingSize() const;
26  uint32 streamOffset() const;
27 
28  uint32 makeHeader(std::ostream &stream);
29  static void makePadding(std::ostream &stream, uint32 size, bool isLast);
30 
31 protected:
32  void internalParseHeader();
33 
34 private:
35  MediaFileInfo &m_mediaFileInfo;
36  std::unique_ptr<VorbisComment> m_vorbisComment;
37  uint32 m_paddingSize;
38  uint32 m_streamOffset;
39 };
40 
42 {}
43 
45 {
46  return TrackType::FlacStream;
47 }
48 
53 {
54  return m_vorbisComment.get();
55 }
56 
60 inline uint32 FlacStream::paddingSize() const
61 {
62  return m_paddingSize;
63 }
64 
69 inline uint32 FlacStream::streamOffset() const
70 {
71  return m_streamOffset;
72 }
73 
74 }
75 
76 #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:69
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:44
uint32 paddingSize() const
Returns the padding size.
Definition: flacstream.h:60
Implementation of Media::AbstractTrack for raw FLAC streams.
Definition: flacstream.h:15
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:52
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.