Skip to content

Commit 9b7c4cc

Browse files
Improves voice selection list
1 parent 13f66ed commit 9b7c4cc

File tree

5 files changed

+19
-2
lines changed

5 files changed

+19
-2
lines changed

src/JuliusSweetland.OptiKids/Properties/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/JuliusSweetland.OptiKids/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,4 +481,7 @@ You can turn off update checks from the Management Console (ALT + M).</value>
481481
<data name="QUIT_MESSAGE" xml:space="preserve">
482482
<value>Are you sure you would like to quit?</value>
483483
</data>
484+
<data name="DEFAULT" xml:space="preserve">
485+
<value>Default</value>
486+
</data>
484487
</root>
0 Bytes
Binary file not shown.

src/JuliusSweetland.OptiKids/UI/ViewModels/Management/SoundsViewModel.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,12 @@ public SoundsViewModel(IAudioService audioService)
3939

4040
#region Properties
4141

42-
public List<string> SpeechVoices
42+
public List<KeyValuePair<string, string>> SpeechVoices
4343
{
44-
get { return new List<string> { "" }.Concat(audioService.GetAvailableVoices()).ToList(); }
44+
get { return new List<KeyValuePair<string, string>>
45+
{
46+
new KeyValuePair<string, string>(Resources.DEFAULT, null)
47+
}.Concat(audioService.GetAvailableVoices().Select(v => new KeyValuePair<string, string>(v, v))).ToList(); }
4548
}
4649

4750
public List<KeyValuePair<string, string>> GeneralSoundFiles

src/JuliusSweetland.OptiKids/UI/Views/Management/SoundsView.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
VerticalAlignment="Center" Margin="5" />
3636
<ComboBox Grid.Row="0" Grid.Column="1"
3737
ItemsSource="{Binding SpeechVoices}"
38+
DisplayMemberPath="Key"
39+
SelectedValuePath="Value"
3840
SelectedValue="{Binding SpeechVoice, Mode=TwoWay}" />
3941

4042
<TextBlock Grid.Row="1" Grid.Column="0" Text="{x:Static resx:Resources.VOLUME_LABEL}"

0 commit comments

Comments
 (0)