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 
9 #include <yarp/os/ManagedBytes.h>
10 #include <yarp/os/Thread.h>
11 
12 #include <yarp/dev/DeviceDriver.h>
15 #include <portaudio.h>
16 
38  public yarp::os::Thread
39 {
40 private:
41  PaStreamParameters m_inputParameters;
42  PaStream* m_stream;
43  PaError m_err;
44 
45 public:
52 
53 public: //DeviceDriver
54  bool open(yarp::os::Searchable& config) override;
55  bool close() override;
56 
57 public: //AudioRecorderDeviceBase(IAudioGrabberSound)
58  bool startRecording() override;
59  bool stopRecording() override;
60  bool setHWGain(double gain) override;
61 
62 public: //Thread
63  void threadRelease() override;
64  bool threadInit() override;
65  void run() override;
66 
67 protected:
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)
void threadRelease() override
Release method.
PortAudioRecorderDeviceDriver(PortAudioRecorderDeviceDriver &&)=delete
bool close() override
Close the DeviceDriver.
PortAudioRecorderDeviceDriver & operator=(const PortAudioRecorderDeviceDriver &)=delete
bool stopRecording() override
Stop the recording.
PortAudioRecorderDeviceDriver & operator=(PortAudioRecorderDeviceDriver &&)=delete
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:35
A base class for nested structures that can be searched.
Definition: Searchable.h:66
An abstraction for a thread of execution.
Definition: Thread.h:22