Instead of tracking in-flight seeks across all the sinks in the seeking state handler, move the logic to PlaybackManager to determine the overall status and then notify the state of that status to potentially trigger resumption. The buffering state handler can then share essentially the same logic instead of having the playback manager specifically track the blocked tracks for it.
36 lines
861 B
C++
36 lines
861 B
C++
/*
|
|
* Copyright (c) 2025, Gregory Bertilson <zaggy1024@gmail.com>
|
|
* Copyright (c) 2025, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibMedia/PlaybackStates/Forward.h>
|
|
#include <LibMedia/PlaybackStates/ResumingStateHandler.h>
|
|
|
|
namespace Media {
|
|
|
|
class BufferingStateHandler final : public ResumingStateHandler {
|
|
public:
|
|
BufferingStateHandler(PlaybackManager& manager, bool playing)
|
|
: ResumingStateHandler(manager, playing)
|
|
{
|
|
}
|
|
|
|
virtual ~BufferingStateHandler() override = default;
|
|
|
|
virtual PlaybackState state() override
|
|
{
|
|
return PlaybackState::Buffering;
|
|
}
|
|
virtual AvailableData available_data() override
|
|
{
|
|
return AvailableData::Current;
|
|
}
|
|
|
|
virtual void on_pipeline_status_changed(PipelineStatus) override;
|
|
};
|
|
|
|
}
|