mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-16 00:13:55 +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];
|
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
|
* 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
|
* 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];
|
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;
|
Config config;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user