2013-11-03 23:53:49 +13:00
|
|
|
|
#region License Information (GPL v3)
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
ShareX - A program that allows you to take screenshots and share any file type
|
2014-05-13 21:06:40 +12:00
|
|
|
|
Copyright (C) 2007-2014 ShareX Developers
|
2013-11-03 23:53:49 +13:00
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
|
|
|
|
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#endregion License Information (GPL v3)
|
|
|
|
|
|
|
|
|
|
using HelpersLib;
|
2013-11-16 22:11:39 +13:00
|
|
|
|
using ScreenCaptureLib;
|
2013-11-03 23:53:49 +13:00
|
|
|
|
using ShareX.Properties;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace ShareX
|
|
|
|
|
{
|
|
|
|
|
public class ScreenRecordForm : TrayForm
|
|
|
|
|
{
|
|
|
|
|
public bool IsRecording { get; private set; }
|
|
|
|
|
|
|
|
|
|
private static ScreenRecordForm instance;
|
|
|
|
|
|
|
|
|
|
public static ScreenRecordForm Instance
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (instance == null || instance.IsDisposed)
|
|
|
|
|
{
|
|
|
|
|
instance = new ScreenRecordForm();
|
|
|
|
|
instance.Show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return instance;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ScreenRecorder screenRecorder;
|
2014-06-22 14:01:27 +12:00
|
|
|
|
private ScreenRegionForm regionForm;
|
2014-07-05 07:04:32 +12:00
|
|
|
|
private DWMManager dwmManager;
|
2014-11-11 13:32:24 +13:00
|
|
|
|
private bool abortRequested;
|
2013-11-03 23:53:49 +13:00
|
|
|
|
|
|
|
|
|
private ScreenRecordForm()
|
|
|
|
|
{
|
2014-05-28 00:58:59 +12:00
|
|
|
|
TrayIcon.Text = "ShareX";
|
2013-11-03 23:53:49 +13:00
|
|
|
|
TrayIcon.MouseClick += TrayIcon_MouseClick;
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-14 08:59:34 +13:00
|
|
|
|
public void StartStopRecording()
|
|
|
|
|
{
|
|
|
|
|
if (regionForm != null && !regionForm.IsDisposed)
|
|
|
|
|
{
|
|
|
|
|
regionForm.StartStop();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void StopRecording()
|
|
|
|
|
{
|
|
|
|
|
if (IsRecording && screenRecorder != null)
|
|
|
|
|
{
|
|
|
|
|
screenRecorder.StopRecording();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-03 23:53:49 +13:00
|
|
|
|
private void TrayIcon_MouseClick(object sender, MouseEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (e.Button == MouseButtons.Left)
|
|
|
|
|
{
|
2014-11-14 08:59:34 +13:00
|
|
|
|
StartStopRecording();
|
2013-11-03 23:53:49 +13:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-17 18:58:17 +12:00
|
|
|
|
public void StartRecording(TaskSettings taskSettings)
|
2013-11-03 23:53:49 +13:00
|
|
|
|
{
|
2014-07-17 18:58:17 +12:00
|
|
|
|
if (taskSettings.CaptureSettings.RunScreencastCLI)
|
2014-04-20 03:39:17 +12:00
|
|
|
|
{
|
2014-07-17 18:58:17 +12:00
|
|
|
|
if (!Program.Settings.VideoEncoders.IsValidIndex(taskSettings.CaptureSettings.VideoEncoderSelected))
|
2014-04-20 03:39:17 +12:00
|
|
|
|
{
|
2014-10-17 22:58:15 +13:00
|
|
|
|
MessageBox.Show(Resources.ScreenRecordForm_StartRecording_There_is_no_valid_CLI_video_encoder_selected_,
|
2014-10-18 01:19:28 +13:00
|
|
|
|
"ShareX", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
2014-04-20 03:39:17 +12:00
|
|
|
|
return;
|
|
|
|
|
}
|
2014-10-19 10:48:47 +13:00
|
|
|
|
|
|
|
|
|
if (!Program.Settings.VideoEncoders[taskSettings.CaptureSettings.VideoEncoderSelected].IsValid())
|
2014-04-20 03:39:17 +12:00
|
|
|
|
{
|
2014-10-17 22:58:15 +13:00
|
|
|
|
MessageBox.Show(Resources.ScreenRecordForm_StartRecording_CLI_video_encoder_file_does_not_exist__ +
|
|
|
|
|
Program.Settings.VideoEncoders[taskSettings.CaptureSettings.VideoEncoderSelected].Path,
|
2014-10-18 01:19:28 +13:00
|
|
|
|
"ShareX", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
2014-04-20 03:39:17 +12:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-29 20:34:12 +12:00
|
|
|
|
if (taskSettings.CaptureSettings.ScreenRecordOutput == ScreenRecordOutput.FFmpeg)
|
2014-05-10 12:23:47 +12:00
|
|
|
|
{
|
2014-08-29 20:34:12 +12:00
|
|
|
|
if (!File.Exists(taskSettings.CaptureSettings.FFmpegOptions.CLIPath))
|
2014-05-10 13:52:09 +12:00
|
|
|
|
{
|
2014-08-29 20:34:12 +12:00
|
|
|
|
string ffmpegText = string.IsNullOrEmpty(taskSettings.CaptureSettings.FFmpegOptions.CLIPath) ? "ffmpeg.exe" : taskSettings.CaptureSettings.FFmpegOptions.CLIPath;
|
|
|
|
|
|
2014-10-17 22:58:15 +13:00
|
|
|
|
if (MessageBox.Show(string.Format(Resources.ScreenRecordForm_StartRecording_does_not_exist, ffmpegText),
|
|
|
|
|
"ShareX - " + Resources.ScreenRecordForm_StartRecording_Missing + " ffmpeg.exe", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
|
2014-08-29 20:34:12 +12:00
|
|
|
|
{
|
2014-12-09 05:15:18 +13:00
|
|
|
|
if (FFmpegDownloader.DownloadFFmpeg(false, DownloaderForm_InstallRequested) == DialogResult.OK)
|
2014-08-29 20:34:12 +12:00
|
|
|
|
{
|
|
|
|
|
Program.DefaultTaskSettings.CaptureSettings.FFmpegOptions.CLIPath = taskSettings.TaskSettingsReference.CaptureSettings.FFmpegOptions.CLIPath =
|
|
|
|
|
taskSettings.CaptureSettings.FFmpegOptions.CLIPath = Path.Combine(Program.ToolsFolder, "ffmpeg.exe");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
2014-05-10 13:52:09 +12:00
|
|
|
|
{
|
2014-08-29 20:34:12 +12:00
|
|
|
|
return;
|
2014-05-10 13:52:09 +12:00
|
|
|
|
}
|
|
|
|
|
}
|
2014-08-29 20:34:12 +12:00
|
|
|
|
|
|
|
|
|
if (!taskSettings.CaptureSettings.FFmpegOptions.IsSourceSelected)
|
2014-05-10 20:04:18 +12:00
|
|
|
|
{
|
2014-10-17 22:58:15 +13:00
|
|
|
|
MessageBox.Show(Resources.ScreenRecordForm_StartRecording_FFmpeg_video_and_audio_source_both_can_t_be__None__,
|
|
|
|
|
"ShareX - " + Resources.ScreenRecordForm_StartRecording_FFmpeg_error, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
2014-05-10 20:04:18 +12:00
|
|
|
|
return;
|
|
|
|
|
}
|
2014-05-10 12:23:47 +12:00
|
|
|
|
}
|
|
|
|
|
|
2014-09-13 19:10:46 +12:00
|
|
|
|
Rectangle captureRectangle;
|
2014-11-21 22:29:24 +13:00
|
|
|
|
TaskHelpers.SelectRegion(out captureRectangle, taskSettings);
|
2014-08-09 04:13:00 +12:00
|
|
|
|
captureRectangle = CaptureHelpers.EvenRectangleSize(captureRectangle);
|
|
|
|
|
|
|
|
|
|
if (IsRecording || !captureRectangle.IsValid() || screenRecorder != null)
|
2013-11-03 23:53:49 +13:00
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IsRecording = true;
|
2014-07-17 18:58:17 +12:00
|
|
|
|
Screenshot.CaptureCursor = taskSettings.CaptureSettings.ShowCursor;
|
2013-11-03 23:53:49 +13:00
|
|
|
|
|
2014-10-17 22:58:15 +13:00
|
|
|
|
TrayIcon.Text = "ShareX - " + Resources.ScreenRecordForm_StartRecording_Waiting___;
|
2013-11-03 23:53:49 +13:00
|
|
|
|
TrayIcon.Icon = Resources.control_record_yellow.ToIcon();
|
|
|
|
|
TrayIcon.Visible = true;
|
|
|
|
|
|
|
|
|
|
string path = "";
|
|
|
|
|
|
2014-07-17 18:58:17 +12:00
|
|
|
|
float duration = taskSettings.CaptureSettings.ScreenRecordFixedDuration ? taskSettings.CaptureSettings.ScreenRecordDuration : 0;
|
2014-10-31 15:44:54 +13:00
|
|
|
|
|
2014-06-23 13:44:36 +12:00
|
|
|
|
regionForm = ScreenRegionForm.Show(captureRectangle, StopRecording, duration);
|
2014-10-31 15:44:54 +13:00
|
|
|
|
regionForm.RecordResetEvent = new ManualResetEvent(false);
|
2014-05-22 13:22:32 +12:00
|
|
|
|
|
2014-05-24 03:39:14 +12:00
|
|
|
|
TaskEx.Run(() =>
|
2013-11-03 23:53:49 +13:00
|
|
|
|
{
|
2014-05-22 16:19:32 +12:00
|
|
|
|
try
|
2013-11-03 23:53:49 +13:00
|
|
|
|
{
|
2014-07-17 18:58:17 +12:00
|
|
|
|
if (taskSettings.CaptureSettings.ScreenRecordAutoDisableAero)
|
2014-07-05 07:04:32 +12:00
|
|
|
|
{
|
|
|
|
|
dwmManager = new DWMManager();
|
|
|
|
|
dwmManager.AutoDisable();
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-17 18:58:17 +12:00
|
|
|
|
if (taskSettings.CaptureSettings.ScreenRecordOutput == ScreenRecordOutput.AVI)
|
2014-05-22 16:19:32 +12:00
|
|
|
|
{
|
2014-07-17 18:58:17 +12:00
|
|
|
|
path = Path.Combine(taskSettings.CaptureFolder, TaskHelpers.GetFilename(taskSettings, "avi"));
|
2014-05-22 16:19:32 +12:00
|
|
|
|
}
|
2014-07-17 18:58:17 +12:00
|
|
|
|
else if (taskSettings.CaptureSettings.ScreenRecordOutput == ScreenRecordOutput.FFmpeg)
|
2014-05-22 16:19:32 +12:00
|
|
|
|
{
|
2014-07-17 18:58:17 +12:00
|
|
|
|
path = Path.Combine(taskSettings.CaptureFolder, TaskHelpers.GetFilename(taskSettings, taskSettings.CaptureSettings.FFmpegOptions.Extension));
|
2014-05-22 16:19:32 +12:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
path = Program.ScreenRecorderCacheFilePath;
|
|
|
|
|
}
|
2014-05-09 01:28:46 +12:00
|
|
|
|
|
2014-05-22 16:19:32 +12:00
|
|
|
|
ScreencastOptions options = new ScreencastOptions()
|
|
|
|
|
{
|
2014-07-17 18:58:17 +12:00
|
|
|
|
FFmpeg = taskSettings.CaptureSettings.FFmpegOptions,
|
|
|
|
|
AVI = taskSettings.CaptureSettings.AVIOptions,
|
|
|
|
|
ScreenRecordFPS = taskSettings.CaptureSettings.ScreenRecordFPS,
|
|
|
|
|
GIFFPS = taskSettings.CaptureSettings.GIFFPS,
|
2014-06-23 13:44:36 +12:00
|
|
|
|
Duration = duration,
|
2014-06-08 07:29:26 +12:00
|
|
|
|
OutputPath = path,
|
|
|
|
|
CaptureArea = captureRectangle,
|
2014-07-17 18:58:17 +12:00
|
|
|
|
DrawCursor = taskSettings.CaptureSettings.ShowCursor
|
2014-05-22 16:19:32 +12:00
|
|
|
|
};
|
2013-11-03 23:53:49 +13:00
|
|
|
|
|
2014-07-17 18:58:17 +12:00
|
|
|
|
screenRecorder = new ScreenRecorder(options, captureRectangle, taskSettings.CaptureSettings.ScreenRecordOutput);
|
2013-11-03 23:53:49 +13:00
|
|
|
|
|
2014-10-31 15:44:54 +13:00
|
|
|
|
if (regionForm != null && regionForm.RecordResetEvent != null)
|
2014-05-22 16:19:32 +12:00
|
|
|
|
{
|
2014-11-14 08:59:34 +13:00
|
|
|
|
TrayIcon.Text = "ShareX - " + Resources.ScreenRecordForm_StartRecording_Click_tray_icon_to_start_recording_;
|
|
|
|
|
|
|
|
|
|
if (taskSettings.CaptureSettings.ScreenRecordAutoStart)
|
2014-10-31 15:44:54 +13:00
|
|
|
|
{
|
|
|
|
|
int delay = (int)(taskSettings.CaptureSettings.ScreenRecordStartDelay * 1000);
|
|
|
|
|
|
|
|
|
|
if (delay > 0)
|
|
|
|
|
{
|
|
|
|
|
regionForm.RecordResetEvent.WaitOne(delay);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
regionForm.RecordResetEvent.WaitOne();
|
|
|
|
|
}
|
2013-11-03 23:53:49 +13:00
|
|
|
|
|
2014-11-11 13:32:24 +13:00
|
|
|
|
if (regionForm.AbortRequested)
|
|
|
|
|
{
|
|
|
|
|
abortRequested = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-06-23 13:44:36 +12:00
|
|
|
|
|
2014-11-11 13:32:24 +13:00
|
|
|
|
if (!abortRequested)
|
2014-05-22 16:19:32 +12:00
|
|
|
|
{
|
2014-11-11 13:32:24 +13:00
|
|
|
|
TrayIcon.Text = "ShareX - " + Resources.ScreenRecordForm_StartRecording_Click_tray_icon_to_stop_recording_;
|
|
|
|
|
TrayIcon.Icon = Resources.control_record.ToIcon();
|
2013-11-03 23:53:49 +13:00
|
|
|
|
|
2014-11-11 13:32:24 +13:00
|
|
|
|
if (regionForm != null)
|
|
|
|
|
{
|
|
|
|
|
this.InvokeSafe(() => regionForm.StartTimer());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
screenRecorder.StartRecording();
|
|
|
|
|
|
|
|
|
|
if (regionForm != null && regionForm.AbortRequested)
|
|
|
|
|
{
|
|
|
|
|
abortRequested = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-05-22 16:19:32 +12:00
|
|
|
|
}
|
|
|
|
|
finally
|
2014-05-22 13:22:32 +12:00
|
|
|
|
{
|
2014-07-05 07:04:32 +12:00
|
|
|
|
if (dwmManager != null)
|
|
|
|
|
{
|
|
|
|
|
dwmManager.Dispose();
|
|
|
|
|
dwmManager = null;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-22 14:01:27 +12:00
|
|
|
|
if (regionForm != null)
|
2014-05-22 16:19:32 +12:00
|
|
|
|
{
|
2014-10-31 15:44:54 +13:00
|
|
|
|
if (regionForm.RecordResetEvent != null)
|
|
|
|
|
{
|
|
|
|
|
regionForm.RecordResetEvent.Dispose();
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-22 14:01:27 +12:00
|
|
|
|
this.InvokeSafe(() => regionForm.Close());
|
2014-11-14 08:59:34 +13:00
|
|
|
|
regionForm = null;
|
2014-05-22 16:19:32 +12:00
|
|
|
|
}
|
2013-11-03 23:53:49 +13:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-22 16:19:32 +12:00
|
|
|
|
try
|
2013-11-03 23:53:49 +13:00
|
|
|
|
{
|
2014-11-11 13:32:24 +13:00
|
|
|
|
if (!abortRequested && screenRecorder != null)
|
2014-05-22 16:19:32 +12:00
|
|
|
|
{
|
2014-10-17 22:58:15 +13:00
|
|
|
|
TrayIcon.Text = "ShareX - " + Resources.ScreenRecordForm_StartRecording_Encoding___;
|
2014-08-04 11:28:07 +12:00
|
|
|
|
TrayIcon.Icon = Resources.camcorder_pencil.ToIcon();
|
2013-11-03 23:53:49 +13:00
|
|
|
|
|
2014-05-22 16:19:32 +12:00
|
|
|
|
string sourceFilePath = path;
|
2014-05-07 12:16:11 +12:00
|
|
|
|
|
2014-07-17 18:58:17 +12:00
|
|
|
|
if (taskSettings.CaptureSettings.ScreenRecordOutput == ScreenRecordOutput.GIF)
|
2014-05-06 23:23:12 +12:00
|
|
|
|
{
|
2014-07-17 18:58:17 +12:00
|
|
|
|
if (taskSettings.CaptureSettings.RunScreencastCLI)
|
2014-05-22 16:19:32 +12:00
|
|
|
|
{
|
|
|
|
|
sourceFilePath = Path.ChangeExtension(Program.ScreenRecorderCacheFilePath, "gif");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-07-17 18:58:17 +12:00
|
|
|
|
sourceFilePath = path = Path.Combine(taskSettings.CaptureFolder, TaskHelpers.GetFilename(taskSettings, "gif"));
|
2014-05-22 16:19:32 +12:00
|
|
|
|
}
|
|
|
|
|
|
2014-07-17 18:58:17 +12:00
|
|
|
|
screenRecorder.SaveAsGIF(sourceFilePath, taskSettings.ImageSettings.ImageGIFQuality);
|
2014-05-06 23:23:12 +12:00
|
|
|
|
}
|
2014-05-22 16:19:32 +12:00
|
|
|
|
|
2014-07-17 18:58:17 +12:00
|
|
|
|
if (taskSettings.CaptureSettings.RunScreencastCLI)
|
2013-11-03 23:53:49 +13:00
|
|
|
|
{
|
2014-07-17 18:58:17 +12:00
|
|
|
|
VideoEncoder encoder = Program.Settings.VideoEncoders[taskSettings.CaptureSettings.VideoEncoderSelected];
|
|
|
|
|
path = Path.Combine(taskSettings.CaptureFolder, TaskHelpers.GetFilename(taskSettings, encoder.OutputExtension));
|
2014-05-22 16:19:32 +12:00
|
|
|
|
screenRecorder.EncodeUsingCommandLine(encoder, sourceFilePath, path);
|
2013-11-03 23:53:49 +13:00
|
|
|
|
}
|
2014-05-22 13:22:32 +12:00
|
|
|
|
}
|
2014-05-22 16:19:32 +12:00
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
|
if (screenRecorder != null)
|
2014-05-22 13:22:32 +12:00
|
|
|
|
{
|
2014-07-17 18:58:17 +12:00
|
|
|
|
if (taskSettings.CaptureSettings.RunScreencastCLI && !string.IsNullOrEmpty(screenRecorder.CachePath) && File.Exists(screenRecorder.CachePath))
|
2014-05-22 16:19:32 +12:00
|
|
|
|
{
|
|
|
|
|
File.Delete(screenRecorder.CachePath);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
screenRecorder.Dispose();
|
|
|
|
|
screenRecorder = null;
|
2014-11-11 13:32:24 +13:00
|
|
|
|
|
|
|
|
|
if (abortRequested && !string.IsNullOrEmpty(path) && File.Exists(path))
|
|
|
|
|
{
|
|
|
|
|
File.Delete(path);
|
|
|
|
|
}
|
2014-05-22 13:22:32 +12:00
|
|
|
|
}
|
2013-11-03 23:53:49 +13:00
|
|
|
|
}
|
2014-05-22 13:22:32 +12:00
|
|
|
|
},
|
|
|
|
|
() =>
|
2013-11-03 23:53:49 +13:00
|
|
|
|
{
|
|
|
|
|
if (TrayIcon.Visible)
|
|
|
|
|
{
|
|
|
|
|
TrayIcon.Visible = false;
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-11 13:32:24 +13:00
|
|
|
|
if (!abortRequested && !string.IsNullOrEmpty(path) && File.Exists(path) && TaskHelpers.ShowAfterCaptureForm(taskSettings))
|
2013-11-03 23:53:49 +13:00
|
|
|
|
{
|
2014-07-17 18:58:17 +12:00
|
|
|
|
UploadTask task = UploadTask.CreateFileJobTask(path, taskSettings);
|
2014-06-05 03:20:13 +12:00
|
|
|
|
TaskManager.Start(task);
|
2013-11-03 23:53:49 +13:00
|
|
|
|
}
|
2014-11-11 13:32:24 +13:00
|
|
|
|
|
|
|
|
|
abortRequested = false;
|
|
|
|
|
IsRecording = false;
|
2014-05-22 13:22:32 +12:00
|
|
|
|
});
|
2013-11-03 23:53:49 +13:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-12 10:58:10 +12:00
|
|
|
|
private void DownloaderForm_InstallRequested(string filePath)
|
|
|
|
|
{
|
|
|
|
|
string extractPath = Path.Combine(Program.ToolsFolder, "ffmpeg.exe");
|
2014-12-09 05:15:18 +13:00
|
|
|
|
bool result = FFmpegDownloader.ExtractFFmpeg(filePath, extractPath);
|
2014-05-12 10:58:10 +12:00
|
|
|
|
|
|
|
|
|
if (result)
|
|
|
|
|
{
|
2014-10-18 01:19:28 +13:00
|
|
|
|
MessageBox.Show(Resources.ScreenRecordForm_DownloaderForm_InstallRequested_FFmpeg_successfully_downloaded_, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
2014-05-12 10:58:10 +12:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-10-18 01:19:28 +13:00
|
|
|
|
MessageBox.Show(Resources.ScreenRecordForm_DownloaderForm_InstallRequested_Download_of_FFmpeg_failed_, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
2014-05-12 10:58:10 +12:00
|
|
|
|
}
|
|
|
|
|
}
|
2013-11-03 23:53:49 +13:00
|
|
|
|
}
|
|
|
|
|
}
|