strawberry-audio-player-win.../3rdparty/taglib/mp4/mp4properties.h

109 lines
3.3 KiB
C
Raw Normal View History

2018-05-10 15:29:28 +02:00
/**************************************************************************
copyright : (C) 2007 by Lukáš Lalinský
email : lalinsky@gmail.com
**************************************************************************/
/***************************************************************************
* 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_MP4PROPERTIES_H
#define TAGLIB_MP4PROPERTIES_H
#include "taglib_export.h"
#include "audioproperties.h"
2019-04-26 01:12:42 +02:00
namespace Strawberry_TagLib {
namespace TagLib {
2020-06-13 19:02:42 +02:00
namespace MP4 {
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
class Atoms;
class File;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
//! An implementation of MP4 audio properties
class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties {
2020-06-13 19:02:42 +02:00
public:
enum Codec {
Unknown = 0,
AAC,
ALAC
};
2018-05-10 15:29:28 +02:00
explicit AudioProperties(File *file, Atoms *atoms, ReadStyle style = Average);
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.
*/
2020-06-13 19:02:42 +02:00
virtual int bitsPerSample() const;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns whether or not the file is encrypted.
*/
2020-06-13 19:02:42 +02:00
bool isEncrypted() const;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the codec used in the file.
*/
2020-06-13 19:02:42 +02:00
Codec codec() const;
2018-05-10 15:29:28 +02:00
2020-06-26 23:30:30 +02:00
String toString() const override;
2020-06-13 19:02:42 +02:00
private:
void read(File *file, Atoms *atoms);
2018-05-10 15:29:28 +02:00
class AudioPropertiesPrivate;
AudioPropertiesPrivate *d;
2020-06-13 19:02:42 +02:00
};
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
} // namespace MP4
} // namespace TagLib
} // namespace Strawberry_TagLib
2018-05-10 15:29:28 +02:00
#endif