1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:08:10 +00:00

Applications+Userland: Switch to new Audio::Loader API

This commit is contained in:
Julian Offenhäuser 2020-12-01 20:20:46 +01:00 committed by Andreas Kling
parent 1f47b01e3b
commit bad8cd3d8f
5 changed files with 31 additions and 35 deletions

View file

@ -41,10 +41,10 @@ PlaybackManager::~PlaybackManager()
{
}
void PlaybackManager::set_loader(OwnPtr<Audio::WavLoader>&& loader)
void PlaybackManager::set_loader(NonnullRefPtr<Audio::Loader>&& loader)
{
stop();
m_loader = move(loader);
m_loader = loader;
if (m_loader) {
m_total_length = m_loader->total_samples() / static_cast<float>(m_loader->sample_rate());
m_timer->start();