YARP
Yet Another Robot Platform
AudioBufferSize.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_DEV_AUDIOBUFFERSIZE_H
10 #define YARP_DEV_AUDIOBUFFERSIZE_H
11 
12 #include <yarp/os/Portable.h>
13 #include <yarp/os/PortReader.h>
14 #include <yarp/os/PortWriter.h>
15 #include <yarp/dev/api.h>
17 
18 namespace yarp {
19 namespace dev {
20 
21 template <typename SAMPLE>
22 class CircularAudioBuffer;
23 
25  private audioBufferSizeData
26 {
27  template <typename SAMPLE>
28  friend class CircularAudioBuffer;
29 
30 public:
31  size_t getSamples() { return m_samples; }
32  size_t getChannels() { return m_channels; }
33  size_t getBufferElements() { return size; }
34  size_t getBytes() { return m_samples * m_channels * m_depth; }
35 
36  bool read(yarp::os::idl::WireReader& reader) override { return audioBufferSizeData::read(reader); }
37  bool write(const yarp::os::idl::WireWriter& writer) const override { return audioBufferSizeData::write(writer); }
38  bool read(yarp::os::ConnectionReader& reader) override { return audioBufferSizeData::read(reader); }
39  bool write(yarp::os::ConnectionWriter& writer) const override { return audioBufferSizeData::write(writer); }
40 
42  AudioBufferSize(size_t samples, size_t channels, size_t depth_in_bytes);
43 };
44 
45 } // namespace dev
46 } // namespace yarp
47 
48 #endif // YARP_DEV_AUDIOBUFFERSIZE_H
yarp::dev::audioBufferSizeData::read
bool read(yarp::os::idl::WireReader &reader) override
Definition: audioBufferSizeData.cpp:43
yarp::dev::AudioBufferSize
Definition: AudioBufferSize.h:26
yarp::dev::AudioBufferSize::getChannels
size_t getChannels()
Definition: AudioBufferSize.h:32
Portable.h
yarp::dev::AudioBufferSize::AudioBufferSize
AudioBufferSize()
audioBufferSizeData.h
yarp::dev::AudioBufferSize::read
bool read(yarp::os::ConnectionReader &reader) override
Read this object from a network connection.
Definition: AudioBufferSize.h:38
samples
int16_t * samples
Definition: FfmpegWriter.cpp:76
yarp::dev::AudioBufferSize::write
bool write(const yarp::os::idl::WireWriter &writer) const override
Definition: AudioBufferSize.h:37
yarp::os::idl::WireWriter
IDL-friendly connection writer.
Definition: WireWriter.h:33
yarp::dev::CircularAudioBuffer
Definition: CircularAudioBuffer.h:25
PortWriter.h
yarp::dev::audioBufferSizeData
Definition: audioBufferSizeData.h:27
yarp::dev::AudioBufferSize::getBytes
size_t getBytes()
Definition: AudioBufferSize.h:34
yarp::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:40
yarp::dev::AudioBufferSize::read
bool read(yarp::os::idl::WireReader &reader) override
Definition: AudioBufferSize.h:36
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp::dev::AudioBufferSize::write
bool write(yarp::os::ConnectionWriter &writer) const override
Write this object to a network connection.
Definition: AudioBufferSize.h:39
yarp::dev::AudioBufferSize::getSamples
size_t getSamples()
Definition: AudioBufferSize.h:31
yarp::os::idl::WireReader
IDL-friendly connection reader.
Definition: WireReader.h:33
yarp::os::ConnectionReader
An interface for reading from a network connection.
Definition: ConnectionReader.h:40
yarp::dev::AudioBufferSize::getBufferElements
size_t getBufferElements()
Definition: AudioBufferSize.h:33
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
PortReader.h
api.h
yarp::dev::audioBufferSizeData::write
bool write(const yarp::os::idl::WireWriter &writer) const override
Definition: audioBufferSizeData.cpp:71