Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
Fixed Status on Conversion End
Browse files Browse the repository at this point in the history
  • Loading branch information
gfrn committed Jun 20, 2019
1 parent c117864 commit 0f8453c
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 33 deletions.
2 changes: 1 addition & 1 deletion App.config
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<value />
</setting>
<setting name="CurrentVersionYoutubeDL" serializeAs="String">
<value>2019.04.30</value>
<value>2019.06.08</value>
</setting>
</youtube_dl.Properties.Settings>
</userSettings>
Expand Down
53 changes: 28 additions & 25 deletions Converter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,7 @@ public partial class Converter : Form
private string videoAudioFilter = "mp4|*.mp4|m4a|*.m4a|3gp|*.3gp|m4v|*.m4v|mov|*.mov|webm|*.webm|ogg|*.ogg|mp3|*.mp3|flac|*.flac";
private string imageFilter = "png|*.png";

ProcessStartInfo ffmpegInfo = new ProcessStartInfo
{

UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true,
StandardOutputEncoding = Encoding.UTF8,
FileName = "ffmpeg.exe"
};
private Process ffMpegProc = new Process();

public Converter()
{
Expand Down Expand Up @@ -121,27 +113,38 @@ private void ConvertButton_Click(object sender, EventArgs e)
}
}

ffmpegInfo.Arguments = args;
Process ffmpegProc = Process.Start(ffmpegInfo);
ffMpegProc.StartInfo.Arguments = args;
ffMpegProc.StartInfo.UseShellExecute = false;
ffMpegProc.StartInfo.RedirectStandardOutput = true;
ffMpegProc.StartInfo.CreateNoWindow = true;
ffMpegProc.StartInfo.StandardOutputEncoding = Encoding.UTF8;
ffMpegProc.StartInfo.FileName = "ffmpeg.exe";

ffmpegProc.OutputDataReceived += new DataReceivedEventHandler(
(s, f) =>
{
AddSubsButton.Enabled = CancelImportButton.Visible = CancelJoinButton.Visible = CancelMergeButton.Visible = CancelSubtitlesButton.Visible = false;
EndOfVideoCheckbox.Enabled = ConvertButton.Enabled = SaveFileButton.Enabled = OpenFileButton.Enabled = MergeButton.Enabled = false;
ffMpegProc.EnableRaisingEvents = true;
ffMpegProc.Exited += new EventHandler(ffMpegProc_Exited);

statusLabel.Text = Properties.strings.FFMpeg;
});
ffMpegProc.Start();

statusLabel.Text = Properties.strings.Done;
AddSubsButton.Enabled = CancelImportButton.Visible = CancelJoinButton.Visible = CancelMergeButton.Visible = CancelSubtitlesButton.Visible = false;
EndOfVideoCheckbox.Enabled = ConvertButton.Enabled = SaveFileButton.Enabled = OpenFileButton.Enabled = MergeButton.Enabled = CutStartTextbox.Enabled = EndOfVideoCheckbox.Enabled = false;

OriginalFileLabel.Text = "";
OutputFileLabel.Text = "";
inputFile = "";
outputFile = "";
ConvertFromToLabel.Text = "";
statusLabel.Text = Properties.strings.FFMpeg;
}

ConvertButton.Enabled = false;
private void ffMpegProc_Exited(object sender, EventArgs e)
{
this.BeginInvoke((Action)(() =>
{
OriginalFileLabel.Text = "";
OutputFileLabel.Text = "";
inputFile = "";
outputFile = "";
ConvertFromToLabel.Text = "";
OpenFileButton.Enabled = CutStartTextbox.Enabled = EndOfVideoCheckbox.Enabled = JoinVideosButton.Enabled = true;
statusLabel.Text = Properties.strings.Done;
}));
}

private void EndOfVideoCheckbox_CheckedChanged(object sender, EventArgs e)
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// É possível especificar todos os valores ou usar como padrão os Números de Build e da Revisão
// utilizando o "*" como mostrado abaixo:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.2.0")]
[assembly: AssemblyFileVersion("1.2.2.0")]
[assembly: AssemblyVersion("1.2.3.1")]
[assembly: AssemblyFileVersion("1.2.3.1")]
4 changes: 2 additions & 2 deletions Properties/Settings.Designer.cs

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

2 changes: 1 addition & 1 deletion Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Value Profile="(Default)" />
</Setting>
<Setting Name="CurrentVersionYoutubeDL" Type="System.String" Scope="User">
<Value Profile="(Default)">2019.04.07</Value>
<Value Profile="(Default)">2019.06.08</Value>
</Setting>
</Settings>
</SettingsFile>
3 changes: 3 additions & 0 deletions Properties/strings.pt-BR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@
<data name="NoDownload" xml:space="preserve">
<value>Nenhum Download</value>
</data>
<data name="Overwrite" xml:space="preserve">
<value>Você não pode escolher o mesmo nome e extensão do arquivo original. Por favor escolha outro nome.</value>
</data>
<data name="SaveChanges" xml:space="preserve">
<value>Salvar</value>
</data>
Expand Down
3 changes: 3 additions & 0 deletions Properties/strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@
<data name="NoDownload" xml:space="preserve">
<value>No Download</value>
</data>
<data name="Overwrite" xml:space="preserve">
<value>You cannot choose the same name and extension as the original file. Please pick another name.</value>
</data>
<data name="SaveChanges" xml:space="preserve">
<value>Save Changes</value>
</data>
Expand Down
9 changes: 9 additions & 0 deletions Properties/strings1.Designer.cs

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

4 changes: 2 additions & 2 deletions youtube-dl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>false</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.2.2.%2a</ApplicationVersion>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.2.3.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down

0 comments on commit 0f8453c

Please sign in to comment.