YARP
Yet Another Robot Platform
ServerSoundGrabber.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006 Julio Gomes
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARP_DEV_SERVERSOUNDGRABBER_H
11 #define YARP_DEV_SERVERSOUNDGRABBER_H
12 
13 #include <yarp/os/Port.h>
14 #include <yarp/os/Stamp.h>
15 #include <yarp/os/Thread.h>
16 
18 #include <yarp/dev/PolyDriver.h>
19 
20 
33  private yarp::os::Thread,
35 {
36 private:
37  yarp::os::Stamp stamp;
39  yarp::dev::IAudioGrabberSound* mic{nullptr}; //The microphone device
40  yarp::os::Port rpcPort;
41  yarp::os::Port streamingPort;
42 #ifdef DEBUG_TIME_SPENT
43  double last_time;
44 #endif
45 public:
51 
52  ~ServerSoundGrabber() override;
53 
54 
65  bool open(yarp::os::Searchable& config) override;
66  bool close() override;
67 
68  void run() override;
69 
70  bool read(yarp::os::ConnectionReader& connection) override;
71 };
72 
73 #endif // YARP_DEV_SERVERSOUNDGRABBER_H
Export a microphone device.
bool close() override
Close the DeviceDriver.
bool open(yarp::os::Searchable &config) override
Configure with a set of options.
ServerSoundGrabber(const ServerSoundGrabber &)=delete
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
ServerSoundGrabber(ServerSoundGrabber &&)=delete
ServerSoundGrabber & operator=(const ServerSoundGrabber &)=delete
void run() override
Main body of the new thread.
ServerSoundGrabber & operator=(ServerSoundGrabber &&)=delete
Interface implemented by deprecated device drivers.
Definition: DeviceDriver.h:119
Read a YARP-format sound block from a device.
A container for a device driver.
Definition: PolyDriver.h:27
An interface for reading from a network connection.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition: PortReader.h:28
A mini-server for network communication.
Definition: Port.h:50
A base class for nested structures that can be searched.
Definition: Searchable.h:69
An abstraction for a time stamp and/or sequence number.
Definition: Stamp.h:25
An abstraction for a thread of execution.
Definition: Thread.h:25