MythTV
master
mythtv
libs
libmythtv
recorders
audioinput.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2007 Anand K. Mistry
3
*
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (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 for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17
* 02110-1301, USA.
18
*/
19
/* vim: set expandtab tabstop=4 shiftwidth=4: */
20
21
#ifndef AUDIOINPUT_H
22
#define AUDIOINPUT_H
23
24
#include <QString>
25
#include <unistd.h>
26
27
class
AudioInput
28
{
29
public
:
30
virtual
~AudioInput
() =
default
;
31
32
virtual
bool
Open
(
uint
sample_bits,
uint
sample_rate,
uint
channels) = 0;
33
virtual
bool
IsOpen
(
void
) = 0;
34
virtual
void
Close
(
void
) = 0;
35
36
virtual
bool
Start
(
void
) = 0;
37
virtual
bool
Stop
(
void
) = 0;
38
39
virtual
int
GetBlockSize
(
void
) = 0;
40
virtual
int
GetSamples
(
void
*buf,
uint
nbytes) = 0;
41
virtual
int
GetNumReadyBytes
(
void
) = 0;
42
43
// Factory function
44
static
AudioInput
*
CreateDevice
(
const
QByteArray &device);
45
46
protected
:
47
explicit
AudioInput
(
const
QString &device)
48
:
m_audioDevice
(device.toLatin1()) {}
49
50
QByteArray
m_audioDevice
;
51
int
m_audioChannels
{0};
52
int
m_audioSampleBits
{0};
53
int
m_audioSampleRate
{0};
54
};
55
#endif
/* AUDIOINPUT_H */
AudioInput::Stop
virtual bool Stop(void)=0
AudioInput::m_audioChannels
int m_audioChannels
Definition:
audioinput.h:51
AudioInput::GetBlockSize
virtual int GetBlockSize(void)=0
AudioInput::GetSamples
virtual int GetSamples(void *buf, uint nbytes)=0
AudioInput::~AudioInput
virtual ~AudioInput()=default
AudioInput::IsOpen
virtual bool IsOpen(void)=0
AudioInput::Start
virtual bool Start(void)=0
AudioInput::Open
virtual bool Open(uint sample_bits, uint sample_rate, uint channels)=0
AudioInput
Definition:
audioinput.h:27
AudioInput::AudioInput
AudioInput(const QString &device)
Definition:
audioinput.h:47
AudioInput::GetNumReadyBytes
virtual int GetNumReadyBytes(void)=0
AudioInput::m_audioSampleRate
int m_audioSampleRate
Definition:
audioinput.h:53
AudioInput::Close
virtual void Close(void)=0
AudioInput::m_audioSampleBits
int m_audioSampleBits
Definition:
audioinput.h:52
AudioInput::m_audioDevice
QByteArray m_audioDevice
Definition:
audioinput.h:50
AudioInput::CreateDevice
static AudioInput * CreateDevice(const QByteArray &device)
Definition:
audioinput.cpp:30
uint
unsigned int uint
Definition:
freesurround.h:24
Generated on Wed Feb 26 2025 03:17:59 for MythTV by
1.8.17