Skip to content

Commit

Permalink
chore: buttons for sound control sliders (pitch/speed/volume)
Browse files Browse the repository at this point in the history
  • Loading branch information
MSOB7YY committed May 8, 2024
1 parent c71ac05 commit 7b811ed
Show file tree
Hide file tree
Showing 3 changed files with 234 additions and 174 deletions.
51 changes: 6 additions & 45 deletions lib/packages/miniplayer_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'dart:io';

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:namida/ui/pages/equalizer_page.dart';
import 'package:newpipeextractor_dart/newpipeextractor_dart.dart';

import 'package:namida/class/track.dart';
Expand Down Expand Up @@ -843,14 +844,15 @@ class _NamidaMiniPlayerBaseState<E> extends State<NamidaMiniPlayerBase<E>> {
max: max,
value: value.clamp(min, max),
onChanged: onChanged,
divisions: 100,
divisions: (max * 100).round(),
label: "${(value * 100).toStringAsFixed(0)}%",
);
}

NamidaNavigator.inst.navigateDialog(
dialog: CustomBlurryDialog(
title: lang.CONFIGURE,
contentPadding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 12.0),
actions: [
NamidaIconButton(
icon: Broken.refresh,
Expand All @@ -873,50 +875,9 @@ class _NamidaMiniPlayerBaseState<E> extends State<NamidaMiniPlayerBase<E>> {
},
)
],
child: ListView(
padding: const EdgeInsets.all(12.0),
shrinkWrap: true,
children: [
Obx(() => getTextWidget(Broken.airpods, lang.PITCH, settings.player.pitch.value)),
Obx(
() => getSlider(
value: settings.player.pitch.value,
onChanged: (value) {
Player.inst.setPlayerPitch(value);
settings.player.save(pitch: value);
},
),
),
const SizedBox(height: 12.0),
Obx(
() => getTextWidget(Broken.forward, lang.SPEED, settings.player.speed.value),
),
Obx(
() => getSlider(
value: settings.player.speed.value,
onChanged: (value) {
Player.inst.setPlayerSpeed(value);
settings.player.save(speed: value);
},
),
),
const SizedBox(height: 12.0),
Obx(
() => getTextWidget(settings.player.volume.value > 0 ? Broken.volume_high : Broken.volume_slash,
lang.VOLUME, settings.player.volume.value),
),
Obx(
() => getSlider(
max: 1.0,
value: settings.player.volume.value,
onChanged: (value) {
Player.inst.setPlayerVolume(value);
settings.player.save(volume: value);
},
),
),
const SizedBox(height: 12.0),
],
child: const EqualizerMainSlidersColumn(
verticalInBetweenPadding: 18.0,
tapToUpdate: false,
),
),
);
Expand Down

0 comments on commit 7b811ed

Please sign in to comment.