forked from ashpynov/PlayniteSound
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlayniteSoundsSettingsView.xaml
243 lines (235 loc) · 21.1 KB
/
PlayniteSoundsSettingsView.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<UserControl x:Class="PlayniteSounds.PlayniteSoundsSettingsView"
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"
xmlns:playnitesounds="clr-namespace:PlayniteSounds"
xmlns:common="clr-namespace:PlayniteSounds.Common"
xmlns:models="clr-namespace:PlayniteSounds.Models"
d:DataContext="{d:DesignInstance Type=playnitesounds:PlayniteSoundsSettingsViewModel}"
mc:Ignorable="d"
d:DesignHeight="460">
<TabControl>
<TabItem Header="{DynamicResource LOC_PLAYNITESOUNDS_Sound}">
<StackPanel Margin="2">
<GroupBox Name="GrpSettings" Header="{DynamicResource LOC_PLAYNITESOUNDS_Settings}" Margin="0,5,0,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="160"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="5"/>
<RowDefinition/>
<RowDefinition Height="5"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Label Grid.Row="0" Name="LblSoundWhere" Content="{DynamicResource LOC_PLAYNITESOUNDS_SoundWhere}" d:LayoutOverrides="VerticalAlignment"/>
<ComboBox Grid.Row="0" Grid.Column="1" Name="CmbSoundWhere" SelectedIndex="{Binding Settings.SoundState, Converter={common:AudioStateConverter}}" Height="20">
<ComboBoxItem Content="{DynamicResource LOC_PLAYNITESOUNDS_CmbItemNever}"/>
<ComboBoxItem Content="{DynamicResource LOC_PLAYNITESOUNDS_CmbItemDesktop}"/>
<ComboBoxItem Content="{DynamicResource LOC_PLAYNITESOUNDS_CmbItemFullscreen}"/>
<ComboBoxItem Content="{DynamicResource LOC_PLAYNITESOUNDS_CmbItemDesktopFullscreen}"/>
</ComboBox>
<CheckBox Name="ChkSkipFirstSelectSound" Grid.Row="10" Grid.ColumnSpan="2" IsChecked="{Binding Settings.SkipFirstSelectSound}" Content="{DynamicResource LOC_PLAYNITESOUNDS_ChkSkipFirstSelectSound}"/>
</Grid>
</GroupBox>
<GroupBox Name="GrpActions" Header="{DynamicResource LOC_PLAYNITESOUNDS_Actions}" Margin="0,5,0,0">
<StackPanel Orientation="Horizontal">
<Button Name="ButReloadAudio" Content="{DynamicResource LOC_PLAYNITESOUNDS_ActionsReloadAudioFiles}" HorizontalAlignment="Left" Margin="2" VerticalAlignment="Center" Click="ButReloadAudio_Click"/>
<Button Name="ButOpenSoundsFolder" Content="{DynamicResource LOC_PLAYNITESOUNDS_ActionsOpenSoundsFolder}" HorizontalAlignment="Left" Margin="2" VerticalAlignment="Center" Click="ButOpenSoundsFolder_Click"/>
<Button Name="ButOpenMusicFolder" Content="{DynamicResource LOC_PLAYNITESOUNDS_ActionsOpenMusicFolder}" HorizontalAlignment="Left" Margin="2" VerticalAlignment="Center" Click="ButOpenMusicFolder_Click"/>
<Button Name="ButOpenInfo" Content="{DynamicResource LOC_PLAYNITESOUNDS_ActionsHelp}" HorizontalAlignment="Left" Margin="2" VerticalAlignment="Center" Click="ButOpenInfo_Click"/>
</StackPanel>
</GroupBox>
<GroupBox Name="GrpManager" Header="{DynamicResource LOC_PLAYNITESOUNDS_Manager}" Margin="0,5,0,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="10"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<Button Name="ButLoadSounds" Content="{DynamicResource LOC_PLAYNITESOUNDS_ManagerLoad}" HorizontalAlignment="Left" Margin="2" VerticalAlignment="Center" Click="ButLoadSounds_Click"/>
<Button Name="ButSaveSounds" Content="{DynamicResource LOC_PLAYNITESOUNDS_ManagerSave}" HorizontalAlignment="Left" Margin="2" VerticalAlignment="Center" Click="ButSaveSounds_Click"/>
<Button Name="ButRemoveSounds" Content="{DynamicResource LOC_PLAYNITESOUNDS_ManagerRemove}" HorizontalAlignment="Left" Margin="2" VerticalAlignment="Center" Click="ButRemoveSounds_Click"/>
</StackPanel>
<Separator Grid.Row="1"/>
<StackPanel Grid.Row="2" Orientation="Horizontal">
<Button Name="ButImportSounds" Content="{DynamicResource LOC_PLAYNITESOUNDS_ManagerImport}" HorizontalAlignment="Left" Margin="2" VerticalAlignment="Center" Click="ButImportSounds_Click"/>
<Button Name="ButOpenSoundManagerFolder" Content="{DynamicResource LOC_PLAYNITESOUNDS_ManagerOpenManagerFolder}" HorizontalAlignment="Left" Margin="2" VerticalAlignment="Center" Click="ButOpenSoundManagerFolder_Click"/>
</StackPanel>
</Grid>
</GroupBox>
</StackPanel>
</TabItem>
<TabItem Header="{DynamicResource LOC_PLAYNITESOUNDS_Music}">
<StackPanel Margin="2">
<!--<CheckBox Name="ChkAutoSearchOrder" Grid.Row="0" Grid.ColumnSpan="2" IsChecked="{Binding Settings.AutoParallelDownload}" Content="{DynamicResource LOC_PLAYNITESOUNDS_AutoParDown}" ToolTip="Determine whether results are retrieved for each source or for the first source with results."/>
<CheckBox Name="ChkManualSearchOrder" Grid.Row="2" Grid.ColumnSpan="2" IsChecked="{Binding Settings.ManualParallelDownload}" Content="{DynamicResource LOC_PLAYNITESOUNDS_ManParDown}" ToolTip="Determine whether results are retrieved for each source or for the first source with results."/>-->
<GroupBox Header="{DynamicResource LOC_PLAYNITESOUNDS_Settings}" Grid.Row="0" Grid.ColumnSpan="2" Margin="0,5,0,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="220"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="5"/>
<RowDefinition/>
<RowDefinition Height="5"/>
<RowDefinition/>
<RowDefinition Height="5"/>
<RowDefinition/>
<RowDefinition Height="5"/>
<RowDefinition/>
<RowDefinition Height="5"/>
<RowDefinition/>
<RowDefinition Height="5"/>
<RowDefinition/>
<RowDefinition Height="5"/>
<RowDefinition/>
<RowDefinition Height="5"/>
<RowDefinition/>
<RowDefinition Height="5"/>
<RowDefinition/>
<RowDefinition Height="5"/>
<RowDefinition/>
<RowDefinition Height="5"/>
<RowDefinition/>
<RowDefinition Height="5"/>
<RowDefinition/>
<RowDefinition Height="5"/>
<RowDefinition/>
<RowDefinition Height="5"/>
<RowDefinition/>
<RowDefinition Height="5"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Label Grid.Row="0" Name="LblMusicWhere" Content="{DynamicResource LOC_PLAYNITESOUNDS_MusicWhere}" d:LayoutOverrides="VerticalAlignment"/>
<ComboBox Grid.Row="0" Grid.Column="1" Name="CmbMusicWhere" SelectedIndex="{Binding Settings.MusicState, Converter={common:AudioStateConverter}}" Height="20">
<ComboBoxItem Content="{DynamicResource LOC_PLAYNITESOUNDS_CmbItemNever}"/>
<ComboBoxItem Content="{DynamicResource LOC_PLAYNITESOUNDS_CmbItemDesktop}"/>
<ComboBoxItem Content="{DynamicResource LOC_PLAYNITESOUNDS_CmbItemFullscreen}"/>
<ComboBoxItem Content="{DynamicResource LOC_PLAYNITESOUNDS_CmbItemDesktopFullscreen}"/>
</ComboBox>
<StackPanel Grid.Row="2" Grid.ColumnSpan="2" Orientation="Horizontal" >
<StackPanel Orientation="Horizontal">
<Label Width="220" Content="{DynamicResource LOC_PLAYNITESOUNDS_MusicType}" d:LayoutOverrides="VerticalAlignment"/>
<ComboBox MinWidth="220" Name="CmbMusicType" SelectedValuePath="Tag" SelectedValue="{Binding Settings.MusicType, Mode=TwoWay}" Height="20">
<ComboBoxItem Tag="{x:Static models:MusicType.Default}" Content="{DynamicResource LOC_PLAYNITESOUNDS_CmbMusicTypeOneMusic}"/>
<ComboBoxItem Tag="{x:Static models:MusicType.Platform}" Content="{DynamicResource LOC_PLAYNITESOUNDS_CmbMusicTypeOneMusicPlatform}"/>
<ComboBoxItem Tag="{x:Static models:MusicType.Game}" Content="{DynamicResource LOC_PLAYNITESOUNDS_CmbMusicTypeOneMusicPlatformGame}"/>
<ComboBoxItem Tag="{x:Static models:MusicType.Filter}" Content="{DynamicResource LOC_PLAYNITESOUNDS_CmbMusicTypeFilter}"/>
</ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal" Visibility="{Binding Settings.DetailsMusicTypeVisibility}">
<Label Margin="20,0,10,0" Name="LblDetailsMusicType" Content="{DynamicResource LOC_PLAYNITESOUNDS_DetailsMusicType}" d:LayoutOverrides="VerticalAlignment"/>
<ComboBox MinWidth="220" Name="CmbDetailsMusicType" SelectedValuePath="Tag" SelectedValue="{Binding Settings.DetailsMusicType, Mode=TwoWay}" Height="20">
<ComboBoxItem Tag="{x:Static models:MusicType.Same}" Content="{DynamicResource LOC_PLAYNITESOUNDS_CmbMusicTypeSame}"/>
<ComboBoxItem Tag="{x:Static models:MusicType.Default}" Content="{DynamicResource LOC_PLAYNITESOUNDS_CmbMusicTypeOneMusic}"/>
<ComboBoxItem Tag="{x:Static models:MusicType.Platform}" Content="{DynamicResource LOC_PLAYNITESOUNDS_CmbMusicTypeOneMusicPlatform}"/>
<ComboBoxItem Tag="{x:Static models:MusicType.Game}" Content="{DynamicResource LOC_PLAYNITESOUNDS_CmbMusicTypeOneMusicPlatformGame}"/>
<ComboBoxItem Tag="{x:Static models:MusicType.Filter}" Content="{DynamicResource LOC_PLAYNITESOUNDS_CmbMusicTypeFilter}"/>
</ComboBox>
</StackPanel>
</StackPanel>
<Label Grid.Row="4" Name="LblStopMusic" Content="{DynamicResource LOC_PLAYNITESOUNDS_StopMusic}" d:LayoutOverrides="VerticalAlignment"/>
<ComboBox Grid.Row="4" Grid.Column="1" Name="CmbStopMusic" SelectedIndex="{Binding Settings.StopMusic}" Height="20">
<ComboBoxItem Content="{DynamicResource LOC_PLAYNITESOUNDS_CmbStopItemIsStarting}"/>
<ComboBoxItem Content="{DynamicResource LOC_PLAYNITESOUNDS_CmbStopItemHasStarted}"/>
</ComboBox>
<StackPanel Grid.Row="6" Orientation="Horizontal">
<Label Name="LblMusicVolume" Content="{DynamicResource LOC_PLAYNITESOUNDS_MusicVolume}" d:LayoutOverrides="VerticalAlignment"/>
<Label Name="LblSpace" Content=" "/>
<Label Name="Percentage" Content="{Binding Settings.MusicVolume}" />
<Label Name="PercentageSign" Content="%"/>
</StackPanel>
<Slider Name="VolumeSlider" Grid.Row="6" Grid.Column="1" Maximum="100" Value="{Binding Settings.MusicVolume}" AutoToolTipPlacement="TopLeft" ValueChanged="Slider_ValueChanged" VerticalAlignment="Center"/>
<StackPanel Grid.Row="8" Orientation="Horizontal">
<Label Name="LblMusicFade" Content="{DynamicResource LOC_PLAYNITESOUNDS_MusicFadeDuration}" d:LayoutOverrides="VerticalAlignment"/>
<Label Name="LblSpaceFade" Content=" "/>
<Label Name="FadeTime" Content="{Binding Settings.FadeDuration}" />
<Label Name="LblSpaceFade2" Content=" "/>
<Label Name="LblMsFade" Content="{DynamicResource LOC_PLAYNITESOUNDS_MusicFadeDurationSec}" d:LayoutOverrides="VerticalAlignment"/>
</StackPanel>
<Slider Name="FadeSlider" Grid.Row="8" Grid.Column="1"
Minimum="0.05" Maximum="2" SmallChange="0.1" LargeChange="0.5"
TickFrequency="0.05" TickPlacement="BottomRight"
AutoToolTipPlacement="TopLeft" AutoToolTipPrecision="2"
Value="{Binding Settings.FadeDuration}"
VerticalAlignment="Center"/>
<CheckBox Name="ChkPauseOnDeactivate" Grid.Row="10" Grid.ColumnSpan="2" IsChecked="{Binding Settings.PauseOnDeactivate}" Content="{DynamicResource LOC_PLAYNITESOUNDS_ChkPauseOnDeactivate}"/>
<CheckBox Name="ChkPauseOnTrailer" Grid.Row="12" Grid.ColumnSpan="2" IsChecked="{Binding Settings.PauseOnTrailer}" Content="{DynamicResource LOC_PLAYNITESOUNDS_ChkPauseOnTrailer}"/>
<CheckBox Name="ChkRandomizeOnEverySelect" Grid.Row="14" Grid.ColumnSpan="2" IsChecked="{Binding Settings.RandomizeOnEverySelect}" Content="{DynamicResource LOC_PLAYNITESOUNDS_ChkRandomizeOnEverySelect}"/>
<CheckBox Name="ChkRandomizeOnMusicEnd" Grid.Row="16" Grid.ColumnSpan="2" IsChecked="{Binding Settings.RandomizeOnMusicEnd}" Content="{DynamicResource LOC_PLAYNITESOUNDS_ChkRandomizeOnMusicEnd}"/>
<CheckBox Name="ChkCollectFromGames" Grid.Row="18" Grid.ColumnSpan="2" IsChecked="{Binding Settings.CollectFromGames}" Content="{DynamicResource LOC_PLAYNITESOUNDS_ChkCollectFromGames}"/>
<CheckBox Name="ChkBackgroundNone" Grid.Row="20" Grid.ColumnSpan="2" IsChecked="{Binding Settings.PlayBackupMusic}" Content="{DynamicResource LOC_PLAYNITESOUNDS_ChkBackup}"/>
<CheckBox Name="ChkBackgroundNoneCollect" Grid.Row="22" Grid.ColumnSpan="2"
IsChecked="{Binding Settings.CollectFromGamesOnBackup}"
IsEnabled="{Binding Settings.PlayBackupMusic}"
Content="{DynamicResource LOC_PLAYNITESOUNDS_ChkCollectFromGamesOnBackup}"/>
<CheckBox Name="ChkTagMissing" Grid.Row="24" Grid.ColumnSpan="2" IsChecked="{Binding Settings.TagMissingEntries}" Content="{DynamicResource LOC_PLAYNITESOUNDS_ChkTagMissing}"/>
<CheckBox Name="ChkTagNormal" Grid.Row="26" Grid.ColumnSpan="2" IsChecked="{Binding Settings.TagNormalizedGames}" Content="{DynamicResource LOC_PLAYNITESOUNDS_Normalize_Tag}"/>
</Grid>
</GroupBox>
<GroupBox Header="{DynamicResource LOC_PLAYNITESOUNDS_Actions_Download}" Grid.Row="1" Grid.ColumnSpan="2" Margin="0,5,0,0">
<StackPanel>
<DockPanel Margin="0,0,0,10">
<TextBlock Text="{DynamicResource LOC_PLAYNITESOUNDS_FF_Path}" DockPanel.Dock="Left" VerticalAlignment="Center" ToolTip="{DynamicResource LOC_PLAYNITESOUNDS_FF_Hint}"/>
<Button Margin="10,0,0,0" DockPanel.Dock="Right" Content="{DynamicResource LOC_PLAYNITESOUNDS_Actions_Download}"
Command="{Binding NavigateUrlCommand}"
CommandParameter="https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.7z"
/>
<Button Margin="10,0,0,0" DockPanel.Dock="Right" Content="{DynamicResource LOC_PLAYNITESOUNDS_Browse}" Command="{Binding BrowseForFFmpegFile}" />
<TextBox Margin="10,0,0,0" Text="{Binding Settings.FFmpegPath}" IsReadOnly="False" />
</DockPanel>
<DockPanel Margin="0,0,0,10">
<TextBlock Text="{DynamicResource LOC_PLAYNITESOUNDS_YtDLp_Path}" DockPanel.Dock="Left" VerticalAlignment="Center" ToolTip="{DynamicResource LOC_PLAYNITESOUNDS_YtDLp_Hint}"/>
<Button Margin="10,0,0,0" DockPanel.Dock="Right" Content="{DynamicResource LOC_PLAYNITESOUNDS_Actions_Download}"
Command="{Binding NavigateUrlCommand}"
CommandParameter="https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe"
/>
<Button Margin="10,0,0,0" DockPanel.Dock="Right" Content="{DynamicResource LOC_PLAYNITESOUNDS_Browse}" Command="{Binding BrowseForYtDlpFile}" />
<TextBox Margin="10,0,0,0" Text="{Binding Settings.YtDlpPath}" IsReadOnly="False" />
</DockPanel>
<DockPanel Margin="0,0,0,10">
<TextBlock Text="{DynamicResource LOC_PLAYNITESOUNDS_FFNorm_Path}"
ToolTip="{DynamicResource LOC_PLAYNITESOUNDS_FFNorm_Hint}"
VerticalAlignment="Center" DockPanel.Dock="Left" />
<Button Margin="10,0,0,0" DockPanel.Dock="Right" Content="{DynamicResource LOC_PLAYNITESOUNDS_Actions_Download}"
Command="{Binding NavigateUrlCommand}"
IsEnabled="False"
CommandParameter="https://github.com/slhck/ffmpeg-normalize/releases/latest/download/yt-dlp.exe"
/>
<Button Margin="10,0,0,0"
DockPanel.Dock="Right"
Content="{DynamicResource LOC_PLAYNITESOUNDS_Browse}"
Command="{Binding BrowseForFFmpegNormalizeFile}"/>
<TextBlock VerticalAlignment="Center" Margin="10,0,0,0"
DockPanel.Dock="Right"
ToolTip="{DynamicResource LOC_PLAYNITESOUNDS_FFNorm_Doc}">
<Hyperlink NavigateUri="https://github.com/slhck/ffmpeg-normalize"
Command="{Binding NavigateUrlCommand}"
CommandParameter="{Binding NavigateUri, RelativeSource={RelativeSource Self}}">
<Run Text="{DynamicResource LOC_PLAYNITESOUNDS_Help}" />
</Hyperlink>
</TextBlock>
<TextBox Margin="10,0,0,0" Text="{Binding Settings.FFmpegNormalizePath}"
IsReadOnly="True" ToolTip="{Binding Settings.FFmpegNormalizePath}"
/>
</DockPanel>
<DockPanel Margin="0,0,0,10">
<TextBlock Text="{DynamicResource LOC_PLAYNITESOUNDS_FFNorm_Cust}" DockPanel.Dock="Left" VerticalAlignment="Center" ToolTip="{DynamicResource LOC_PLAYNITESOUNDS_FFNorm_Cust_Hint}"/>
<TextBox Margin="10,0,0,0" Text="{Binding Settings.FFmpegNormalizeArgs}" />
</DockPanel>
<CheckBox Margin="0,0,0,10" Name="ChkAutoDownload" IsChecked="{Binding Settings.AutoDownload}" Content="{DynamicResource LOC_PLAYNITESOUNDS_ChkAutoDownload}"/>
<CheckBox Margin="0,0,0,10" Name="ChkNormalize" IsChecked="{Binding Settings.NormalizeMusic}" Content="{DynamicResource LOC_PLAYNITESOUNDS_Normalize}"/>
<CheckBox Margin="0,0,0,10" Name="ChkPlaylists" IsChecked="{Binding Settings.YtPlaylists}" Content="{DynamicResource LOC_PLAYNITESOUNDS_YtPlaylists}"/>
</StackPanel>
</GroupBox>
</StackPanel>
</TabItem>
</TabControl>
</UserControl>