YARP
Yet Another Robot Platform
PortAudioRecorderDeviceDriver.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: LGPL-2.1-or-later
4 */
5
6#ifndef PortAudioRecorderDeviceDriverh
7#define PortAudioRecorderDeviceDriverh
8
10#include <yarp/os/Thread.h>
11
15#include <portaudio.h>
16
38 public yarp::os::Thread
39{
40private:
41 PaStreamParameters m_inputParameters;
42 PaStream* m_stream;
43 PaError m_err;
44
45public:
52
53public: //DeviceDriver
54 bool open(yarp::os::Searchable& config) override;
55 bool close() override;
56
57public: //AudioRecorderDeviceBase(IAudioGrabberSound)
58 bool startRecording() override;
59 bool stopRecording() override;
60 bool setHWGain(double gain) override;
61
62public: //Thread
63 void threadRelease() override;
64 bool threadInit() override;
65 void run() override;
66
67protected:
71 void handleError();
72};
73
74#endif
portaudioRecorder: A device driver for an audio source wrapped by PortAudio library.
bool startRecording() override
Start the recording.
PortAudioRecorderDeviceDriver(const PortAudioRecorderDeviceDriver &)=delete
void run() override
Main body of the new thread.
bool threadInit() override
Initialization method.
bool setHWGain(double gain) override
Sets the hardware gain of the grabbing device (if supported by the hardware)
PortAudioRecorderDeviceDriver & operator=(PortAudioRecorderDeviceDriver &&)=delete
void threadRelease() override
Release method.
PortAudioRecorderDeviceDriver & operator=(const PortAudioRecorderDeviceDriver &)=delete
PortAudioRecorderDeviceDriver(PortAudioRecorderDeviceDriver &&)=delete
bool close() override
Close the DeviceDriver.
bool stopRecording() override
Stop the recording.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
AudioRecorderDeviceBase : a base class for all audio recorder devices
Interface implemented by all device drivers.
Definition: DeviceDriver.h:30
A base class for nested structures that can be searched.
Definition: Searchable.h:63
An abstraction for a thread of execution.
Definition: Thread.h:21