Rerun C++ SDK
Loading...
Searching...
No Matches
audio_playback.hpp
1// DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/cpp/mod.rs
2// Based on "crates/build/re_type_definitions/rerun/blueprint/archetypes/audio_playback.def.rs".
3
4#pragma once
5
6#include "../../blueprint/components/volume.hpp"
7#include "../../collection.hpp"
8#include "../../component_batch.hpp"
9#include "../../component_column.hpp"
10#include "../../result.hpp"
11
12#include <cstdint>
13#include <optional>
14#include <utility>
15#include <vector>
16
17namespace rerun::blueprint::archetypes {
18 /// **Archetype**: Playback settings for an audio view.
19 ///
20 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
21 ///
23 /// Playback volume, from 0.0 (silent) to 1.0 (full).
24 ///
25 /// Defaults to 1.0.
26 std::optional<ComponentBatch> volume;
27
28 public:
29 /// The name of the archetype as used in `ComponentDescriptor`s.
30 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.AudioPlayback";
31
32 /// `ComponentDescriptor` for the `volume` field.
33 static constexpr auto Descriptor_volume = ComponentDescriptor(
34 ArchetypeName, "AudioPlayback:volume",
36 );
37
38 public:
39 AudioPlayback() = default;
40 AudioPlayback(AudioPlayback&& other) = default;
41 AudioPlayback(const AudioPlayback& other) = default;
42 AudioPlayback& operator=(const AudioPlayback& other) = default;
43 AudioPlayback& operator=(AudioPlayback&& other) = default;
44
45 /// Update only some specific fields of a `AudioPlayback`.
47 return AudioPlayback();
48 }
49
50 /// Clear all the fields of a `AudioPlayback`.
52
53 /// Playback volume, from 0.0 (silent) to 1.0 (full).
54 ///
55 /// Defaults to 1.0.
57 volume = ComponentBatch::from_loggable(_volume, Descriptor_volume).value_or_throw();
58 return std::move(*this);
59 }
60
61 /// Partitions the component data into multiple sub-batches.
62 ///
63 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
64 /// instead, via `ComponentBatch::partitioned`.
65 ///
66 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
67 ///
68 /// The specified `lengths` must sum to the total length of the component batch.
70
71 /// Partitions the component data into unit-length sub-batches.
72 ///
73 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
74 /// where `n` is automatically guessed.
76 };
77
78} // namespace rerun::blueprint::archetypes
79
80namespace rerun {
81 /// \private
82 template <typename T>
83 struct AsComponents;
84
85 /// \private
86 template <>
87 struct AsComponents<blueprint::archetypes::AudioPlayback> {
88 /// Serialize all set component batches.
89 static Result<Collection<ComponentBatch>> as_batches(
91 );
92 };
93} // namespace rerun
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
A class for representing either a usable value, or an error.
Definition result.hpp:14
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:26
static Result< ComponentBatch > from_loggable(const rerun::Collection< T > &components, const ComponentDescriptor &descriptor)
Creates a new component batch from a collection of component instances.
Definition component_batch.hpp:46
A ComponentDescriptor fully describes the semantics of a column of data.
Definition component_descriptor.hpp:16
The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a colle...
Definition loggable.hpp:11
Archetype: Playback settings for an audio view.
Definition audio_playback.hpp:22
static AudioPlayback clear_fields()
Clear all the fields of a AudioPlayback.
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
static AudioPlayback update_fields()
Update only some specific fields of a AudioPlayback.
Definition audio_playback.hpp:46
static constexpr auto Descriptor_volume
ComponentDescriptor for the volume field.
Definition audio_playback.hpp:33
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition audio_playback.hpp:30
AudioPlayback with_volume(const rerun::blueprint::components::Volume &_volume) &&
Playback volume, from 0.0 (silent) to 1.0 (full).
Definition audio_playback.hpp:56
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
std::optional< ComponentBatch > volume
Playback volume, from 0.0 (silent) to 1.0 (full).
Definition audio_playback.hpp:26
Component: Playback volume, as a multiplier applied to the audio samples.
Definition volume.hpp:20