Qmmp
audioparameters.h
1 /***************************************************************************
2  * Copyright (C) 2009-2017 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 
32 {
33 public:
34 
38  enum ByteOrder
39  {
42  };
53  AudioParameters(quint32 srate, const ChannelMap &map, Qmmp::AudioFormat format);
57  AudioParameters(const AudioParameters &other);
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;
85  Qmmp::AudioFormat format() const;
89  int sampleSize() const;
94  int frameSize() const;
98  int bitsPerSample() const;
103  int validBitsPerSample() const;
107  ByteOrder byteOrder() const;
112  const QString toString() const;
116  static int sampleSize(Qmmp::AudioFormat format);
133 
134 private:
135  quint32 m_srate;
136  ChannelMap m_chan_map;
137  Qmmp::AudioFormat m_format;
138  int m_sz;
139  int m_precision;
140 };
141 
142 #endif // AUDIOPARAMETERS_H
bool operator!=(const AudioParameters &p) const
ByteOrder byteOrder() const
quint32 sampleRate() const
static Qmmp::AudioFormat findAudioFormat(int bits, ByteOrder byteOrder=LittleEndian)
int channels() const
int validBitsPerSample() const
The AudioParameters class keeps information about audio settings.
Definition: audioparameters.h:31
bool operator==(const AudioParameters &p) const
AudioParameters & operator=(const AudioParameters &p)
Definition: audioparameters.h:40
const ChannelMap channelMap() const
Qmmp::AudioFormat format() const
int sampleSize() const
int bitsPerSample() const
AudioFormat
Definition: qmmp.h:91
int frameSize() const
const QString toString() const
ByteOrder
Definition: audioparameters.h:38
Definition: audioparameters.h:41