2015-08-04 19:31:43 +12:00
|
|
|
|
#region License Information (GPL v3)
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
ShareX - A program that allows you to take screenshots and share any file type
|
|
|
|
|
Copyright © 2007-2015 ShareX Developers
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
2015-08-04 23:47:34 +12:00
|
|
|
|
using ShareX.HelpersLib;
|
2015-08-04 19:31:43 +12:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2015-08-04 23:47:34 +12:00
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
2015-08-04 19:31:43 +12:00
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
2015-08-04 23:47:34 +12:00
|
|
|
|
using System.Windows.Forms;
|
2015-08-04 19:31:43 +12:00
|
|
|
|
|
|
|
|
|
namespace ShareX.MediaLib
|
|
|
|
|
{
|
2015-08-04 23:47:34 +12:00
|
|
|
|
public partial class VideoThumbnailerForm : Form
|
2015-08-04 19:31:43 +12:00
|
|
|
|
{
|
2015-08-04 23:47:34 +12:00
|
|
|
|
public string FFmpegPath { get; private set; }
|
|
|
|
|
public VideoThumbnailOptions Options { get; set; }
|
2015-08-04 19:31:43 +12:00
|
|
|
|
|
2015-08-04 23:47:34 +12:00
|
|
|
|
public VideoThumbnailerForm(string ffmpegPath, VideoThumbnailOptions options)
|
2015-08-04 19:31:43 +12:00
|
|
|
|
{
|
2015-08-04 23:47:34 +12:00
|
|
|
|
FFmpegPath = ffmpegPath;
|
|
|
|
|
Options = options;
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
Icon = ShareXResources.Icon;
|
|
|
|
|
pgOptions.SelectedObject = Options;
|
2015-08-04 19:31:43 +12:00
|
|
|
|
}
|
|
|
|
|
|
2015-08-04 23:47:34 +12:00
|
|
|
|
private void btnStart_Click(object sender, EventArgs e)
|
2015-08-04 19:31:43 +12:00
|
|
|
|
{
|
2015-08-04 23:47:34 +12:00
|
|
|
|
string mediaPath = txtMediaPath.Text;
|
|
|
|
|
|
|
|
|
|
if (File.Exists(mediaPath))
|
|
|
|
|
{
|
|
|
|
|
VideoThumbnailer thumbnailer = new VideoThumbnailer(mediaPath, FFmpegPath, Options);
|
|
|
|
|
btnStart.Enabled = false;
|
|
|
|
|
BackgroundWorker bw = new BackgroundWorker();
|
|
|
|
|
bw.DoWork += (sender2, e2) => thumbnailer.TakeScreenshots();
|
|
|
|
|
bw.RunWorkerCompleted += (sender3, e3) => btnStart.Enabled = true;
|
|
|
|
|
bw.RunWorkerAsync();
|
|
|
|
|
}
|
2015-08-04 19:31:43 +12:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|