2024-01-30 11:29:07 -05:00
|
|
|
const Audio = await Service.import('audio');
|
|
|
|
const { Label, Icon } = Widget;
|
2023-12-28 00:19:57 -05:00
|
|
|
|
2024-01-13 23:38:31 -05:00
|
|
|
import { SpeakerIcon } from '../../misc/audio-icons.ts';
|
|
|
|
import HoverRevealer from './hover-revealer.ts';
|
2023-12-28 00:19:57 -05:00
|
|
|
|
|
|
|
|
|
|
|
export default () => HoverRevealer({
|
|
|
|
class_name: 'audio',
|
|
|
|
|
|
|
|
icon: Icon({
|
|
|
|
icon: SpeakerIcon.bind(),
|
|
|
|
}),
|
|
|
|
|
|
|
|
label: Label().hook(Audio, (self) => {
|
|
|
|
if (Audio.speaker?.volume) {
|
|
|
|
self.label =
|
|
|
|
`${Math.round(Audio.speaker?.volume * 100)}%`;
|
|
|
|
}
|
|
|
|
}, 'speaker-changed'),
|
|
|
|
});
|