mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
LibWeb: Expose volume controls through the platform audio plugin
This commit is contained in:
parent
d364d99cb8
commit
d3b8d88598
Notes:
sideshowbarker
2024-07-16 22:18:54 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/d3b8d88598 Pull-request: https://github.com/SerenityOS/serenity/pull/19409
5 changed files with 16 additions and 0 deletions
|
@ -86,4 +86,9 @@ void AudioCodecPluginLadybird::playback_ended()
|
||||||
m_audio_output->suspend();
|
m_audio_output->suspend();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AudioCodecPluginLadybird::set_volume(double volume)
|
||||||
|
{
|
||||||
|
m_audio_output->setVolume(volume);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,8 @@ public:
|
||||||
virtual void pause_playback() override;
|
virtual void pause_playback() override;
|
||||||
virtual void playback_ended() override;
|
virtual void playback_ended() override;
|
||||||
|
|
||||||
|
virtual void set_volume(double) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AudioCodecPluginLadybird(NonnullOwnPtr<QMediaDevices>, NonnullOwnPtr<QAudioSink>);
|
AudioCodecPluginLadybird(NonnullOwnPtr<QMediaDevices>, NonnullOwnPtr<QAudioSink>);
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,8 @@ public:
|
||||||
virtual void pause_playback() = 0;
|
virtual void pause_playback() = 0;
|
||||||
virtual void playback_ended() = 0;
|
virtual void playback_ended() = 0;
|
||||||
|
|
||||||
|
virtual void set_volume(double) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
AudioCodecPlugin();
|
AudioCodecPlugin();
|
||||||
};
|
};
|
||||||
|
|
|
@ -56,4 +56,9 @@ void AudioCodecPluginSerenity::playback_ended()
|
||||||
m_connection->async_clear_buffer();
|
m_connection->async_clear_buffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AudioCodecPluginSerenity::set_volume(double volume)
|
||||||
|
{
|
||||||
|
m_connection->async_set_self_volume(volume);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,8 @@ public:
|
||||||
virtual void pause_playback() override;
|
virtual void pause_playback() override;
|
||||||
virtual void playback_ended() override;
|
virtual void playback_ended() override;
|
||||||
|
|
||||||
|
virtual void set_volume(double) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit AudioCodecPluginSerenity(NonnullRefPtr<Audio::ConnectionToServer>);
|
explicit AudioCodecPluginSerenity(NonnullRefPtr<Audio::ConnectionToServer>);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue