strawberry-audio-player-win.../3rdparty/taglib/flac/flacproperties.h

112 lines
3.6 KiB
C
Raw Normal View History

2018-05-10 15:29:28 +02:00
/***************************************************************************
copyright : (C) 2003 by Allan Sandfeld Jensen
email : kde@carewolf.org
***************************************************************************/
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License version *
* 2.1 as published by the Free Software Foundation. *
* *
* This library is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301 USA *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#ifndef TAGLIB_FLACPROPERTIES_H
#define TAGLIB_FLACPROPERTIES_H
#include "taglib_export.h"
#include "audioproperties.h"
2019-04-26 01:12:42 +02:00
namespace Strawberry_TagLib {
namespace TagLib {
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
namespace FLAC {
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
class File;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
//! An implementation of audio property reading for FLAC
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* This reads the data from an FLAC stream found in the AudioProperties API.
*/
2018-05-10 15:29:28 +02:00
class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties {
2020-06-13 19:02:42 +02:00
public:
/*!
* Create an instance of FLAC::AudioProperties with the data read from the ByteVector \a data.
*/
2020-06-26 23:30:30 +02:00
explicit AudioProperties(const ByteVector &data, long long streamLength, ReadStyle style = Average);
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Destroys this FLAC::AudioProperties instance.
*/
2020-06-26 23:30:30 +02:00
~AudioProperties() override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the length of the file in seconds. The length is rounded down to the nearest whole second.
*
* \see lengthInMilliseconds()
*/
2020-06-26 23:30:30 +02:00
int lengthInSeconds() const override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the length of the file in milliseconds.
*
* \see lengthInSeconds()
*/
2020-06-26 23:30:30 +02:00
int lengthInMilliseconds() const override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the average bit rate of the file in kb/s.
*/
2020-06-26 23:30:30 +02:00
int bitrate() const override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the sample rate in Hz.
*/
2020-06-26 23:30:30 +02:00
int sampleRate() const override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the number of audio channels.
*/
2020-06-26 23:30:30 +02:00
int channels() const override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the number of bits per audio sample as read from the FLAC identification header.
*/
2020-06-13 19:02:42 +02:00
int bitsPerSample() const;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Return the number of sample frames.
*/
2020-06-13 19:02:42 +02:00
unsigned long long sampleFrames() const;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the MD5 signature of the uncompressed audio stream as read from the stream info header.
*/
2020-06-13 19:02:42 +02:00
ByteVector signature() const;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
private:
2020-06-26 23:30:30 +02:00
void read(const ByteVector &data, long long streamLength);
2018-05-10 15:29:28 +02:00
class AudioPropertiesPrivate;
AudioPropertiesPrivate *d;
2020-06-13 19:02:42 +02:00
};
} // namespace FLAC
} // namespace TagLib
} // namespace Strawberry_TagLib
2018-05-10 15:29:28 +02:00
#endif