feat: raise maximum volume (#384)

* feat: raise maximum volume

* feat: raise maximum volume

* feat: raise maximum volume

* feat: add volume settings menu

* feat: move binding

* Update modules/menus/audio/active/SelectedPlayback.ts

Co-authored-by: Jas Singh <jaskiratpal.singh@outlook.com>

---------

Co-authored-by: Jas Singh <jaskiratpal.singh@outlook.com>
This commit is contained in:
Rubin Bhandari
2024-10-30 09:17:31 +05:45
committed by GitHub
parent d881efcb77
commit a64fd64ac0
5 changed files with 40 additions and 1 deletions

View File

@@ -2,6 +2,9 @@ const audio = await Service.import('audio');
import { getIcon } from '../utils.js';
import Box from 'types/widgets/box.js';
import { Attribute, Child } from 'lib/types/widget.js';
import options from 'options';
const { raiseMaximumVolume } = options.menus.volume;
const renderActivePlayback = (): Box<Child, Attribute>[] => {
return [
@@ -52,6 +55,11 @@ const renderActivePlayback = (): Box<Child, Attribute>[] => {
min: 0,
max: 1,
onChange: ({ value }) => (audio.speaker.volume = value),
setup: (self) => {
self.hook(raiseMaximumVolume, () => {
self.max = raiseMaximumVolume.value ? 1.5 : 1;
});
},
}),
],
}),