mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-18 00:09:44 +00:00
SoundPlayer: Adapt the existing SampleWidget visualization to
the new abstraction
This commit is contained in:
parent
876c62409a
commit
45e928bfb2
Notes:
sideshowbarker
2024-07-18 21:02:57 +09:00
Author: https://github.com/ngc6302h
Commit: 45e928bfb2
Pull-request: https://github.com/SerenityOS/serenity/pull/5878
Reviewed-by: https://github.com/Dexesttp
Reviewed-by: https://github.com/RealKC
Reviewed-by: https://github.com/alimpfard
2 changed files with 5 additions and 3 deletions
|
@ -73,7 +73,7 @@ void SampleWidget::paint_event(GUI::PaintEvent& event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SampleWidget::set_buffer(Audio::Buffer* buffer)
|
void SampleWidget::set_buffer(RefPtr<Audio::Buffer> buffer)
|
||||||
{
|
{
|
||||||
if (m_buffer == buffer)
|
if (m_buffer == buffer)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -26,18 +26,20 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "VisualizationBase.h"
|
||||||
#include <LibGUI/Frame.h>
|
#include <LibGUI/Frame.h>
|
||||||
|
|
||||||
namespace Audio {
|
namespace Audio {
|
||||||
class Buffer;
|
class Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
class SampleWidget final : public GUI::Frame {
|
class SampleWidget final : public GUI::Frame
|
||||||
|
, public Visualization {
|
||||||
C_OBJECT(SampleWidget)
|
C_OBJECT(SampleWidget)
|
||||||
public:
|
public:
|
||||||
virtual ~SampleWidget() override;
|
virtual ~SampleWidget() override;
|
||||||
|
|
||||||
void set_buffer(Audio::Buffer*);
|
void set_buffer(RefPtr<Audio::Buffer>) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SampleWidget();
|
SampleWidget();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue