Stack overflow on Horus
[opentx.git] / sound / speaker / MainWindow.xaml
blob312a13593a2d3d1671e2ab2078f342e23c36cdcc
1 <Window x:Class="OpenTXspeak.MainWindow"
2         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4         Title="OpenTX Speaker" 
5         Height="514" 
6         MinWidth="840"
7         MaxWidth="840"
8         ResizeMode="CanResizeWithGrip" MinHeight="514" SizeToContent="Width" Icon="/OpenTXspeaker;component/icon.ico">
10     <Grid VerticalAlignment="Stretch" >
11         <Grid.ColumnDefinitions>
12             <ColumnDefinition Width="Auto" />
13             <ColumnDefinition Width="*"/>
14         </Grid.ColumnDefinitions>
16         <Grid Grid.Row="0" Grid.Column="0" VerticalAlignment="Stretch">
17             <ListView Name="lvSentences" 
18                       SelectionMode="Single" 
19                       MouseDoubleClick="lvSentences_MouseDoubleClick" 
20                       VerticalAlignment="Stretch" >
21                 <ListView.View>
22                     <GridView>
23                         <GridView.Columns>
24                             <GridViewColumn Header="File Name" Width="100"  DisplayMemberBinding="{Binding fileName}" />
25                             <GridViewColumn Header="Description" Width="200" DisplayMemberBinding="{Binding description}" />
26                             <GridViewColumn Header="Voice" Width="200" DisplayMemberBinding="{Binding voiceString}" />
27                         </GridView.Columns>
28                     </GridView>
29                 </ListView.View>
30             </ListView>
31         </Grid>
33         <StackPanel Grid.Row="0" Grid.Column="1">
34             <TextBlock Text="Language" Margin="5,0,0,0" FontSize="18"   />
36             <StackPanel Orientation="Vertical" HorizontalAlignment="Left" Margin="10,0,0,0">
37                 <StackPanel Orientation="Horizontal">
38                     <Label Content="Text" Width="75"   />
39                     <ComboBox Name="cbLanguages"
40                               DisplayMemberPath="lName"
41                               SelectedValuePath="sName"
42                               SelectionChanged="cbLanguages_SelectionChanged" 
43                               Width="200" Height="23"  />
44                 </StackPanel>
45                 <StackPanel Orientation="Horizontal">
46                     <Label Content="Voice" Width="75"   />
47                     <ComboBox Height="23" Name="cbVoices" Width="200" Margin="0,0,0,0"/>
48                 </StackPanel>
49             </StackPanel>
51             <Separator Height="5" />
52             <TextBlock Text="Sentence" Margin="5,0,0,0" FontSize="18"   />
53             <Grid Margin="10,0,0,0" DataContext="{Binding ElementName=lvSentences, Path=SelectedItem}" Width="Auto">
54                 <Grid.ColumnDefinitions>
55                     <ColumnDefinition Width="75" />
56                     <ColumnDefinition Width="*"/>
57                 </Grid.ColumnDefinitions>
58                 <Grid.RowDefinitions>
59                     <RowDefinition />
60                     <RowDefinition />
61                     <RowDefinition />
62                     <RowDefinition />
63                     <RowDefinition />
64                 </Grid.RowDefinitions>
66                 <TextBlock Text="File Name" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="0"  Margin="0,5,0,0"   />
67                 <TextBox   Text="{Binding Path=fileName}" Grid.Row="0" Grid.Column="1" Margin=" 0,0,10,0" />
68                 <TextBlock Text="Description" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="1" Grid.Column="0"  Margin="0,5,0,0"   />
69                 <TextBox   Text="{Binding Path=description}" Grid.Row="1" Grid.Column="1" Margin=" 0,0,10,0"/>
70                 <TextBlock Text="Sentence" Grid.Row="2" Grid.Column="0" Margin="0,5,0,0"   />
71                 <TextBox   Text="{Binding Path=voiceString}" Grid.Row="2" Grid.Column="1"  Margin="0,0,10,0"/>
72             </Grid>
73             <StackPanel Orientation="Horizontal" Margin="0,0,0,0">
74                 <TextBlock Text="Rate" Width="70" Margin="10,10,0,0"   />
75                 <Slider Name="voiceRateSlider" 
76                         Value="0"
77                         Minimum="-5" 
78                         Maximum="5" 
79                         TickPlacement="BottomRight" 
80                         TickFrequency="1" 
81                         IsSnapToTickEnabled="True"
82                         Width="170" 
83                         Margin="10,10,10,0"/>
84                 <TextBlock Text="{Binding ElementName=voiceRateSlider, Path=Value}" Width="40" Margin="0,10,0,0"/>
85                 <TextBlock Text="Voice Rate" Width="70" Margin="10,10,0,0"   />
86             </StackPanel>
87             
88             <StackPanel Orientation="Horizontal" Margin="0,0,0,0">
89                 <TextBlock Text="Volume" Width="70" Margin="10,10,0,0"   />
90                 <Slider Name="voiceVolumeSlider" 
91                         Value="50"
92                         Minimum="0" 
93                         Maximum="100" 
94                         TickPlacement="BottomRight" 
95                         TickFrequency="10" 
96                         IsSnapToTickEnabled="False"
97                         Width="170" 
98                         Margin="10,10,10,0"/>
99                 <TextBlock Text="{Binding ElementName=voiceVolumeSlider, Path=Value}" Width="40" Margin="0,10,0,0"/>
100             </StackPanel>
102             <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
103                 <Button Content="New Sentence"  Name="buttonAddItem" Click="buttonAddItem_Click"  Margin="0,10,0,0" Width="140" />
104                 <Button Content="Play Sentence" Name="buttonPlay" Click="buttonPlay_Click" Margin="10,10,0,0" Width="140" />
105             </StackPanel>
106             <Separator Height="5" />
107             <TextBlock Text="Voice Files" Margin="5,0,0,0" FontSize="18"   />
108             <StackPanel Orientation="Horizontal" >
109                 <TextBlock Text="Rate" Width="70" Margin="10,0,0,0"   />
110                 <Slider Name="fileRateSlider" 
111                         Value="0"
112                         Minimum="-5" 
113                         Maximum="5" 
114                         TickPlacement="BottomRight" 
115                         TickFrequency="1" 
116                         IsSnapToTickEnabled="True"
117                         Width="170" 
118                         Margin="10,0,10,0"/>
119                 <TextBlock Text="{Binding ElementName=fileRateSlider, Path=Value}" Width="40" />
120             </StackPanel>
121             <StackPanel Orientation="Horizontal" Margin="0,0,0,0">
122                 <TextBlock Text="Volume" Width="70" Margin="10,10,0,0"   />
123                 <Slider Name="fileVolumeSlider" 
124                         Value="50"
125                         Minimum="0" 
126                         Maximum="100" 
127                         TickPlacement="BottomRight" 
128                         TickFrequency="10" 
129                         IsSnapToTickEnabled="False"
130                         Width="170" 
131                         Margin="10,10,10,0"/>
132                 <TextBlock Text="{Binding ElementName=fileVolumeSlider, Path=Value}" Width="40" Margin="0,10,0,0"/>
133             </StackPanel>
136             <StackPanel Orientation="Horizontal">
137                 <TextBlock Text="Sample Rate"  Width="70" Margin="10,10,0,0"   />
138                 <RadioButton Content="8 KHz" Height="16" Name="rb8khz" Margin="10,10,0,0"/>
139                 <RadioButton Content="16 kHz" Height="16" Name="rb16khz" IsChecked="True" Margin="10,10,0,0" />
140                 <RadioButton Content="32 kHz" Height="16" Name="rb32khz"  Margin="10,10,0,0"/>
141             </StackPanel>
142             <Button Content="Generate Voice Files" Name="buttonGenerate" Click="buttonSaveFiles_Click" Margin="10,10,10,0" />
143             <Separator Height="5" />
145         </StackPanel>
146         <StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Right">
147             <TextBlock FontSize="18" VerticalAlignment="Center" MouseLeftButtonDown="InstallVoices_MouseLeftButtonDown" Cursor="Hand" HorizontalAlignment="Center" Margin="20,0,20,0" TextWrapping="Wrap" Height="48" Width="59" IsHyphenationEnabled="True">Install Voices</TextBlock>
148             <Image Name="openTXLogo" Height="48"  MouseLeftButtonDown="openTXLogo_MouseLeftButtonDown" HorizontalAlignment="Right" Cursor="Hand" Source="/OpenTXspeaker;component/speaker_logo.png" />
149         </StackPanel>
150     </Grid>
151 </Window>