Skip to content

Commit

Permalink
Default Output Location #104
Browse files Browse the repository at this point in the history
  • Loading branch information
Alkl58 committed Jun 3, 2022
1 parent 8559358 commit 78da9f0
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 12 deletions.
10 changes: 10 additions & 0 deletions NotEnoughAV1Encodes/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,16 @@ private void SingleFileInput(string path)
}
}
LabelVideoFramerate.Content = videoDB.MIFramerate + vfr;

// Output
if (!string.IsNullOrEmpty(settingsDB.DefaultOutPath))
{
string outPath = Path.Combine(settingsDB.DefaultOutPath, Path.GetFileNameWithoutExtension(videoDB.InputPath) + ".mkv");

videoDB.OutputPath = outPath;
LabelVideoDestination.Content = videoDB.OutputPath;
videoDB.OutputFileName = Path.GetFileName(videoDB.OutputPath);
}
}

private void ButtonSetDestination_Click(object sender, RoutedEventArgs e)
Expand Down
2 changes: 1 addition & 1 deletion NotEnoughAV1Encodes/NotEnoughAV1Encodes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>resources\img\neav1e.ico</ApplicationIcon>
<Version>2.0.6</Version>
<Version>2.0.7</Version>
<Authors>Alkl58</Authors>
</PropertyGroup>

Expand Down
28 changes: 17 additions & 11 deletions NotEnoughAV1Encodes/Views/ProgramSettings.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
lex:LocalizeDictionary.DesignCulture="en"
lex:ResxLocalizationProvider.DefaultAssembly="NotEnoughAV1Encodes"
lex:ResxLocalizationProvider.DefaultDictionary="Strings"
Title="{lex:Loc ProgramSettings}" Height="450" Width="800" ResizeMode="NoResize" Closing="MetroWindow_Closing" mah:ControlsHelper.ContentCharacterCasing="Normal">
Title="{lex:Loc ProgramSettings}" Height="530" Width="800" ResizeMode="NoResize" Closing="MetroWindow_Closing" mah:ControlsHelper.ContentCharacterCasing="Normal">
<Grid>
<Button x:Name="ButtonUpdater" Content="{lex:Loc}" Margin="0,0,152,17" RenderTransformOrigin="0.5,0.474" Click="ButtonUpdater_Click" Height="39" VerticalAlignment="Bottom" mah:ControlsHelper.ContentCharacterCasing="Normal" HorizontalAlignment="Right" Width="137" />
<Button x:Name="ButtonExit" Content="{lex:Loc}" HorizontalAlignment="Right" Margin="0,0,10,17" VerticalAlignment="Bottom" Height="39" Width="137" mah:ControlsHelper.ContentCharacterCasing="Normal" Click="ButtonExit_Click"/>
<GroupBox x:Name="GroupBoxThemeSettings" Header="{lex:Loc}" Margin="269,137,252,0" mah:ControlsHelper.ContentCharacterCasing="Normal" Height="122" VerticalAlignment="Top">
<GroupBox x:Name="GroupBoxThemeSettings" Header="{lex:Loc}" Margin="0,10,10,0" mah:ControlsHelper.ContentCharacterCasing="Normal" Height="122" VerticalAlignment="Top" HorizontalAlignment="Right" Width="237">
<Grid>
<Label x:Name="LabelAccentTheme" Content="{lex:Loc}" Margin="10,10,160,0" FontSize="12" Height="26" VerticalAlignment="Top" HorizontalContentAlignment="Right" />
<Label x:Name="LabelAccentTheme" Content="{lex:Loc}" Margin="10,10,118,0" FontSize="12" Height="26" VerticalAlignment="Top" HorizontalContentAlignment="Right" />
<ComboBox x:Name="ComboBoxAccentTheme" HorizontalAlignment="Left" Margin="114,10,0,0" Width="106" Height="26" VerticalAlignment="Top">
<ComboBoxItem Content="Blue" Foreground="#0767B3" IsSelected="True" />
<ComboBoxItem Content="Red" Foreground="#EA4333" />
Expand Down Expand Up @@ -46,11 +46,11 @@
<ComboBoxItem Content="Light" IsSelected="True" />
<ComboBoxItem Content="Dark" />
</ComboBox>
<Label x:Name="LabelBaseTheme" Content="{lex:Loc}" Margin="10,51,160,0" FontSize="12" Height="26" VerticalAlignment="Top" HorizontalContentAlignment="Right" />
<Label x:Name="LabelBaseTheme" Content="{lex:Loc}" Margin="10,51,118,0" FontSize="12" Height="26" VerticalAlignment="Top" HorizontalContentAlignment="Right" />

</Grid>
</GroupBox>
<GroupBox Margin="10,10,536,0" Height="348" VerticalAlignment="Top">
<GroupBox Margin="10,137,0,0" Height="348" VerticalAlignment="Top" HorizontalAlignment="Left" Width="254">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="55"/>
Expand All @@ -74,7 +74,7 @@
<Button x:Name="ButtonResetBGImage" Content="{lex:Loc}" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,52,0,0" Width="150" mah:ControlsHelper.ContentCharacterCasing="Normal" Click="ButtonResetBGImage_Click"/>
</Grid>
</GroupBox>
<GroupBox Margin="0,10,10,0" Height="122" VerticalAlignment="Top" HorizontalAlignment="Right" Width="237">
<GroupBox Margin="10,10,0,0" Height="122" VerticalAlignment="Top" HorizontalAlignment="Left" Width="254">
<Grid>
<Label x:Name="LabelTheme" Content="{lex:Loc}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="56" Margin="0,26,0,0"/>
<Label x:Name="LabelIcons" Content="{lex:Loc}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="56" Margin="0,52,0,0"/>
Expand All @@ -84,12 +84,11 @@
<Label x:Name="LabelVersion1" Content="" HorizontalAlignment="Left" VerticalAlignment="Top" Width="56" Margin="56,0,0,0"/>
</Grid>
</GroupBox>
<GroupBox Margin="0,10,252,0" mah:ControlsHelper.ContentCharacterCasing="Normal" Height="122" VerticalAlignment="Top" HorizontalAlignment="Right" Width="279">
<GroupBox Margin="269,10,252,0" mah:ControlsHelper.ContentCharacterCasing="Normal" Height="122" VerticalAlignment="Top" Header="{lex:Loc LabelTempPath}">
<Grid>
<Label x:Name="LabelTempPath" Content="{lex:Loc}" HorizontalAlignment="Left" Margin="0,6,0,0" VerticalAlignment="Top" Width="134"/>
<TextBox x:Name="TextBoxTempPath" HorizontalAlignment="Center" TextWrapping="Wrap" VerticalAlignment="Center" Width="249"/>
<Button x:Name="ButtonSelectTempPath" Content="{lex:Loc ButtonSelectBGImage}" HorizontalAlignment="Left" Margin="158,0,0,9" VerticalAlignment="Bottom" Height="21" Width="101" mah:ControlsHelper.ContentCharacterCasing="Normal" Click="ButtonSelectTempPath_Click"/>
<Button x:Name="ButtonSelectTempPathReset" Content="{lex:Loc ButtonResetBGImage}" HorizontalAlignment="Left" Margin="10,0,0,9" VerticalAlignment="Bottom" Height="21" Width="101" mah:ControlsHelper.ContentCharacterCasing="Normal" Click="ButtonSelectTempPathReset_Click"/>
<TextBox x:Name="TextBoxTempPath" HorizontalAlignment="Center" TextWrapping="Wrap" VerticalAlignment="Top" Width="249" Margin="0,10,0,0"/>
<Button x:Name="ButtonSelectTempPath" Content="{lex:Loc ButtonSelectBGImage}" HorizontalAlignment="Left" Margin="158,0,0,6" VerticalAlignment="Bottom" Height="21" Width="101" mah:ControlsHelper.ContentCharacterCasing="Normal" Click="ButtonSelectTempPath_Click"/>
<Button x:Name="ButtonSelectTempPathReset" Content="{lex:Loc ButtonResetBGImage}" HorizontalAlignment="Left" Margin="10,0,0,6" VerticalAlignment="Bottom" Height="21" Width="101" mah:ControlsHelper.ContentCharacterCasing="Normal" Click="ButtonSelectTempPathReset_Click"/>
</Grid>
</GroupBox>
<GroupBox Margin="269,264,252,0" Height="80" VerticalAlignment="Top">
Expand All @@ -114,6 +113,13 @@

</Grid>
</GroupBox>
<GroupBox Margin="269,137,252,0" mah:ControlsHelper.ContentCharacterCasing="Normal" Height="122" VerticalAlignment="Top" Header="{lex:Loc LabelDefaultOutputLocation}">
<Grid>
<TextBox x:Name="TextBoxDefaultOutPath" HorizontalAlignment="Center" TextWrapping="Wrap" VerticalAlignment="Top" Width="249" Margin="0,10,0,0"/>
<Button x:Name="ButtonSelectDefaultOutPath" Content="{lex:Loc ButtonSelectBGImage}" HorizontalAlignment="Left" Margin="158,0,0,6" VerticalAlignment="Bottom" Height="21" Width="101" mah:ControlsHelper.ContentCharacterCasing="Normal" Click="ButtonSelectDefaultOutPath_Click"/>
<Button x:Name="ButtonSelectDefaultOutPathReset" Content="{lex:Loc ButtonResetBGImage}" HorizontalAlignment="Left" Margin="10,0,0,6" VerticalAlignment="Bottom" Height="21" Width="101" mah:ControlsHelper.ContentCharacterCasing="Normal" Click="ButtonSelectDefaultOutPathReset_Click"/>
</Grid>
</GroupBox>

</Grid>
</mah:MetroWindow>
18 changes: 18 additions & 0 deletions NotEnoughAV1Encodes/Views/ProgramSettings.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public ProgramSettings(Settings settingsDB)
ComboBoxAccentTheme.SelectedIndex = settingsDB.AccentTheme;
ComboBoxBaseTheme.SelectedIndex = settingsDB.BaseTheme;
TextBoxTempPath.Text = settingsDB.TempPath;
TextBoxDefaultOutPath.Text = settingsDB.DefaultOutPath;
settingsDBTemp.BGImage = settingsDB.BGImage;
ComboBoxProcessPriority.SelectedIndex = settingsDB.PriorityNormal ? 0 : 1;
string AssemblyVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
Expand Down Expand Up @@ -73,6 +74,22 @@ private void ButtonSelectTempPath_Click(object sender, RoutedEventArgs e)
}
}

private void ButtonSelectDefaultOutPath_Click(object sender, RoutedEventArgs e)
{
using var dialog = new System.Windows.Forms.FolderBrowserDialog();
dialog.SelectedPath = TextBoxTempPath.Text;
System.Windows.Forms.DialogResult result = dialog.ShowDialog();
if (result == System.Windows.Forms.DialogResult.OK)
{
TextBoxDefaultOutPath.Text = dialog.SelectedPath + "\\";
}
}

private void ButtonSelectDefaultOutPathReset_Click(object sender, RoutedEventArgs e)
{
TextBoxDefaultOutPath.Text = "";
}

private void ButtonSelectTempPathReset_Click(object sender, RoutedEventArgs e)
{
TextBoxTempPath.Text = Path.GetTempPath();
Expand All @@ -96,6 +113,7 @@ private void MetroWindow_Closing(object sender, System.ComponentModel.CancelEven
settingsDBTemp.AccentTheme = ComboBoxAccentTheme.SelectedIndex;
settingsDBTemp.Theme = ComboBoxBaseTheme.Text + "." + ComboBoxAccentTheme.Text;
settingsDBTemp.TempPath = TextBoxTempPath.Text;
settingsDBTemp.DefaultOutPath = TextBoxDefaultOutPath.Text;
settingsDBTemp.PriorityNormal = ComboBoxProcessPriority.SelectedIndex == 0;
}

Expand Down
2 changes: 2 additions & 0 deletions NotEnoughAV1Encodes/resources/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class Settings
public bool OverrideWorkerCount { get; set; }
/// <summary>Specifies the Temp Folder used</summary>
public string TempPath { get; set; } = Path.GetTempPath();
/// <summary>Specifies the default Output Folder</summary>
public string DefaultOutPath { get; set; } = "";
/// <summary>Toggles Logging functionality</summary>
public bool Logging { get; set; } = true;
/// <summary>Toggles Auto Resume Pause functionality</summary>
Expand Down
9 changes: 9 additions & 0 deletions NotEnoughAV1Encodes/resources/lang/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions NotEnoughAV1Encodes/resources/lang/Strings.de.resx
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@
<data name="LabelDefaultAudioBehavior" xml:space="preserve">
<value>Standard Audio Einstellungen</value>
</data>
<data name="LabelDefaultOutputLocation" xml:space="preserve">
<value>Standard Ausgabe Ordner</value>
</data>
<data name="LabelDeinterlace" xml:space="preserve">
<value>Deinterlace:</value>
</data>
Expand Down
3 changes: 3 additions & 0 deletions NotEnoughAV1Encodes/resources/lang/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@
<data name="LabelDefaultAudioBehavior" xml:space="preserve">
<value>Default Audio Behavior</value>
</data>
<data name="LabelDefaultOutputLocation" xml:space="preserve">
<value>Default Output Location</value>
</data>
<data name="LabelDeinterlace" xml:space="preserve">
<value>Deinterlace:</value>
</data>
Expand Down

0 comments on commit 78da9f0

Please sign in to comment.