SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
sdrbase
audio
audioinput.h
Go to the documentation of this file.
1
// Copyright (C) 2016 Edouard Griffiths, F4EXB //
3
// //
4
// This program is free software; you can redistribute it and/or modify //
5
// it under the terms of the GNU General Public License as published by //
6
// the Free Software Foundation as version 3 of the License, or //
7
// (at your option) any later version. //
8
// //
9
// This program is distributed in the hope that it will be useful, //
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12
// GNU General Public License V3 for more details. //
13
// //
14
// You should have received a copy of the GNU General Public License //
15
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
17
18
#ifndef SDRBASE_AUDIO_AUDIOINPUT_H_
19
#define SDRBASE_AUDIO_AUDIOINPUT_H_
20
21
#include <QMutex>
22
#include <QIODevice>
23
#include <QAudioFormat>
24
#include <list>
25
#include <vector>
26
#include "
export.h
"
27
28
class
QAudioInput;
29
class
AudioFifo
;
30
class
AudioOutputPipe;
31
32
33
class
SDRBASE_API
AudioInput
:
public
QIODevice {
34
public
:
35
AudioInput
();
36
virtual
~
AudioInput
();
37
38
bool
start(
int
device,
int
rate);
39
void
stop();
40
41
void
addFifo(
AudioFifo
* audioFifo);
42
void
removeFifo(
AudioFifo
* audioFifo);
43
int
getNbFifos
()
const
{
return
m_audioFifos.size(); }
44
45
uint
getRate
()
const
{
return
m_audioFormat.sampleRate(); }
46
void
setOnExit
(
bool
onExit) { m_onExit = onExit; }
47
void
setVolume
(
float
volume) { m_volume = volume; }
48
49
private
:
50
QMutex
m_mutex
;
51
QAudioInput*
m_audioInput
;
52
uint
m_audioUsageCount
;
53
bool
m_onExit
;
54
float
m_volume
;
55
56
std::list<AudioFifo*>
m_audioFifos
;
57
std::vector<qint32>
m_mixBuffer
;
58
59
QAudioFormat
m_audioFormat
;
60
61
//virtual bool open(OpenMode mode);
62
virtual
qint64 readData(
char
* data, qint64 maxLen);
63
virtual
qint64 writeData(
const
char
* data, qint64 len);
64
65
friend
class
AudioOutputPipe;
66
};
67
68
69
70
#endif
/* SDRBASE_AUDIO_AUDIOINPUT_H_ */
AudioInput::m_audioUsageCount
uint m_audioUsageCount
Definition:
audioinput.h:52
AudioInput::m_volume
float m_volume
Definition:
audioinput.h:54
export.h
AudioInput::setOnExit
void setOnExit(bool onExit)
Definition:
audioinput.h:46
AudioInput::m_audioFifos
std::list< AudioFifo * > m_audioFifos
Definition:
audioinput.h:56
AudioInput::getNbFifos
int getNbFifos() const
Definition:
audioinput.h:43
AudioInput::m_mixBuffer
std::vector< qint32 > m_mixBuffer
Definition:
audioinput.h:57
AudioInput::m_mutex
QMutex m_mutex
Definition:
audioinput.h:50
AudioInput::m_onExit
bool m_onExit
Definition:
audioinput.h:53
AudioFifo
Definition:
audiofifo.h:29
AudioInput::m_audioFormat
QAudioFormat m_audioFormat
Definition:
audioinput.h:59
AudioInput::m_audioInput
QAudioInput * m_audioInput
Definition:
audioinput.h:51
AudioInput::setVolume
void setVolume(float volume)
Definition:
audioinput.h:47
AudioInput::getRate
uint getRate() const
Definition:
audioinput.h:45
AudioInput
Definition:
audioinput.h:33
SDRBASE_API
#define SDRBASE_API
Definition:
export.h:40
Generated on Fri Aug 2 2019 17:56:33 for SDRAngel by
1.8.13