Skip to content

Commit

Permalink
Add Lipsync select caution color
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-akira committed Nov 13, 2018
1 parent 6641c12 commit 23d98ce
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ControlWindowWPF/ControlWindowWPF/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@
</StackPanel>
</StackPanel>
</TabItem>
<TabItem Header="{DynamicResource MainWindow_LipSync}" ToolTip="{DynamicResource MainWindow_LipSync_ToolTip}">
<TabItem ToolTip="{DynamicResource MainWindow_LipSync_ToolTip}">
<TabItem.Header>
<TextBlock Text="{DynamicResource MainWindow_LipSync}" Name="LipsyncTabTextBlock" Background="PaleVioletRed"/>
</TabItem.Header>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal" Margin="0,0,0,5">
<CheckBox Content="{DynamicResource MainWindow_EnableLipSync}" Name="LipSyncCheckBox" Checked="LipSyncCheckBox_Checked" Unchecked="LipSyncCheckBox_Unchecked" ToolTip="{DynamicResource MainWindow_EnableLipSync_ToolTip}"/>
Expand Down
4 changes: 4 additions & 0 deletions ControlWindowWPF/ControlWindowWPF/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,10 @@ private async void MaxWeightEmphasisCheckBox_Unchecked(object sender, RoutedEven

private async void LipSyncDeviceComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
LipsyncTabTextBlock.Background = new SolidColorBrush(Colors.PaleVioletRed);
if (LipSyncDeviceComboBox.SelectedItem == null) return;
if (LipSyncDeviceComboBox.SelectedItem.ToString().StartsWith(LanguageSelector.Get("Error") + ":")) return;
LipsyncTabTextBlock.Background = new SolidColorBrush(Colors.Transparent);
await Globals.Client.SendCommandAsync(new PipeCommands.SetLipSyncDevice { device = LipSyncDeviceComboBox.SelectedItem.ToString() });
}

Expand All @@ -487,6 +489,7 @@ await Globals.Client.SendCommandWaitAsync(new PipeCommands.GetLipSyncDevices(),
{
Dispatcher.Invoke(() =>
{
LipsyncTabTextBlock.Background = new SolidColorBrush(Colors.PaleVioletRed);
var ret = (PipeCommands.ReturnGetLipSyncDevices)d;
var selectedItem = LipSyncDeviceComboBox.SelectedItem;
LipSyncDevices.Clear();
Expand All @@ -506,6 +509,7 @@ void LoadLipSyncDevice(string device)
if (LipSyncDevices.Contains(device))
{
LipSyncDeviceComboBox.SelectedItem = device;
LipsyncTabTextBlock.Background = new SolidColorBrush(Colors.Transparent);
}
else
{
Expand Down
Binary file not shown.

0 comments on commit 23d98ce

Please sign in to comment.