Handles dimension mapping, position tracking, and state synchronization.
24{
26 return;
27 }
28
30 buffer->mark_for_removal();
31 return;
32 }
33
34 try {
36
39 buffer->mark_for_removal();
40 }
41 return;
42 }
43
48 }
49 }
50 }
51
52 auto audio_buffer = std::dynamic_pointer_cast<AudioBuffer>(buffer);
53 auto& buffer_data = audio_buffer->get_data();
54 uint32_t buffer_size = audio_buffer->get_num_samples();
55
56 auto read_positions =
m_container->get_read_position();
59 : 0;
60
61 if (buffer_data.size() != buffer_size) {
62 buffer_data.resize(buffer_size);
63 }
64
66
69 }
70
72 buffer->mark_for_processing(true);
73 }
74
76
79 std::dynamic_pointer_cast<Kakshya::SoundFileContainer>(
m_container)->clear_all_consumption();
81 }
82
83 } catch (const std::exception& e) {
84 std::cerr << "Error in ContainerToBufferAdapter::process: " << e.what() << '\n';
85 }
86}
uint32_t m_source_channel
void extract_channel_data(std::span< double > output)
Extract channel data from the container into the output buffer.
std::shared_ptr< Kakshya::StreamContainer > m_container
@ READY
Container has data loaded and is ready for processing.
@ NEEDS_REMOVAL
Container is marked for removal from the system.
@ PROCESSED
Container has completed processing and results are available.