Miam-Player  0.8.0
A nice music player
AudioFrame.h
Go to the documentation of this file.
1 /******************************************************************************
2  QtAV: Multimedia framework based on Qt and FFmpeg
3  Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
4 
5 * This file is part of QtAV
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Lesser General Public
9  License as published by the Free Software Foundation; either
10  version 2.1 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public
18  License along with this library; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 ******************************************************************************/
21 
22 #ifndef QTAV_AUDIOFRAME_H
23 #define QTAV_AUDIOFRAME_H
24 
25 #include <QtAV/Frame.h>
26 #include <QtAV/AudioFormat.h>
27 
28 namespace QtAV {
29 class AudioResampler;
30 class AudioFramePrivate;
32 {
33  Q_DECLARE_PRIVATE(AudioFrame)
34 public:
35  //data must be complete
40  AudioFrame(const AudioFormat& format = AudioFormat(), const QByteArray& data = QByteArray());
41  AudioFrame(const AudioFrame &other);
42  virtual ~AudioFrame();
43  AudioFrame &operator =(const AudioFrame &other);
44 
45  bool isValid() const;
46  operator bool() const { return isValid();}
47 
53  QByteArray data();
54  virtual int channelCount() const;
59  AudioFrame clone() const;
60  AudioFormat format() const;
61  void setSamplesPerChannel(int samples);
62  // may change after resampling
63  int samplesPerChannel() const;
64  AudioFrame to(const AudioFormat& fmt) const;
65  //AudioResamplerId
66  void setAudioResampler(AudioResampler *conv); //TODO: remove
73  qint64 duration() const;
74 };
75 } //namespace QtAV
76 Q_DECLARE_METATYPE(QtAV::AudioFrame)
77 #endif // QTAV_AUDIOFRAME_H
Definition: Frame.h:33
#define Q_AV_EXPORT
Definition: QtAV_Global.h:40
Definition: AudioFrame.h:31
Definition: AudioFormat.h:35
Definition: AudioResampler.h:32
AudioOutput ao; ao.setAudioFormat(fmt); ao.open(); while (has_data) { data = read_data(ao->bufferSize...
Definition: AudioDecoder.h:31