mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-07-07 09:51:34 +00:00
refactor: enhance sleep timer functionality and improve duration formatting
This commit is contained in:
parent
4c5dc53169
commit
ff41bf2b4d
11 changed files with 565 additions and 298 deletions
|
|
@ -81,22 +81,17 @@ class MinimizedPlayerSettings with _$MinimizedPlayerSettings {
|
|||
_$MinimizedPlayerSettingsFromJson(json);
|
||||
}
|
||||
|
||||
enum SleepTimerShakeSenseMode { never, always, nearEnds }
|
||||
|
||||
@freezed
|
||||
class SleepTimerSettings with _$SleepTimerSettings {
|
||||
const factory SleepTimerSettings({
|
||||
@Default(Duration(minutes: 15)) Duration defaultDuration,
|
||||
@Default(SleepTimerShakeSenseMode.always)
|
||||
SleepTimerShakeSenseMode shakeSenseMode,
|
||||
|
||||
/// the duration in which the shake is detected before the end of the timer and after the timer ends
|
||||
/// only used if [shakeSenseMode] is [SleepTimerShakeSenseMode.nearEnds]
|
||||
@Default(Duration(seconds: 30)) Duration shakeSenseDuration,
|
||||
@Default(true) bool vibrateWhenReset,
|
||||
@Default(false) bool beepWhenReset,
|
||||
@Default(
|
||||
[Duration(minutes: 5), Duration(minutes: 15), Duration(minutes: 30)],
|
||||
)
|
||||
List<Duration> presetDurations,
|
||||
@Default(Duration(minutes: 100)) Duration maxDuration,
|
||||
@Default(false) bool fadeOutAudio,
|
||||
@Default(0.5) double shakeDetectThreshold,
|
||||
@Default(Duration(seconds: 20)) Duration fadeOutDuration,
|
||||
|
||||
/// if true, the player will automatically rewind the audio when the sleep timer is stopped
|
||||
@Default(false) bool autoRewindWhenStopped,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue