<commit_before>﻿<base:BasicWindow x:Class="Aldentea.SweetMutus.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
				xmlns:sys="clr-namespace:System;assembly=mscorlib"
				xmlns:base="clr-namespace:Aldentea.Wpf.Application;assembly=AldenteaWpfApplication"
        xmlns:util="clr-namespace:Aldentea.Wpf.Utility;assembly=AldenteaWpfUtility"
				xmlns:hypermutus="clr-namespace:HyperMutus;assembly=MutusBase"
				xmlns:grand="clr-namespace:GrandMutus.Base;assembly=GrandMutusBase"
				xmlns:local="clr-namespace:Aldentea.SweetMutus"
				xmlns:ud="clr-namespace:Aldentea.Wpf.Controls;assembly=UpDownControl"
				OpenFileDialogFilter="SweetMutusファイル(*.smt)|*.smt"
				SaveFileDialogFilter="SweetMutusファイル(*.smt)|*.smt"
        Height="600" Width="800">
	<Window.Resources>
		<util:CaptionConverter x:Key="captionConverter" ApplicationName="SweetMutus" />
		<util:TimeSpanDoubleConverter x:Key="timeSpanDoubleConverter" />
		<grand:NullableIntConverter x:Key="noConverter" />
		<grand:VisibilityConverter x:Key="categoryVisibilityConverter" />
		<grand:VisibilityConverter x:Key="fileNameVisibilityConverter" />
	</Window.Resources>
	<Window.Title>
		<MultiBinding Converter="{StaticResource captionConverter}">
			<Binding Path="FileName" />
			<Binding Path="IsModified" />
			<Binding Path="IsReadOnly" />
		</MultiBinding>
	</Window.Title>
	<Window.CommandBindings>
		<CommandBinding Command="{x:Static grand:Commands.AddQuestionsCommand}"
										Executed="AddQuestions_Executed" CanExecute="Always_CanExecute"/>
		<CommandBinding Command="{x:Static local:Commands.ExportCommand}"
										Executed="Export_Executed" CanExecute="Always_CanExecute" />
		<CommandBinding Command="{x:Static grand:Commands.SetRootDirectoryCommand}"
										Executed="SetRootDirectory_Executed" CanExecute="Always_CanExecute" />
		<CommandBinding Command="{x:Static local:Commands.SaveAsMtqCommand}"
										Executed="SaveAsMtq_Executed" CanExecute="Always_CanExecute" />
		<CommandBinding Command="Play"
										Executed="Play_Executed"
										CanExecute="Play_CanExecute" />
		<CommandBinding
										Command="{x:Static hypermutus:Commands.SwitchPlayPauseCommand}"
										Executed="SwitchPlayPause_Executed"
										CanExecute="SongPlayer_CanExecute" />
		<CommandBinding
										Command="{x:Static hypermutus:Commands.SeekSabiCommand}"
										Executed="SeekSabi_Executed"
										CanExecute="SongPlayer_CanExecute" />
		<CommandBinding Command="{x:Static grand:Commands.SetSabiPosCommand}"
										Executed="SetSabiPos_Executed"
										CanExecute="SongPlayer_CanExecute" />
		<CommandBinding Command="{x:Static hypermutus:Commands.SeekRelativeCommand}"
										Executed="SeekRelative_executed"
										CanExecute="SongPlayer_CanExecute" />
	</Window.CommandBindings>
	<Window.InputBindings>
		<KeyBinding Key="F7" Modifiers="Shift" Command="{x:Static hypermutus:Commands.SeekRelativeCommand}" CommandParameter="30" />
		<KeyBinding Key="F7" Command="{x:Static hypermutus:Commands.SeekRelativeCommand}" CommandParameter="5" />
		<KeyBinding Key="F4" Command="{x:Static hypermutus:Commands.SeekRelativeCommand}" CommandParameter="-5" />
		<KeyBinding Key="F4" Modifiers="Shift" Command="{x:Static hypermutus:Commands.SeekRelativeCommand}" CommandParameter="-30" />
		<KeyBinding Key="F6" Command="{x:Static hypermutus:Commands.SeekSabiCommand}" />
	</Window.InputBindings>

	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="*" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>

		<Menu Name="MainMenu" Grid.Row="0" HorizontalAlignment="Stretch">
			<MenuItem Header="ファイル(_F)">
				<MenuItem Header="新規作成(_N)" Command="New" />
				<MenuItem Header="開く(_O)" Command="Open" />
				<MenuItem Header="履歴から開く(_H)" Name="menuItemHistory" />
				<MenuItem Header="保存(_S)" Command="Save" />
				<MenuItem Header="名前をつけて保存(_A)" Command="SaveAs" />
				<MenuItem Header="エクスポート(_E)" Command="{x:Static local:Commands.ExportCommand}" />
				<MenuItem Header="HyperMutus用に保存(_M)" Command="{x:Static local:Commands.SaveAsMtqCommand}" />
				<Separator />
				<MenuItem Header="終了(_X)" Command="Close" />
			</MenuItem>
			<MenuItem Header="編集(_E)">
				<MenuItem Header="元に戻す(_U)" Command="Undo" />
				<MenuItem Header="やり直し(_R)" Command="Redo" />
			</MenuItem>
			<MenuItem Header="曲リスト(_S)">
				<MenuItem Header="曲追加(_A)" Command="{x:Static grand:Commands.AddQuestionsCommand}" />
				<MenuItem Header="曲追加(フォルダ選択)(_D)"
									Command="{x:Static grand:Commands.AddQuestionsCommand}">
					<MenuItem.CommandParameter>
						<sys:Boolean>True</sys:Boolean>
					</MenuItem.CommandParameter>
				</MenuItem>
				<MenuItem Header="ホームフォルダ変更(_H)" Command="{x:Static grand:Commands.SetRootDirectoryCommand}" />
			</MenuItem>
			<MenuItem Header="表示(_V)">
				<MenuItem Name="menuItemCategoryVisible" Header="カテゴリ" IsCheckable="True" IsChecked="False" />
				<MenuItem Name="menuItemFileNameColumnVisible" Header="ファイル名列" IsCheckable="True" IsChecked="False" />
			</MenuItem>
			<MenuItem Header="お試し">
				<MenuItem Header="フィルタ" Click="MenuItemFilter_Click" />
			</MenuItem>
		</Menu>

		<GroupBox Header="カテゴリ" HorizontalAlignment="Left" Margin="6,6" Grid.Row="1"
				Width="213"
				Visibility="{Binding ElementName=menuItemCategoryVisible, Path=IsChecked, Converter={StaticResource categoryVisibilityConverter}}">
			<GroupBox.CommandBindings>
				<CommandBinding Command="{x:Static local:Commands.AddCategoryCommand}"
												Executed="AddCategory_Executed" CanExecute="AddCategory_CanExecute" />
			</GroupBox.CommandBindings>
			<StackPanel>
				<ComboBox HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="6,3" Name="comboBoxCategories"
									SelectionChanged="comboBoxCategories_SelectionChanged"/>
				<Expander Header="カテゴリ追加" Collapsed="Expander_Expanded" Expanded="Expander_Expanded">
					<StackPanel Orientation="Horizontal">
						<TextBox MinWidth="100" Margin="3,5" Name="textBoxNewCategory" ToolTip="追加するカテゴリの名前を入れて下さい。" />
						<Button Content="追加" MinWidth="60" Margin="3"
										Command="{x:Static local:Commands.AddCategoryCommand}"
										CommandParameter="{Binding ElementName=textBoxNewCategory, Path=Text}" />
					</StackPanel>
				</Expander>
			</StackPanel>
		</GroupBox>

		<DataGrid Margin="10" Grid.Row="2"
							ItemsSource="{Binding Questions}" AutoGenerateColumns="False"
							CanUserAddRows="False" CanUserSortColumns="False"
							Name="dataGridQuestions"
							>
			<DataGrid.Columns>
				<DataGridTextColumn Header="#" Binding="{Binding Path=ID}" IsReadOnly="True" />
				<DataGridTextColumn Header="No" Binding="{Binding Path=No, Converter={StaticResource noConverter}}" />
				<DataGridTextColumn Header="Title" Binding="{Binding Path=Title}" />
				<DataGridTextColumn Header="Artist" Binding="{Binding Path=Artist}" />
				<!-- このVisibilityのバインディングが機能していない。
				たぶんXAMLのスコープの話だと思うが、どうすればいいのかはよくわからない。-->
				<DataGridTextColumn Header="FileName" Binding="{Binding Path=RelativeFileName}" IsReadOnly="True"
														Visibility="{Binding ElementName=menuItemFileNameColumnVisible, Path=IsChecked,
																									Converter={StaticResource fileNameVisibilityConverter}}"
														/>
				<DataGridTextColumn Header="Start" Binding="{Binding Path=PlayPos, Converter={StaticResource timeSpanDoubleConverter}}"
														>
					<DataGridTextColumn.CellStyle>
						<Style TargetType="DataGridCell">
							<Setter Property="HorizontalContentAlignment" Value="Right" />
						</Style>
					</DataGridTextColumn.CellStyle>
				</DataGridTextColumn>
				<DataGridTextColumn Header="Sabi" Binding="{Binding Path=SabiPos, Converter={StaticResource timeSpanDoubleConverter}}" />
			</DataGrid.Columns>
		</DataGrid>

		<Expander Header="曲再生" Name="expanderSongPlayer" Margin="0" Grid.Row="3"
							DataContext="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=CurrentSong}">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
				</Grid.RowDefinitions>
				<Button Content="Play" Grid.Row="0" Height="30" Width="75"
								HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,5"
								Command="{x:Static hypermutus:Commands.SwitchPlayPauseCommand}" />
				<Button Content="サビ" Grid.Row="0" Height="30" Width="75"
								HorizontalAlignment="Left" VerticalAlignment="Top" Margin="99,5,0,5"
								Command="{x:Static hypermutus:Commands.SeekSabiCommand}" />
				<Button Content="サビ設定" Grid.Row="0" Height="30" Width="75"
								HorizontalAlignment="Left" VerticalAlignment="Top" Margin="290,5,0,5"
								Command="{x:Static grand:Commands.SetSabiPosCommand}" />
				<TextBox HorizontalAlignment="Left" Grid.Row="0" Height="30" Margin="385,5,0,5"
									TextWrapping="Wrap" Text="{Binding Path=SabiPos, StringFormat=m\\:ss\\.ff}"
									VerticalAlignment="Top" Width="77" HorizontalContentAlignment="Right" VerticalContentAlignment="Center"/>
				<ud:UpDownControl Grid.Row="0" Height="30" Width="36" Margin="462,5,0,5" HorizontalAlignment="Left" VerticalAlignment="Top"
									UpClick="UpDownControl_UpClick" DownClick="UpDownControl_DownClick" /><commit_msg>レイアウトを調整。<commit_after>﻿<base:BasicWindow x:Class="Aldentea.SweetMutus.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
				xmlns:sys="clr-namespace:System;assembly=mscorlib"
				xmlns:base="clr-namespace:Aldentea.Wpf.Application;assembly=AldenteaWpfApplication"
        xmlns:util="clr-namespace:Aldentea.Wpf.Utility;assembly=AldenteaWpfUtility"
				xmlns:hypermutus="clr-namespace:HyperMutus;assembly=MutusBase"
				xmlns:grand="clr-namespace:GrandMutus.Base;assembly=GrandMutusBase"
				xmlns:local="clr-namespace:Aldentea.SweetMutus"
				xmlns:ud="clr-namespace:Aldentea.Wpf.Controls;assembly=UpDownControl"
				OpenFileDialogFilter="SweetMutusファイル(*.smt)|*.smt"
				SaveFileDialogFilter="SweetMutusファイル(*.smt)|*.smt"
        Height="600" Width="800">
	<Window.Resources>
		<util:CaptionConverter x:Key="captionConverter" ApplicationName="SweetMutus" />
		<util:TimeSpanDoubleConverter x:Key="timeSpanDoubleConverter" />
		<grand:NullableIntConverter x:Key="noConverter" />
		<grand:VisibilityConverter x:Key="categoryVisibilityConverter" />
		<grand:VisibilityConverter x:Key="fileNameVisibilityConverter" />
		<Style TargetType="DataGridCell" x:Key="numericCellStyle">
			<Setter Property="HorizontalAlignment" Value="Right" />
		</Style>
	</Window.Resources>
	<Window.Title>
		<MultiBinding Converter="{StaticResource captionConverter}">
			<Binding Path="FileName" />
			<Binding Path="IsModified" />
			<Binding Path="IsReadOnly" />
		</MultiBinding>
	</Window.Title>
	<Window.CommandBindings>
		<CommandBinding Command="{x:Static grand:Commands.AddQuestionsCommand}"
										Executed="AddQuestions_Executed" CanExecute="Always_CanExecute"/>
		<CommandBinding Command="{x:Static local:Commands.ExportCommand}"
										Executed="Export_Executed" CanExecute="Always_CanExecute" />
		<CommandBinding Command="{x:Static grand:Commands.SetRootDirectoryCommand}"
										Executed="SetRootDirectory_Executed" CanExecute="Always_CanExecute" />
		<CommandBinding Command="{x:Static local:Commands.SaveAsMtqCommand}"
										Executed="SaveAsMtq_Executed" CanExecute="Always_CanExecute" />
		<CommandBinding Command="Play"
										Executed="Play_Executed"
										CanExecute="Play_CanExecute" />
		<CommandBinding
										Command="{x:Static hypermutus:Commands.SwitchPlayPauseCommand}"
										Executed="SwitchPlayPause_Executed"
										CanExecute="SongPlayer_CanExecute" />
		<CommandBinding
										Command="{x:Static hypermutus:Commands.SeekSabiCommand}"
										Executed="SeekSabi_Executed"
										CanExecute="SongPlayer_CanExecute" />
		<CommandBinding Command="{x:Static grand:Commands.SetSabiPosCommand}"
										Executed="SetSabiPos_Executed"
										CanExecute="SongPlayer_CanExecute" />
		<CommandBinding Command="{x:Static hypermutus:Commands.SeekRelativeCommand}"
										Executed="SeekRelative_executed"
										CanExecute="SongPlayer_CanExecute" />
	</Window.CommandBindings>
	<Window.InputBindings>
		<KeyBinding Key="F7" Modifiers="Shift" Command="{x:Static hypermutus:Commands.SeekRelativeCommand}" CommandParameter="30" />
		<KeyBinding Key="F7" Command="{x:Static hypermutus:Commands.SeekRelativeCommand}" CommandParameter="5" />
		<KeyBinding Key="F4" Command="{x:Static hypermutus:Commands.SeekRelativeCommand}" CommandParameter="-5" />
		<KeyBinding Key="F4" Modifiers="Shift" Command="{x:Static hypermutus:Commands.SeekRelativeCommand}" CommandParameter="-30" />
		<KeyBinding Key="F6" Command="{x:Static hypermutus:Commands.SeekSabiCommand}" />
	</Window.InputBindings>

	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="*" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>

		<Menu Name="MainMenu" Grid.Row="0" HorizontalAlignment="Stretch">
			<MenuItem Header="ファイル(_F)">
				<MenuItem Header="新規作成(_N)" Command="New" />
				<MenuItem Header="開く(_O)" Command="Open" />
				<MenuItem Header="履歴から開く(_H)" Name="menuItemHistory" />
				<MenuItem Header="保存(_S)" Command="Save" />
				<MenuItem Header="名前をつけて保存(_A)" Command="SaveAs" />
				<MenuItem Header="エクスポート(_E)" Command="{x:Static local:Commands.ExportCommand}" />
				<MenuItem Header="HyperMutus用に保存(_M)" Command="{x:Static local:Commands.SaveAsMtqCommand}" />
				<Separator />
				<MenuItem Header="終了(_X)" Command="Close" />
			</MenuItem>
			<MenuItem Header="編集(_E)">
				<MenuItem Header="元に戻す(_U)" Command="Undo" />
				<MenuItem Header="やり直し(_R)" Command="Redo" />
			</MenuItem>
			<MenuItem Header="曲リスト(_S)">
				<MenuItem Header="曲追加(_A)" Command="{x:Static grand:Commands.AddQuestionsCommand}" />
				<MenuItem Header="曲追加(フォルダ選択)(_D)"
									Command="{x:Static grand:Commands.AddQuestionsCommand}">
					<MenuItem.CommandParameter>
						<sys:Boolean>True</sys:Boolean>
					</MenuItem.CommandParameter>
				</MenuItem>
				<MenuItem Header="ホームフォルダ変更(_H)" Command="{x:Static grand:Commands.SetRootDirectoryCommand}" />
			</MenuItem>
			<MenuItem Header="表示(_V)">
				<MenuItem Name="menuItemCategoryVisible" Header="カテゴリ" IsCheckable="True" IsChecked="False" />
				<MenuItem Name="menuItemFileNameColumnVisible" Header="ファイル名列" IsCheckable="True" IsChecked="False" />
			</MenuItem>
			<MenuItem Header="お試し">
				<MenuItem Header="フィルタ" Click="MenuItemFilter_Click" />
			</MenuItem>
		</Menu>

		<GroupBox Header="カテゴリ" HorizontalAlignment="Left" Margin="6,6" Grid.Row="1"
				Width="213"
				Visibility="{Binding ElementName=menuItemCategoryVisible, Path=IsChecked, Converter={StaticResource categoryVisibilityConverter}}">
			<GroupBox.CommandBindings>
				<CommandBinding Command="{x:Static local:Commands.AddCategoryCommand}"
												Executed="AddCategory_Executed" CanExecute="AddCategory_CanExecute" />
			</GroupBox.CommandBindings>
			<StackPanel>
				<ComboBox HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="6,3" Name="comboBoxCategories"
									SelectionChanged="comboBoxCategories_SelectionChanged"/>
				<Expander Header="カテゴリ追加" Collapsed="Expander_Expanded" Expanded="Expander_Expanded">
					<StackPanel Orientation="Horizontal">
						<TextBox MinWidth="100" Margin="3,5" Name="textBoxNewCategory" ToolTip="追加するカテゴリの名前を入れて下さい。" />
						<Button Content="追加" MinWidth="60" Margin="3"
										Command="{x:Static local:Commands.AddCategoryCommand}"
										CommandParameter="{Binding ElementName=textBoxNewCategory, Path=Text}" />
					</StackPanel>
				</Expander>
			</StackPanel>
		</GroupBox>

		<DataGrid Margin="10" Grid.Row="2"
							ItemsSource="{Binding Questions}" AutoGenerateColumns="False"
							CanUserAddRows="False" CanUserSortColumns="False"
							Name="dataGridQuestions"
							>
			<DataGrid.Columns>
				<DataGridTextColumn Header="#" Binding="{Binding Path=ID}" IsReadOnly="True"
														CellStyle="{StaticResource numericCellStyle}" />
				<DataGridTextColumn Header="No" Binding="{Binding Path=No, Converter={StaticResource noConverter}}"
														CellStyle="{StaticResource numericCellStyle}" />
				<DataGridTextColumn Header="Title" Binding="{Binding Path=Title}" Width="*" />
				<DataGridTextColumn Header="Artist" Binding="{Binding Path=Artist}" Width="*" />
				<!-- このVisibilityのバインディングが機能していない。
				たぶんXAMLのスコープの話だと思うが、どうすればいいのかはよくわからない。-->
<!--				<DataGridTextColumn Header="FileName" Binding="{Binding Path=RelativeFileName}" IsReadOnly="True"
														Visibility="{Binding ElementName=menuItemFileNameColumnVisible, Path=IsChecked,
																									Converter={StaticResource fileNameVisibilityConverter}}"
														/>
-->				<DataGridTextColumn Header="FileName" Binding="{Binding Path=RelativeFileName}" IsReadOnly="True"
														Visibility="Collapsed"		/>
				<DataGridTextColumn Header="Start" Binding="{Binding Path=PlayPos, Converter={StaticResource timeSpanDoubleConverter}}"
														CellStyle="{StaticResource numericCellStyle}" MinWidth="60" />
				<DataGridTextColumn Header="Sabi" Binding="{Binding Path=SabiPos, Converter={StaticResource timeSpanDoubleConverter}}"
														CellStyle="{StaticResource numericCellStyle}" MinWidth="60" />
			</DataGrid.Columns>
		</DataGrid>

		<Expander Header="曲再生" Name="expanderSongPlayer" Margin="0" Grid.Row="3"
							DataContext="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=CurrentSong}">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
				</Grid.RowDefinitions>
				<Button Content="Play" Grid.Row="0" Height="30" Width="75"
								HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,5"
								Command="{x:Static hypermutus:Commands.SwitchPlayPauseCommand}" />
				<Button Content="サビ" Grid.Row="0" Height="30" Width="75"
								HorizontalAlignment="Left" VerticalAlignment="Top" Margin="99,5,0,5"
								Command="{x:Static hypermutus:Commands.SeekSabiCommand}" />
				<Button Content="サビ設定" Grid.Row="0" Height="30" Width="75"
								HorizontalAlignment="Left" VerticalAlignment="Top" Margin="290,5,0,5"
								Command="{x:Static grand:Commands.SetSabiPosCommand}" />
				<TextBox HorizontalAlignment="Left" Grid.Row="0" Height="30" Margin="385,5,0,5"
									TextWrapping="Wrap" Text="{Binding Path=SabiPos, StringFormat=m\\:ss\\.ff}"
									VerticalAlignment="Top" Width="77" HorizontalContentAlignment="Right" VerticalContentAlignment="Center"/>
				<ud:UpDownControl Grid.Row="0" Height="30" Width="36" Margin="462,5,0,5" HorizontalAlignment="Left" VerticalAlignment="Top"
									UpClick="UpDownControl_UpClick" DownClick="UpDownControl_DownClick" />
{'fraction_non_alphanumeric': 0.14569571143965607, 'fraction_numerical': 0.010485477613505295, 'mean_word_length': 5.339315387171818, 'pattern_counts': {'":': 0, '<': 238, '<?xml version=': 0, '>': 238, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 18}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4007787', 'n_tokens_mistral': 7400, 'n_tokens_neox': 5889, 'n_words': 796}