summaryrefslogtreecommitdiff
path: root/Applications/Piano/TrackManager.cpp
diff options
context:
space:
mode:
authorasynts <asynts@gmail.com>2020-09-06 21:40:46 +0200
committerAndreas Kling <kling@serenityos.org>2020-09-08 14:01:21 +0200
commit9c83d6ff468870c58f2a81673b29d96106f543fb (patch)
tree0a66b1d4477cae34d806360daa739cd3a4bd7e45 /Applications/Piano/TrackManager.cpp
parent76e37e8c968e62abf597afdd4554714c6d40ef92 (diff)
downloadserenity-9c83d6ff468870c58f2a81673b29d96106f543fb.zip
Refactor: Replace usages of FixedArray with Array.
Diffstat (limited to 'Applications/Piano/TrackManager.cpp')
-rw-r--r--Applications/Piano/TrackManager.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Applications/Piano/TrackManager.cpp b/Applications/Piano/TrackManager.cpp
index 18ae568d09..5aa1856a11 100644
--- a/Applications/Piano/TrackManager.cpp
+++ b/Applications/Piano/TrackManager.cpp
@@ -36,7 +36,7 @@ TrackManager::~TrackManager()
{
}
-void TrackManager::fill_buffer(FixedArray<Sample>& buffer)
+void TrackManager::fill_buffer(Span<Sample> buffer)
{
memset(buffer.data(), 0, buffer_size);
@@ -51,8 +51,8 @@ void TrackManager::fill_buffer(FixedArray<Sample>& buffer)
}
}
- memcpy(m_back_buffer_ptr->data(), buffer.data(), buffer_size);
- swap(m_front_buffer_ptr, m_back_buffer_ptr);
+ memcpy(m_current_back_buffer.data(), buffer.data(), buffer_size);
+ swap(m_current_front_buffer, m_current_back_buffer);
}
void TrackManager::reset()
@@ -60,8 +60,8 @@ void TrackManager::reset()
memset(m_front_buffer.data(), 0, buffer_size);
memset(m_back_buffer.data(), 0, buffer_size);
- m_front_buffer_ptr = &m_front_buffer;
- m_back_buffer_ptr = &m_back_buffer;
+ m_current_front_buffer = m_front_buffer.span();
+ m_current_back_buffer = m_back_buffer.span();
m_time = 0;