2 <Window x:Class="OpenTXrecorder.MainWindow"
3 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5 Title="OpenTX Recorder"
9 ResizeMode="CanResizeWithGrip" SizeToContent="Width" Icon="/OpenTXrecorder;component/icon.ico" MinHeight="450">
13 <DataTemplate x:Key="imagePlay">
14 <Image x:Name="ThePlayImage" />
15 <DataTemplate.Triggers>
16 <DataTrigger Binding="{Binding Path=fileExists}" Value="true">
17 <Setter TargetName="ThePlayImage" Property="Source" Value="/OpenTXrecorder;component/play.png" />
19 </DataTemplate.Triggers>
23 <Grid VerticalAlignment="Stretch" >
24 <Grid.ColumnDefinitions>
25 <ColumnDefinition Width="Auto" />
26 <ColumnDefinition Width="*"/>
27 </Grid.ColumnDefinitions>
28 <Grid Grid.Row="0" Grid.Column="0" VerticalAlignment="Stretch">
30 <ListView Name="lvSentences"
31 SelectionMode="Single"
32 MouseDoubleClick="play"
33 VerticalAlignment="Stretch"
34 ItemsSource="{Binding sentences, Mode=TwoWay}"
35 IsSynchronizedWithCurrentItem="True"
40 <GridViewColumn Header="File Name" Width="90" DisplayMemberBinding="{Binding fileName}" />
41 <GridViewColumn Header="Description" Width="190" DisplayMemberBinding="{Binding description}" />
42 <GridViewColumn Header="Voice" Width="190" DisplayMemberBinding="{Binding voiceString}" />
43 <GridViewColumn Width="30" CellTemplate="{StaticResource imagePlay}" />
50 <StackPanel Grid.Row="0" Grid.Column="1">
51 <TextBlock Text="Settings" Margin="5,0,0,0" FontSize="18" />
53 <StackPanel Orientation="Vertical" HorizontalAlignment="Left" Margin="10,0,0,0">
54 <StackPanel Orientation="Horizontal">
55 <Label Content="Language" Width="75" />
56 <ComboBox Name="cbLanguages"
57 DisplayMemberPath="lName"
58 SelectedValuePath="sName"
59 SelectionChanged="switchLanguage"
60 Width="200" Height="23"
61 ItemsSource="{Binding languages, Mode=TwoWay}" />
64 <Separator Height="5" />
65 <TextBlock Text="Sentence" Margin="5,0,0,0" FontSize="18" />
66 <Grid Margin="10,0,0,0" DataContext="{Binding ElementName=lvSentences, Path=SelectedItem}" Width="Auto">
67 <Grid.ColumnDefinitions>
68 <ColumnDefinition Width="75" />
69 <ColumnDefinition Width="*"/>
70 </Grid.ColumnDefinitions>
77 </Grid.RowDefinitions>
79 <TextBlock Text="File Name" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="0" Margin="0,5,0,0" />
80 <TextBox Text="{Binding Path=fileName}" Grid.Row="0" Grid.Column="1" Margin=" 0,0,10,0" />
81 <TextBlock Text="Description" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="1" Grid.Column="0" Margin="0,5,0,0" />
82 <TextBox Text="{Binding Path=description}" Grid.Row="1" Grid.Column="1" Margin=" 0,0,10,0"/>
83 <TextBlock Text="Sentence" Grid.Row="2" Grid.Column="0" Margin="0,5,0,0" />
84 <TextBox Text="{Binding Path=voiceString}" Grid.Row="2" Grid.Column="1" Margin="0,0,10,0"/>
86 <Separator Height="5" Margin="0,5,0,0" />
88 <StackPanel Orientation="Horizontal" Margin="0,0,0,0">
89 <TextBlock Text="Speed Up" Width="70" Margin="10,10,0,0" />
90 <Slider Name="speedSlider"
94 TickPlacement="BottomRight"
96 IsSnapToTickEnabled="True"
98 Margin="10,10,10,0" ToolTip="Increase speech speed" />
99 <TextBlock Text="{Binding ElementName=speedSlider, Path=Value}" Width="40" Margin="0,10,0,0"/>
100 <TextBlock Text="Voice Rate" Width="70" Margin="10,10,0,0" />
103 <StackPanel Orientation="Horizontal" Margin="0,0,0,0">
104 <TextBlock Text="Cut Level" Width="70" Margin="10,10,0,0" />
105 <Slider Name="noiceLevelSlider"
109 TickPlacement="BottomRight"
111 IsSnapToTickEnabled="True"
113 Margin="10,10,10,0" ToolTip="Set Cut Level as low as possible" />
114 <TextBlock Text="{Binding ElementName=noiceLevelSlider, Path=Value}" Width="40" Margin="0,10,0,0"/>
115 <TextBlock Text="Voice Rate" Width="70" Margin="10,10,0,0" />
117 <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,5,0,0">
118 <Button Content="New Sentence" Width="120" Height="32" Name="buttonAddItem" Click="addSentence"/>
119 <Button Name="btnRecord" ToolTip="Start recording" Click="record" Margin="20,0,0,0" >
120 <Image Height="32" Source="/OpenTXrecorder;component/record.png"/>
122 <Button Name="btnStop" ToolTip="Stop recording" Click="stop" Margin="5,0,0,0" >
123 <Image Height="32" Source="/OpenTXrecorder;component/stop.png" />
125 <Button Name="btnPlay" ToolTip="Play Sentence" Click="play" Margin="30,0,0,0" >
126 <Image Height="32" Source="/OpenTXrecorder;component/play.png" />
129 <Separator Height="5" />
130 <Label Content="RECORDING" Name="lblRecording" HorizontalAlignment="Center" Foreground="Red" FontSize="24" FontWeight="Black" Visibility="Hidden" />
132 <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" />