mirror of
https://github.com/opentx/opentx.git
synced 2025-07-13 11:29:51 +03:00
136 lines
7.2 KiB
XML
136 lines
7.2 KiB
XML
|
|
<Window x:Class="OpenTXrecorder.MainWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
Title="OpenTX Recorder"
|
|
Height="440"
|
|
MinWidth="840"
|
|
MaxWidth="840"
|
|
ResizeMode="CanResizeWithGrip" SizeToContent="Width" Icon="/OpenTXrecorder;component/icon.ico" MinHeight="450">
|
|
|
|
|
|
<Window.Resources>
|
|
<DataTemplate x:Key="imagePlay">
|
|
<Image x:Name="ThePlayImage" />
|
|
<DataTemplate.Triggers>
|
|
<DataTrigger Binding="{Binding Path=fileExists}" Value="true">
|
|
<Setter TargetName="ThePlayImage" Property="Source" Value="/OpenTXrecorder;component/play.png" />
|
|
</DataTrigger>
|
|
</DataTemplate.Triggers>
|
|
</DataTemplate>
|
|
</Window.Resources>
|
|
|
|
<Grid VerticalAlignment="Stretch" >
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Grid Grid.Row="0" Grid.Column="0" VerticalAlignment="Stretch">
|
|
|
|
<ListView Name="lvSentences"
|
|
SelectionMode="Single"
|
|
MouseDoubleClick="play"
|
|
VerticalAlignment="Stretch"
|
|
ItemsSource="{Binding sentences, Mode=TwoWay}"
|
|
IsSynchronizedWithCurrentItem="True"
|
|
>
|
|
<ListView.View>
|
|
<GridView>
|
|
<GridView.Columns>
|
|
<GridViewColumn Header="File Name" Width="90" DisplayMemberBinding="{Binding fileName}" />
|
|
<GridViewColumn Header="Description" Width="190" DisplayMemberBinding="{Binding description}" />
|
|
<GridViewColumn Header="Voice" Width="190" DisplayMemberBinding="{Binding voiceString}" />
|
|
<GridViewColumn Width="30" CellTemplate="{StaticResource imagePlay}" />
|
|
</GridView.Columns>
|
|
</GridView>
|
|
</ListView.View>
|
|
</ListView>
|
|
</Grid>
|
|
|
|
<StackPanel Grid.Row="0" Grid.Column="1">
|
|
<TextBlock Text="Settings" Margin="5,0,0,0" FontSize="18" />
|
|
|
|
<StackPanel Orientation="Vertical" HorizontalAlignment="Left" Margin="10,0,0,0">
|
|
<StackPanel Orientation="Horizontal">
|
|
<Label Content="Language" Width="75" />
|
|
<ComboBox Name="cbLanguages"
|
|
DisplayMemberPath="lName"
|
|
SelectedValuePath="sName"
|
|
SelectionChanged="switchLanguage"
|
|
Width="200" Height="23"
|
|
ItemsSource="{Binding languages, Mode=TwoWay}" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<Separator Height="5" />
|
|
<TextBlock Text="Sentence" Margin="5,0,0,0" FontSize="18" />
|
|
<Grid Margin="10,0,0,0" DataContext="{Binding ElementName=lvSentences, Path=SelectedItem}" Width="Auto">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="75" />
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
|
|
<TextBlock Text="File Name" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="0" Margin="0,5,0,0" />
|
|
<TextBox Text="{Binding Path=fileName}" Grid.Row="0" Grid.Column="1" Margin=" 0,0,10,0" />
|
|
<TextBlock Text="Description" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="1" Grid.Column="0" Margin="0,5,0,0" />
|
|
<TextBox Text="{Binding Path=description}" Grid.Row="1" Grid.Column="1" Margin=" 0,0,10,0"/>
|
|
<TextBlock Text="Sentence" Grid.Row="2" Grid.Column="0" Margin="0,5,0,0" />
|
|
<TextBox Text="{Binding Path=voiceString}" Grid.Row="2" Grid.Column="1" Margin="0,0,10,0"/>
|
|
</Grid>
|
|
<Separator Height="5" Margin="0,5,0,0" />
|
|
|
|
<StackPanel Orientation="Horizontal" Margin="0,0,0,0">
|
|
<TextBlock Text="Speed Up" Width="70" Margin="10,10,0,0" />
|
|
<Slider Name="speedSlider"
|
|
Value="0"
|
|
Minimum="0"
|
|
Maximum="17"
|
|
TickPlacement="BottomRight"
|
|
TickFrequency="1"
|
|
IsSnapToTickEnabled="True"
|
|
Width="170"
|
|
Margin="10,10,10,0" ToolTip="Increase speech speed" />
|
|
<TextBlock Text="{Binding ElementName=speedSlider, Path=Value}" Width="40" Margin="0,10,0,0"/>
|
|
<TextBlock Text="Voice Rate" Width="70" Margin="10,10,0,0" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Orientation="Horizontal" Margin="0,0,0,0">
|
|
<TextBlock Text="Cut Level" Width="70" Margin="10,10,0,0" />
|
|
<Slider Name="noiceLevelSlider"
|
|
Value="800"
|
|
Minimum="0"
|
|
Maximum="4000"
|
|
TickPlacement="BottomRight"
|
|
TickFrequency="100"
|
|
IsSnapToTickEnabled="True"
|
|
Width="170"
|
|
Margin="10,10,10,0" ToolTip="Set Cut Level as low as possible" />
|
|
<TextBlock Text="{Binding ElementName=noiceLevelSlider, Path=Value}" Width="40" Margin="0,10,0,0"/>
|
|
<TextBlock Text="Voice Rate" Width="70" Margin="10,10,0,0" />
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,5,0,0">
|
|
<Button Content="New Sentence" Width="120" Height="32" Name="buttonAddItem" Click="addSentence"/>
|
|
<Button Name="btnRecord" ToolTip="Start recording" Click="record" Margin="20,0,0,0" >
|
|
<Image Height="32" Source="/OpenTXrecorder;component/record.png"/>
|
|
</Button>
|
|
<Button Name="btnStop" ToolTip="Stop recording" Click="stop" Margin="5,0,0,0" >
|
|
<Image Height="32" Source="/OpenTXrecorder;component/stop.png" />
|
|
</Button>
|
|
<Button Name="btnPlay" ToolTip="Play Sentence" Click="play" Margin="30,0,0,0" >
|
|
<Image Height="32" Source="/OpenTXrecorder;component/play.png" />
|
|
</Button>
|
|
</StackPanel>
|
|
<Separator Height="5" />
|
|
<Label Content="RECORDING" Name="lblRecording" HorizontalAlignment="Center" Foreground="Red" FontSize="24" FontWeight="Black" Visibility="Hidden" />
|
|
</StackPanel>
|
|
<Image Grid.Row="0" Grid.Column="1" Name="openTXLogo" Height="48" MouseLeftButtonDown="about" HorizontalAlignment="Right" Cursor="Hand" Margin="0,0,0,0" Source="/OpenTXrecorder;component/recorder_logo.png" Stretch="Uniform" VerticalAlignment="Bottom" />
|
|
|
|
</Grid>
|
|
|
|
</Window>
|