TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
audioparameters.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2009-2024 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 "channelmap.h"
25 
30 {
31 public:
35  enum ByteOrder
36  {
37  LittleEndian = 0,
38  BigEndian
39  };
40 
44  AudioParameters() = default;
45 
52  AudioParameters(quint32 srate, const ChannelMap &map, Qmmp::AudioFormat format);
56  AudioParameters(const AudioParameters &other);
60  AudioParameters &operator=(const AudioParameters &p);
64  bool operator==(const AudioParameters &p) const;
68  bool operator!=(const AudioParameters &p) const;
72  quint32 sampleRate() const;
76  int channels() const;
80  const ChannelMap &channelMap() const;
84  Qmmp::AudioFormat format() const;
88  int sampleSize() const;
93  int frameSize() const;
97  int bitsPerSample() const;
102  int validBitsPerSample() const;
106  ByteOrder byteOrder() const;
111  QString toString() const;
115  static int sampleSize(Qmmp::AudioFormat format);
119  static int bitsPerSample(Qmmp::AudioFormat format);
124  static int validBitsPerSample(Qmmp::AudioFormat format);
131  static Qmmp::AudioFormat findAudioFormat(int bits, ByteOrder byteOrder = LittleEndian);
132 
133 private:
134  quint32 m_srate = 0;
137  int m_sz = 2;
138  int m_precision = 16;
139 
140 };
141 
142 #endif
bool operator==(const VolumeSettings &v1, const VolumeSettings &v2)
Definition: volume.h:38
The AudioParameters class keeps information about audio settings.
ChannelMap m_chan_map
This class represents audio channel mapping.
Definition: channelmap.h:30
#define QMMP_EXPORT
Definition: qmmp_export.h:29
TTK_MODULE_EXPORT QString toString(Record type)
bool operator!=(const VolumeSettings &v1, const VolumeSettings &v2)
Definition: volume.h:43
AudioFormat
Definition: qmmp.h:129