mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
SoundPlayer: Start working on a GUI sound player application
This can play anything that AWavLoader can load (so obviously only WAV files at the moment.) It works by having a timer that wakes up every 100ms and tries to send a sample buffer to the AudioServer. If our server-side queue is full then we wait until the next timer iteration and try again. We display the most recently enqueued sample buffer in a nice little widget that just plots the samples in green-on-black. :^)
This commit is contained in:
parent
6693e56603
commit
1188a036e9
6 changed files with 148 additions and 0 deletions
19
Applications/SoundPlayer/SampleWidget.h
Normal file
19
Applications/SoundPlayer/SampleWidget.h
Normal file
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGUI/GFrame.h>
|
||||
|
||||
class ABuffer;
|
||||
|
||||
class SampleWidget final : public GFrame {
|
||||
C_OBJECT(SampleWidget)
|
||||
public:
|
||||
explicit SampleWidget(GWidget* parent);
|
||||
virtual ~SampleWidget() override;
|
||||
|
||||
void set_buffer(ABuffer*);
|
||||
|
||||
private:
|
||||
virtual void paint_event(GPaintEvent&) override;
|
||||
|
||||
RefPtr<ABuffer> m_buffer;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue