-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
466 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
using System; | ||
using System.IO; | ||
using GalaSoft.MvvmLight; | ||
|
||
namespace FishMusic.Download | ||
{ | ||
public class DownloadSettings : ViewModelBase | ||
{ | ||
private int _bitRate; | ||
private int _lossType; | ||
private string _downPath; | ||
private string _userFolder; | ||
private string _userName; | ||
private int _nameSelect; | ||
private int _folderSelect; | ||
private bool _downPic; | ||
private bool _downLrc; | ||
private bool _enableUserSetting; | ||
|
||
public int BitRate | ||
{ | ||
get => _bitRate; | ||
set | ||
{ | ||
_bitRate = value; | ||
RaisePropertyChanged("BitRate"); | ||
} | ||
} | ||
|
||
public int LossType | ||
{ | ||
get => _lossType; | ||
set | ||
{ | ||
_lossType = value; | ||
RaisePropertyChanged("LossType"); | ||
} | ||
} | ||
|
||
public string DownPath | ||
{ | ||
get => _downPath; | ||
set | ||
{ | ||
_downPath = value; | ||
RaisePropertyChanged("DownPath"); | ||
} | ||
} | ||
|
||
public string UserFolder | ||
{ | ||
get => _userFolder; | ||
set | ||
{ | ||
_userFolder = value; | ||
RaisePropertyChanged("UserFolder"); | ||
} | ||
} | ||
|
||
public string UserName | ||
{ | ||
get => _userName; | ||
set | ||
{ | ||
_userName = value; | ||
RaisePropertyChanged("UserName"); | ||
} | ||
} | ||
|
||
public int NameSelect | ||
{ | ||
get => _nameSelect; | ||
set | ||
{ | ||
_nameSelect = value; | ||
RaisePropertyChanged("NameSelect"); | ||
} | ||
} | ||
|
||
public int FolderSelect | ||
{ | ||
get => _folderSelect; | ||
set | ||
{ | ||
_folderSelect = value; | ||
RaisePropertyChanged("FolderSelect"); | ||
} | ||
} | ||
|
||
public bool DownPic | ||
{ | ||
get => _downPic; | ||
set | ||
{ | ||
_downPic = value; | ||
RaisePropertyChanged("DownPic"); | ||
} | ||
} | ||
|
||
public bool DownLrc | ||
{ | ||
get => _downLrc; | ||
set | ||
{ | ||
_downLrc = value; | ||
RaisePropertyChanged("DownLrc"); | ||
} | ||
} | ||
|
||
public bool EnableUserSetting | ||
{ | ||
get => _enableUserSetting; | ||
set | ||
{ | ||
_enableUserSetting = value; | ||
RaisePropertyChanged("EnableUserSetting"); | ||
} | ||
} | ||
|
||
public DownloadSettings() | ||
{ | ||
BitRate = 1; | ||
LossType = 0; | ||
DownPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Music"); | ||
DownLrc = false; | ||
DownPic = false; | ||
EnableUserSetting = false; | ||
NameSelect = 1; | ||
FolderSelect = 0; | ||
UserName = "%ARTIST% - %SONG%"; | ||
UserFolder = ""; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using FishMusic.Download; | ||
using GalaSoft.MvvmLight; | ||
|
||
namespace FishMusic.Model | ||
{ | ||
public class SoftSetting : ViewModelBase | ||
{ | ||
private DownloadSettings _downSetting; | ||
|
||
public DownloadSettings DownSetting | ||
{ | ||
get => _downSetting; | ||
set | ||
{ | ||
_downSetting = value; | ||
RaisePropertyChanged("DownSetting"); | ||
} | ||
} | ||
|
||
public string Id { get; set; } | ||
public DateTime UpdateTime { get; set; } | ||
|
||
public SoftSetting() | ||
{ | ||
Id = "luooqi"; | ||
UpdateTime = DateTime.Now; | ||
DownSetting = new DownloadSettings(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<UserControl x:Class="FishMusic.View.Download.DownSetting" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
mc:Ignorable="d" | ||
d:DesignHeight="900" d:DesignWidth="600"> | ||
<UserControl.Resources> | ||
<Style x:Key="TextBlockHeader" TargetType="TextBlock"> | ||
<Setter Property="FontWeight" Value="Bold" /> | ||
<Setter Property="FontSize" Value="14" /> | ||
<Setter Property="Foreground" Value="{DynamicResource AccentColorBrush}" /> | ||
</Style> | ||
<Style TargetType="TextBlock"> | ||
<Setter Property="Foreground" Value="{DynamicResource BlackBrush}" /> | ||
</Style> | ||
</UserControl.Resources> | ||
<UserControl.DataContext> | ||
<Binding Path="Setting" Source="{StaticResource Locator}" /> | ||
</UserControl.DataContext> | ||
<Grid> | ||
<ScrollViewer> | ||
<StackPanel Margin="10" Orientation="Vertical"> | ||
<TextBlock Style="{StaticResource TextBlockHeader}" Text="常规设置"/> | ||
<TextBlock Margin="0,15,0,0" Text="下载根目录" /> | ||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0"> | ||
<TextBox Width="270" Text="{Binding SoftSetting.DownSetting.DownPath}" IsEnabled="False" /> | ||
</StackPanel> | ||
<TextBlock Margin="0,15,0,0" Text="音质选择" /> | ||
<ComboBox Width="270" | ||
Margin="0,10,0,0" | ||
HorizontalAlignment="Left" | ||
SelectedIndex="{Binding SoftSetting.DownSetting.BitRate}"> | ||
<ComboBoxItem Content="无损" /> | ||
<ComboBoxItem Content="320K" /> | ||
<ComboBoxItem Content="192K" /> | ||
<ComboBoxItem Content="128K" /> | ||
</ComboBox> | ||
<TextBlock Margin="0,15,0,0" Text="无损偏好" /> | ||
<ComboBox Width="270" | ||
Margin="0,10,0,0" | ||
HorizontalAlignment="Left" | ||
SelectedIndex="{Binding SoftSetting.DownSetting.LossType}"> | ||
<ComboBoxItem Content="FLAC" /> | ||
<ComboBoxItem Content="APE" /> | ||
<ComboBoxItem Content="WAV" /> | ||
</ComboBox> | ||
<TextBlock Margin="0,15,0,0" Text="音乐命名格式" /> | ||
<ComboBox Width="270" | ||
Margin="0,10,0,0" | ||
HorizontalAlignment="Left" | ||
SelectedIndex="{Binding SoftSetting.DownSetting.NameSelect}"> | ||
<ComboBoxItem Content="歌曲名" /> | ||
<ComboBoxItem Content="歌手 - 歌曲名" /> | ||
<ComboBoxItem Content="歌曲名 - 歌手" /> | ||
<ComboBoxItem Content="歌曲序号 - 歌曲名" /> | ||
</ComboBox> | ||
<TextBlock Margin="0,15,0,0" Text="文件智能分类" /> | ||
<ComboBox Width="270" | ||
Margin="0,10,0,0" | ||
HorizontalAlignment="Left" | ||
SelectedIndex="{Binding SoftSetting.DownSetting.FolderSelect}"> | ||
<ComboBoxItem Content="不分文件夹" /> | ||
<ComboBoxItem Content="按歌手分文件夹" /> | ||
<ComboBoxItem Content="按专辑分文件夹" /> | ||
<ComboBoxItem Content="按歌手\专辑分文件夹" /> | ||
</ComboBox> | ||
|
||
<TextBlock Style="{StaticResource TextBlockHeader}" Text="其他设置" | ||
Margin="0,15,0,0"/> | ||
<CheckBox Margin="0,10,0,0" Content="下载LRC歌词" IsChecked="{Binding SoftSetting.DownSetting.DownLrc}" /> | ||
<CheckBox Margin="0,10,0,0" Content="下载歌曲封面" IsChecked="{Binding SoftSetting.DownSetting.DownPic}" /> | ||
<CheckBox Margin="0,10,0,0" Content="启用高级设置" IsChecked="{Binding SoftSetting.DownSetting.EnableUserSetting}" /> | ||
|
||
<TextBlock Style="{StaticResource TextBlockHeader}" Text="高级设置" | ||
Margin="0,15,0,0"/> | ||
<TextBlock Margin="0,15,0,0" Text="自定义文件名" /> | ||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0"> | ||
<TextBox Width="270" Text="{Binding SoftSetting.DownSetting.UserName}" /> | ||
</StackPanel> | ||
<TextBlock Margin="0,15,0,0" Text="自定义目录结构" /> | ||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0"> | ||
<TextBox Width="270" Text="{Binding SoftSetting.DownSetting.UserFolder}" /> | ||
</StackPanel> | ||
</StackPanel> | ||
</ScrollViewer> | ||
</Grid> | ||
</UserControl> |
Oops, something went wrong.