2023-06-12 17:44:10 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/Error.h>
|
|
|
|
#include <AK/NonnullOwnPtr.h>
|
2023-06-20 16:43:04 +00:00
|
|
|
#include <AK/NonnullRefPtr.h>
|
2024-08-28 10:08:38 +00:00
|
|
|
#include <LibMedia/Audio/Forward.h>
|
2023-06-12 17:44:10 +00:00
|
|
|
#include <LibWeb/Platform/AudioCodecPlugin.h>
|
2023-06-20 16:43:04 +00:00
|
|
|
#include <QObject>
|
2023-06-12 17:44:10 +00:00
|
|
|
|
|
|
|
namespace Ladybird {
|
|
|
|
|
2023-06-20 16:43:04 +00:00
|
|
|
class AudioThread;
|
2023-06-12 17:44:10 +00:00
|
|
|
|
2023-08-02 18:01:17 +00:00
|
|
|
class AudioCodecPluginQt final
|
2023-06-20 16:43:04 +00:00
|
|
|
: public QObject
|
|
|
|
, public Web::Platform::AudioCodecPlugin {
|
|
|
|
Q_OBJECT
|
2023-06-12 17:44:10 +00:00
|
|
|
|
2023-06-20 16:43:04 +00:00
|
|
|
public:
|
2023-08-02 18:01:17 +00:00
|
|
|
static ErrorOr<NonnullOwnPtr<AudioCodecPluginQt>> create(NonnullRefPtr<Audio::Loader>);
|
|
|
|
virtual ~AudioCodecPluginQt() override;
|
2023-06-12 17:44:10 +00:00
|
|
|
|
|
|
|
virtual void resume_playback() override;
|
|
|
|
virtual void pause_playback() override;
|
2023-06-14 16:59:22 +00:00
|
|
|
virtual void set_volume(double) override;
|
2023-06-20 16:43:04 +00:00
|
|
|
virtual void seek(double) override;
|
|
|
|
|
2024-07-17 05:46:51 +00:00
|
|
|
virtual AK::Duration duration() override;
|
2023-06-14 16:59:22 +00:00
|
|
|
|
2023-06-12 17:44:10 +00:00
|
|
|
private:
|
2023-08-02 18:01:17 +00:00
|
|
|
explicit AudioCodecPluginQt(NonnullOwnPtr<AudioThread>);
|
2023-06-12 17:44:10 +00:00
|
|
|
|
2023-06-20 16:43:04 +00:00
|
|
|
NonnullOwnPtr<AudioThread> m_audio_thread;
|
2023-06-12 17:44:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|