Fix a misuse of const qualification in AudioSpan
This commit is contained in:
parent
01a26787e3
commit
824689e38a
3 changed files with 8 additions and 8 deletions
|
|
@ -200,7 +200,7 @@ public:
|
||||||
* @param channelIndex the channel
|
* @param channelIndex the channel
|
||||||
* @return Type* the raw pointer to the channel
|
* @return Type* the raw pointer to the channel
|
||||||
*/
|
*/
|
||||||
Type* getChannel(size_t channelIndex)
|
Type* getChannel(size_t channelIndex) const
|
||||||
{
|
{
|
||||||
ASSERT(channelIndex < numChannels);
|
ASSERT(channelIndex < numChannels);
|
||||||
if (channelIndex < numChannels)
|
if (channelIndex < numChannels)
|
||||||
|
|
@ -231,7 +231,7 @@ public:
|
||||||
* @param channelIndex the channel
|
* @param channelIndex the channel
|
||||||
* @return absl::Span<Type>
|
* @return absl::Span<Type>
|
||||||
*/
|
*/
|
||||||
absl::Span<Type> getSpan(size_t channelIndex)
|
absl::Span<Type> getSpan(size_t channelIndex) const
|
||||||
{
|
{
|
||||||
ASSERT(channelIndex < numChannels);
|
ASSERT(channelIndex < numChannels);
|
||||||
if (channelIndex < numChannels)
|
if (channelIndex < numChannels)
|
||||||
|
|
@ -402,7 +402,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param length the number of elements to take on each channel
|
* @param length the number of elements to take on each channel
|
||||||
*/
|
*/
|
||||||
AudioSpan<Type> first(size_type length)
|
AudioSpan<Type> first(size_type length) const
|
||||||
{
|
{
|
||||||
ASSERT(length <= numFrames);
|
ASSERT(length <= numFrames);
|
||||||
return { spans, numChannels, 0, length };
|
return { spans, numChannels, 0, length };
|
||||||
|
|
@ -413,7 +413,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param length the number of elements to take on each channel
|
* @param length the number of elements to take on each channel
|
||||||
*/
|
*/
|
||||||
AudioSpan<Type> last(size_type length)
|
AudioSpan<Type> last(size_type length) const
|
||||||
{
|
{
|
||||||
ASSERT(length <= numFrames);
|
ASSERT(length <= numFrames);
|
||||||
return { spans, numChannels, numFrames - length, length };
|
return { spans, numChannels, numFrames - length, length };
|
||||||
|
|
@ -427,7 +427,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param length the number of elements to take on each channel
|
* @param length the number of elements to take on each channel
|
||||||
*/
|
*/
|
||||||
AudioSpan<Type> subspan(size_type offset, size_type length)
|
AudioSpan<Type> subspan(size_type offset, size_type length) const
|
||||||
{
|
{
|
||||||
ASSERT(length + offset <= numFrames);
|
ASSERT(length + offset <= numFrames);
|
||||||
return { spans, numChannels, offset, length };
|
return { spans, numChannels, offset, length };
|
||||||
|
|
@ -440,7 +440,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param length the number of elements to take on each channel
|
* @param length the number of elements to take on each channel
|
||||||
*/
|
*/
|
||||||
AudioSpan<Type> subspan(size_type offset)
|
AudioSpan<Type> subspan(size_type offset) const
|
||||||
{
|
{
|
||||||
ASSERT(offset <= numFrames);
|
ASSERT(offset <= numFrames);
|
||||||
return { spans, numChannels, offset, numFrames - offset };
|
return { spans, numChannels, offset, numFrames - offset };
|
||||||
|
|
|
||||||
|
|
@ -615,7 +615,7 @@ void sfz::Voice::fillWithData(AudioSpan<float> buffer) noexcept
|
||||||
|
|
||||||
template <sfz::InterpolatorModel M>
|
template <sfz::InterpolatorModel M>
|
||||||
void sfz::Voice::fillInterpolated(
|
void sfz::Voice::fillInterpolated(
|
||||||
const sfz::AudioSpan<const float>& source, sfz::AudioSpan<float>& dest,
|
const sfz::AudioSpan<const float>& source, const sfz::AudioSpan<float>& dest,
|
||||||
absl::Span<const int> indices, absl::Span<const float> coeffs)
|
absl::Span<const int> indices, absl::Span<const float> coeffs)
|
||||||
{
|
{
|
||||||
auto ind = indices.data();
|
auto ind = indices.data();
|
||||||
|
|
|
||||||
|
|
@ -376,7 +376,7 @@ private:
|
||||||
*/
|
*/
|
||||||
template <InterpolatorModel M>
|
template <InterpolatorModel M>
|
||||||
static void fillInterpolated(
|
static void fillInterpolated(
|
||||||
const AudioSpan<const float>& source, AudioSpan<float>& dest,
|
const AudioSpan<const float>& source, const AudioSpan<float>& dest,
|
||||||
absl::Span<const int> indices, absl::Span<const float> coeffs);
|
absl::Span<const int> indices, absl::Span<const float> coeffs);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue