mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 12:30:12 +02:00
Add constant overloads for audio buffer pointers
This commit is contained in:
@@ -145,6 +145,13 @@ class AudioShmBuffer {
|
||||
config.input_offsets[bus][channel];
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
const T* input_channel_ptr(const uint32_t bus,
|
||||
const uint32_t channel) const noexcept {
|
||||
return reinterpret_cast<const T*>(buffer.get_address()) +
|
||||
config.input_offsets[bus][channel];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a pointer to the part of the buffer where this output audio channel
|
||||
* is stored in. Both the bus and the channel indices start at zero. These
|
||||
@@ -156,6 +163,13 @@ class AudioShmBuffer {
|
||||
config.output_offsets[bus][channel];
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
const T* output_channel_ptr(const uint32_t bus,
|
||||
const uint32_t channel) const noexcept {
|
||||
return reinterpret_cast<const T*>(buffer.get_address()) +
|
||||
config.output_offsets[bus][channel];
|
||||
}
|
||||
|
||||
Config config;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user