MythTV  master
audioinputoss.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007 Anand K. Mistry
3  * Copyright (C) 2008 Alan Calvert
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (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 Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  * 02110-1301, USA.
19  */
20 /* vim: set expandtab tabstop=4 shiftwidth=4: */
21 
22 #ifndef AUDIOINPUTOSS_H
23 #define AUDIOINPUTOSS_H
24 
25 #include "audioinput.h"
26 
27 class AudioInputOSS : public AudioInput
28 {
29  public:
30  explicit AudioInputOSS(const QString &device);
32 
33  bool Open(uint sample_bits, uint sample_rate, uint channels) override; // AudioInput
34  inline bool IsOpen(void) override // AudioInput
35  { return (m_dspFd > -1); }
36  void Close(void) override; // AudioInput
37 
38  bool Start(void) override; // AudioInput
39  bool Stop(void) override; // AudioInput
40 
41  int GetBlockSize(void) override; // AudioInput
42  int GetSamples(void *buffer, uint num_bytes) override; // AudioInput
43  int GetNumReadyBytes(void) override; // AudioInput
44 
45  private:
46  QByteArray m_deviceName;
47  int m_dspFd {-1};
48 };
49 #endif /* AUDIOINPUTOSS_H */
AudioInputOSS::~AudioInputOSS
~AudioInputOSS() override
Definition: audioinputoss.h:31
AudioInputOSS::IsOpen
bool IsOpen(void) override
Definition: audioinputoss.h:34
AudioInputOSS::GetNumReadyBytes
int GetNumReadyBytes(void) override
Definition: audioinputoss.cpp:264
AudioInputOSS::AudioInputOSS
AudioInputOSS(const QString &device)
Definition: audioinputoss.cpp:42
AudioInputOSS::GetSamples
int GetSamples(void *buffer, uint num_bytes) override
Definition: audioinputoss.cpp:234
AudioInputOSS::m_deviceName
QByteArray m_deviceName
Definition: audioinputoss.h:46
AudioInputOSS::Stop
bool Stop(void) override
Definition: audioinputoss.cpp:200
AudioInput
Definition: audioinput.h:27
AudioInputOSS::m_dspFd
int m_dspFd
Definition: audioinputoss.h:47
uint
unsigned int uint
Definition: compat.h:79
AudioInputOSS::Start
bool Start(void) override
Definition: audioinputoss.cpp:174
AudioInputOSS::Close
void Close(void) override
Definition: audioinputoss.cpp:163
AudioInputOSS::Open
bool Open(uint sample_bits, uint sample_rate, uint channels) override
Definition: audioinputoss.cpp:50
AudioInputOSS
Definition: audioinputoss.h:27
audioinput.h
AudioInputOSS::GetBlockSize
int GetBlockSize(void) override
Definition: audioinputoss.cpp:217