TagLib API Documentation
mpcproperties.h
Go to the documentation of this file.
1/***************************************************************************
2 copyright : (C) 2004 by Allan Sandfeld Jensen
3 email : kde@carewolf.org
4 ***************************************************************************/
5
6/***************************************************************************
7 * This library is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU Lesser General Public License version *
9 * 2.1 as published by the Free Software Foundation. *
10 * *
11 * This library is distributed in the hope that it will be useful, but *
12 * WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14 * Lesser General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Lesser General Public *
17 * License along with this library; if not, write to the Free Software *
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
19 * 02110-1301 USA *
20 * *
21 * Alternatively, this file is available under the Mozilla Public *
22 * License Version 1.1. You may obtain a copy of the License at *
23 * http://www.mozilla.org/MPL/ *
24 ***************************************************************************/
25
26#ifndef TAGLIB_MPCPROPERTIES_H
27#define TAGLIB_MPCPROPERTIES_H
28
29#include "tbytevector.h"
30#include "taglib_export.h"
31#include "audioproperties.h"
32
33namespace TagLib {
34
35 namespace MPC {
36
37 class File;
38
39 static constexpr unsigned int HeaderSize = 8 * 7;
40
42
49 {
50 public:
55 Properties(File *file, offset_t streamLength, ReadStyle style = Average);
56
60 ~Properties() override;
61
62 Properties(const Properties &) = delete;
63 Properties &operator=(const Properties &) = delete;
64
70 int lengthInMilliseconds() const override;
71
75 int bitrate() const override;
76
80 int sampleRate() const override;
81
85 int channels() const override;
86
90 int mpcVersion() const;
91
92 unsigned int totalFrames() const;
93 unsigned long sampleFrames() const;
94
99 int trackGain() const;
100
106 int trackPeak() const;
107
112 int albumGain() const;
113
119 int albumPeak() const;
120
121 private:
122 void readSV7(const ByteVector &data, offset_t streamLength);
123 void readSV8(File *file, offset_t streamLength);
124
125 class PropertiesPrivate;
127 std::unique_ptr<PropertiesPrivate> d;
128 };
129 } // namespace MPC
130} // namespace TagLib
131
132#endif
A simple, abstract interface to common audio properties.
Definition: audioproperties.h:46
ReadStyle
Definition: audioproperties.h:56
A byte vector.
Definition: tbytevector.h:46
An implementation of TagLib::File with MPC specific methods.
Definition: mpcfile.h:64
An implementation of audio property reading for MPC.
Definition: mpcproperties.h:49
int lengthInMilliseconds() const override
int sampleRate() const override
unsigned long sampleFrames() const
int bitrate() const override
Properties(const Properties &)=delete
Properties(File *file, offset_t streamLength, ReadStyle style=Average)
unsigned int totalFrames() const
int channels() const override
Properties & operator=(const Properties &)=delete
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
off_t offset_t
Definition: taglib.h:64
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition: taglib_export.h:55