25 struct PlayableSampleSingleChannel
27 using UnmutableSampleSpan = std::span<const float>;
28 PlayableSampleSingleChannel (
29 UnmutableSampleSpan buf,
30 uint8_t channel_index,
32 units::sample_u32_t start_offset,
33 std::source_location source_location)
35 start_offset_ (start_offset), source_location_ (source_location)
58 std::source_location source_location_;
61 using QueueSingleChannelSampleCallback =
74 if (sample.buf_.empty ()) [[unlikely]]
80 samples_to_play_.emplace_back (sample);
81 if (queue_sample_cb_.has_value ())
83 std::invoke (queue_sample_cb_.value (), sample);
87 void set_queue_sample_callback (QueueSingleChannelSampleCallback cb)
89 queue_sample_cb_ = std::move (cb);
92 auto get_output_audio_port_non_rt ()
const
97 auto get_output_audio_port_rt ()
const {
return audio_out_; }
102 const dsp::TempoMap &tempo_map)
noexcept override;
104 void custom_prepare_for_processing (
106 units::sample_rate_t sample_rate,
107 units::sample_u32_t max_block_length)
override
109 samples_to_play_.clear ();
110 audio_out_ = get_output_ports ()[0].get_object_as<
dsp::AudioPort> ();
113 void custom_release_resources ()
override
115 samples_to_play_.clear ();
116 audio_out_ =
nullptr;
125 boost::container::static_vector<PlayableSampleSingleChannel, 128>
133 std::optional<QueueSingleChannelSampleCallback> queue_sample_cb_;
135 AudioPort * audio_out_{};
void custom_process_block(dsp::graph::ProcessBlockInfo time_nfo, const dsp::ITransport &transport, const dsp::TempoMap &tempo_map) noexcept override
Custom processor logic after processing all owned parameters.