Qmmp
Loading...
Searching...
No Matches
audioparameters.h
1/***************************************************************************
2 * Copyright (C) 2009-2022 by Ilya Kotov *
3 * forkotov02@ya.ru *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
20
21#ifndef AUDIOPARAMETERS_H
22#define AUDIOPARAMETERS_H
23
24#include <QtGlobal>
25#include "channelmap.h"
26#include "qmmp.h"
27
31class QMMP_EXPORT AudioParameters
32{
33public:
34
39 {
40 LittleEndian = 0,
41 BigEndian
42 };
53 AudioParameters(quint32 srate, const ChannelMap &map, Qmmp::AudioFormat format);
65 bool operator==(const AudioParameters &p) const;
69 bool operator!=(const AudioParameters &p) const;
73 quint32 sampleRate() const;
77 int channels() const;
81 const ChannelMap channelMap() const;
89 int sampleSize() const;
94 int frameSize() const;
98 int bitsPerSample() const;
112 const QString toString() const;
116 static int sampleSize(Qmmp::AudioFormat format);
132 static Qmmp::AudioFormat findAudioFormat(int bits, ByteOrder byteOrder = LittleEndian);
133
134private:
135 quint32 m_srate = 0;
136 ChannelMap m_chan_map;
138 int m_sz = 2;
139 int m_precision = 16;
140};
141
142#endif // AUDIOPARAMETERS_H
The AudioParameters class keeps information about audio settings.
Definition audioparameters.h:32
Qmmp::AudioFormat format() const
ByteOrder byteOrder() const
const QString toString() const
AudioParameters & operator=(const AudioParameters &p)
int validBitsPerSample() const
static int bitsPerSample(Qmmp::AudioFormat format)
quint32 sampleRate() const
static int sampleSize(Qmmp::AudioFormat format)
int channels() const
bool operator==(const AudioParameters &p) const
int bitsPerSample() const
int frameSize() const
static Qmmp::AudioFormat findAudioFormat(int bits, ByteOrder byteOrder=LittleEndian)
static int validBitsPerSample(Qmmp::AudioFormat format)
ByteOrder
Definition audioparameters.h:39
AudioParameters(quint32 srate, const ChannelMap &map, Qmmp::AudioFormat format)
bool operator!=(const AudioParameters &p) const
int sampleSize() const
const ChannelMap channelMap() const
AudioParameters(const AudioParameters &other)
This class represents audio channel mapping.
Definition channelmap.h:31
AudioFormat
Definition qmmp.h:115
@ PCM_S16LE
Definition qmmp.h:119