YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
AudioBufferSize.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_DEV_AUDIOBUFFERSIZE_H
7#define YARP_DEV_AUDIOBUFFERSIZE_H
8
9#include <yarp/os/Portable.h>
10#include <yarp/os/PortReader.h>
11#include <yarp/os/PortWriter.h>
12#include <yarp/dev/api.h>
14
15namespace yarp::dev {
16
17template <typename SAMPLE>
18class CircularAudioBuffer;
19
22{
23private:
25
26public:
27 size_t getDepth() { return m_data.m_depth; }
28 size_t getSamples() { return m_data.m_samples; }
29 size_t getChannels() { return m_data.m_channels; }
30 size_t getBufferElements() { return m_data.size; }
31 size_t getBytes() { return size_t(m_data.m_samples * m_data.m_channels * m_data.m_depth); }
32
33 bool read(yarp::os::idl::WireReader& reader) override { return m_data.read(reader); }
34 bool write(const yarp::os::idl::WireWriter& writer) const override { return m_data.write(writer); }
35 bool read(yarp::os::ConnectionReader& reader) override { return m_data.read(reader); }
36 bool write(yarp::os::ConnectionWriter& writer) const override { return m_data.write(writer); }
37
39 AudioBufferSize(size_t samples, size_t channels, size_t depth_in_bytes);
40};
41
42} // namespace yarp::dev
43
44#endif // YARP_DEV_AUDIOBUFFERSIZE_H
int16_t * samples
size_t size_t
bool write(const yarp::os::idl::WireWriter &writer) const override
bool write(yarp::os::ConnectionWriter &writer) const override
Write this object to a network connection.
bool read(yarp::os::idl::WireReader &reader) override
bool read(yarp::os::ConnectionReader &reader) override
Read this object from a network connection.
bool write(const yarp::os::idl::WireWriter &writer) const override
bool read(yarp::os::idl::WireReader &reader) override
An interface for reading from a network connection.
An interface for writing to a network connection.
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
IDL-friendly connection reader.
Definition WireReader.h:27
IDL-friendly connection writer.
Definition WireWriter.h:28
For streams capable of holding different kinds of content, check what they actually have.
#define YARP_dev_API
Definition api.h:18