mirror of
https://github.com/wagesj45/butterflow-ui.git
synced 2025-09-09 03:00:39 -05:00
Processing Videos
Can now actually process a video. Needs some safety checks to make sure the user doesn't select something that causes it to go haywire.
This commit is contained in:
parent
3af7fd2b2c
commit
da04af543b
7 changed files with 124 additions and 26 deletions
|
|
@ -112,17 +112,30 @@ namespace butterflow_ui
|
|||
if (result.HasValue && result.Value)
|
||||
{
|
||||
this.OptionsConfiguration.VideoInput = ofd.FileName;
|
||||
|
||||
//this.ButterflowWrapper.ConsoleOutputRecieved += (o, ce) => this.txtConsoleOutput.Text = ce.ConsoleOutput;
|
||||
|
||||
this.ButterflowWrapper.Probe(ofd.FileName);
|
||||
|
||||
//Hack to get the first frame to display in the media preview element.
|
||||
//This also triggers the MediaOpened event so we can get the metadata from the element.
|
||||
mediaPreview.Play();
|
||||
mediaPreview.PausePlayback();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Event handler. Called by btnFileOutputPicker for click events. </summary>
|
||||
/// <param name="sender"> Source of the event. </param>
|
||||
/// <param name="e"> Routed event information. </param>
|
||||
private void btnFileOutputPicker_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var sfd = new SaveFileDialog();
|
||||
sfd.Filter = "MPEG 4|*.mp4";
|
||||
|
||||
var result = sfd.ShowDialog(this);
|
||||
if (result.HasValue && result.Value)
|
||||
{
|
||||
this.OptionsConfiguration.VideoOutput = sfd.FileName;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Event handler. Called by PlaybackRate radio buttons for checked events. </summary>
|
||||
/// <param name="sender"> Source of the event. </param>
|
||||
/// <param name="e"> Routed event information. </param>
|
||||
|
|
@ -268,20 +281,36 @@ namespace butterflow_ui
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary> Event handler. Called by TextBox for got focus events. </summary>
|
||||
/// <summary> Event handler. Called by txtPlaybackRate for got focus events. </summary>
|
||||
/// <param name="sender"> Source of the event. </param>
|
||||
/// <param name="e"> Routed event information. </param>
|
||||
private void TextBox_GotFocus(object sender, RoutedEventArgs e)
|
||||
private void txtPlaybackRate_GotFocus(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//Clear all the radio buttons because we got focus from the user in the playbackrate textbox.
|
||||
var playbackRateRadioButtons = GetRecursiveChildren<RadioButton>(this.butterflowUIWindow);
|
||||
|
||||
foreach(var radioButton in playbackRateRadioButtons)
|
||||
foreach (var radioButton in playbackRateRadioButtons)
|
||||
{
|
||||
radioButton.IsChecked = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Event handler. Called by btnCopyArguments for click events. </summary>
|
||||
/// <param name="sender"> Source of the event. </param>
|
||||
/// <param name="e"> Routed event information. </param>
|
||||
private void btnCopyArguments_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Clipboard.SetText(this.OptionsConfiguration.CommandLineOutput);
|
||||
}
|
||||
|
||||
/// <summary> Event handler. Called by btnProcess for click events. </summary>
|
||||
/// <param name="sender"> Source of the event. </param>
|
||||
/// <param name="e"> Routed event information. </param>
|
||||
private void btnProcess_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.ButterflowWrapper.Run(this.OptionsConfiguration);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue