diff --git a/VDownload.Core/VDownload.Core.Strings/Strings/en-US/CommonResources.resw b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/CommonResources.resw index 08fb142..9632010 100644 --- a/VDownload.Core/VDownload.Core.Strings/Strings/en-US/CommonResources.resw +++ b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/CommonResources.resw @@ -126,6 +126,33 @@ Original + + Fast + + + Faster + + + Medium + + + Slow + + + Slower + + + Super fast + + + Ultra fast + + + Very fast + + + Very slow + You are trying to download a video using a metered connection. Do you want to continue? diff --git a/VDownload.Core/VDownload.Core.Strings/Strings/en-US/SettingsViewResources.resw b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/SettingsViewResources.resw index 9ebfef6..afeb536 100644 --- a/VDownload.Core/VDownload.Core.Strings/Strings/en-US/SettingsViewResources.resw +++ b/VDownload.Core/VDownload.Core.Strings/Strings/en-US/SettingsViewResources.resw @@ -129,6 +129,27 @@ Show notifications when task ended unsuccessfully + + FFmpeg location + + + Browse + + + Processing + + + Speed + + + Use hardware acceleration + + + Use multithreading + + + Restore settings to default + Searching @@ -163,7 +184,7 @@ Maximum number of tasks running in parallel - Otherwise, default directory defined below will be used + Otherwise, default directory defined below (after expanding) will be used Save last output directory diff --git a/VDownload.Core/VDownload.Core.ViewModels/Settings/SettingsViewModel.cs b/VDownload.Core/VDownload.Core.ViewModels/Settings/SettingsViewModel.cs index fb98fa7..9ea848e 100644 --- a/VDownload.Core/VDownload.Core.ViewModels/Settings/SettingsViewModel.cs +++ b/VDownload.Core/VDownload.Core.ViewModels/Settings/SettingsViewModel.cs @@ -3,6 +3,7 @@ using CommunityToolkit.Mvvm.Input; using System; using System.Collections.Generic; using System.Linq; +using System.Reflection; using System.Text; using System.Threading.Tasks; using VDownload.Models; @@ -76,6 +77,30 @@ namespace VDownload.Core.ViewModels.Settings set => SetProperty(_settingsService.Data.Common.Tasks.DefaultOutputDirectory, value, _settingsService.Data.Common.Tasks, (u, n) => u.DefaultOutputDirectory = n); } + public string ProcessingFFmpegLocation + { + get => _settingsService.Data.Common.Processing.FFmpegLocation; + set => SetProperty(_settingsService.Data.Common.Processing.FFmpegLocation, value, _settingsService.Data.Common.Processing, (u, n) => u.FFmpegLocation = n); + } + + public bool ProcessingUseHardwareAcceleration + { + get => _settingsService.Data.Common.Processing.UseHardwareAcceleration; + set => SetProperty(_settingsService.Data.Common.Processing.UseHardwareAcceleration, value, _settingsService.Data.Common.Processing, (u, n) => u.UseHardwareAcceleration = n); + } + + public bool ProcessingUseMultithreading + { + get => _settingsService.Data.Common.Processing.UseMultithreading; + set => SetProperty(_settingsService.Data.Common.Processing.UseMultithreading, value, _settingsService.Data.Common.Processing, (u, n) => u.UseMultithreading = n); + } + + public ProcessingSpeed ProcessingSpeed + { + get => _settingsService.Data.Common.Processing.Speed; + set => SetProperty(_settingsService.Data.Common.Processing.Speed, value, _settingsService.Data.Common.Processing, (u, n) => u.Speed = n); + } + public bool NotificationsOnSuccessful { get => _settingsService.Data.Common.Notifications.OnSuccessful; @@ -177,6 +202,26 @@ namespace VDownload.Core.ViewModels.Settings } } + [RelayCommand] + public async Task BrowseProcessingFFmpegLocation() + { + string? newDirectory = await _storagePickerService.OpenDirectory(); + if (newDirectory is not null) + { + this.ProcessingFFmpegLocation = newDirectory; + } + } + + [RelayCommand] + public async Task RestoreToDefault() + { + await _settingsService.Restore(); + foreach (PropertyInfo property in this.GetType().GetProperties()) + { + base.OnPropertyChanged(property.Name); + } + } + #endregion diff --git a/VDownload.Core/VDownload.Core.Views/Settings/SettingsView.xaml b/VDownload.Core/VDownload.Core.Views/Settings/SettingsView.xaml index 97a3bdf..8fcb718 100644 --- a/VDownload.Core/VDownload.Core.Views/Settings/SettingsView.xaml +++ b/VDownload.Core/VDownload.Core.Views/Settings/SettingsView.xaml @@ -122,6 +122,78 @@ + + + + + + + +