Fixed some trouble

This commit is contained in:
var1ap 2016-11-11 18:44:51 +04:00
parent 13d870bdd3
commit 60c0cf5b8b
6 changed files with 45 additions and 37 deletions

View File

@ -668,7 +668,10 @@ namespace Nikse.SubtitleEdit.Core
OpenSubtitleExtraExtensions = "*.mp4;*.m4v;*.mkv;*.ts"; // matroska/mp4/m4v files (can contain subtitles)
ListViewColumnsRememberSize = true;
VlcWaveTranscodeSettings = "acodec=s16l"; // "acodec=s16l,channels=1,ab=64,samplerate=8000";
MpvVideoOutput = "vaapi"; // mpv "vo" option
if(Configuration.IsRunningOnLinux())
MpvVideoOutput = "vaapi"; // mpv "vo" option
else
MpvVideoOutput = "direct3d_shaders";
UseTimeFormatHHMMSSFF = false;
ClearStatusBarAfterSeconds = 10;
MoveVideo100Or500MsPlaySmallSample = false;

View File

@ -2327,10 +2327,10 @@ namespace Nikse.SubtitleEdit.Forms
private void RefreshMpvSettings()
{
radioButtonVideoPlayerMPV.Enabled = LibMpvDynamic.IsInstalled;
if (!Configuration.IsRunningOnLinux())
labelMpvSettings.Text = "--vo=" + Configuration.Settings.General.MpvVideoOutput;
else
if (Configuration.IsRunningOnLinux() && (Configuration.Settings.General.MpvVideoOutput == "direct3d_shaders"))
labelMpvSettings.Text = "--vo=vaapi";
else
labelMpvSettings.Text = "--vo=" + Configuration.Settings.General.MpvVideoOutput;
}
private void linkLabelBingSubscribe_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)

View File

@ -40,36 +40,26 @@
//
// buttonDownload
//
if (!Configuration.IsRunningOnLinux())
{
this.buttonDownload.Location = new System.Drawing.Point(12, 24);
this.buttonDownload.Name = "buttonDownload";
this.buttonDownload.Size = new System.Drawing.Size(186, 23);
this.buttonDownload.TabIndex = 0;
this.buttonDownload.Text = "Download mpv dll";
this.buttonDownload.UseVisualStyleBackColor = true;
this.buttonDownload.Click += new System.EventHandler(this.buttonDownload_Click_1);
}
this.buttonDownload.Location = new System.Drawing.Point(12, 24);
this.buttonDownload.Name = "buttonDownload";
this.buttonDownload.Size = new System.Drawing.Size(186, 23);
this.buttonDownload.TabIndex = 0;
this.buttonDownload.Text = "Download mpv dll";
this.buttonDownload.UseVisualStyleBackColor = true;
this.buttonDownload.Click += new System.EventHandler(this.buttonDownload_Click_1);
//
// comboBoxVideoOutput
//
this.comboBoxVideoOutput.FormattingEnabled = true;
if (Configuration.IsRunningOnLinux())
{
this.comboBoxVideoOutput.Items.AddRange(new object[] {
"sdl",
"vaapi",
"vdpau"});
}
else
{
this.comboBoxVideoOutput.Items.AddRange(new object[] {
"direct3d_shaders",
"direct3d ",
"sdl",
"vaapi",
"vdpau"});
}
this.comboBoxVideoOutput.Items.AddRange(new object[] {
"direct3d_shaders",
"direct3d ",
"sdl",
"vaapi",
"vdpau"});
this.comboBoxVideoOutput.Location = new System.Drawing.Point(12, 109);
this.comboBoxVideoOutput.Name = "comboBoxVideoOutput";

View File

@ -9,19 +9,29 @@ namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class SettingsMpv : Form
{
public SettingsMpv()
{
InitializeComponent();
labelPleaseWait.Text = string.Empty;
if (!Configuration.IsRunningOnLinux())
comboBoxVideoOutput.Text = Configuration.Settings.General.MpvVideoOutput;
else
if (Configuration.IsRunningOnLinux() && (Configuration.Settings.General.MpvVideoOutput == "direct3d_shaders"))
comboBoxVideoOutput.Text = "vaapi";
else
comboBoxVideoOutput.Text = Configuration.Settings.General.MpvVideoOutput;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
buttonOK.Text = Configuration.Settings.Language.General.Ok;
Text = Configuration.Settings.Language.SettingsMpv.Title;
if (!Configuration.IsRunningOnLinux())
buttonDownload.Text = Configuration.Settings.Language.SettingsMpv.DownloadMpv;
if (Configuration.IsRunningOnLinux())
{
comboBoxVideoOutput.Items.Clear();
comboBoxVideoOutput.Items.AddRange(new object[] { "direct3d ", "sdl", "vaapi", "vdpau" });
}
}
private void wc_DownloadDataCompleted(object sender, DownloadDataCompletedEventArgs e)
@ -33,6 +43,8 @@ namespace Nikse.SubtitleEdit.Forms
buttonOK.Enabled = true;
if (!Configuration.IsRunningOnLinux())
buttonDownload.Enabled = true;
else
buttonDownload.Enabled = false;
Cursor = Cursors.Default;
return;
}
@ -60,6 +72,8 @@ namespace Nikse.SubtitleEdit.Forms
buttonOK.Enabled = true;
if (!Configuration.IsRunningOnLinux())
buttonDownload.Enabled = true;
else
buttonDownload.Enabled = false;
MessageBox.Show(Configuration.Settings.Language.SettingsMpv.DownloadMpvOk);
}
@ -69,8 +83,7 @@ namespace Nikse.SubtitleEdit.Forms
{
labelPleaseWait.Text = Configuration.Settings.Language.General.PleaseWait;
buttonOK.Enabled = false;
if (!Configuration.IsRunningOnLinux())
buttonDownload.Enabled = false;
buttonDownload.Enabled = false;
Refresh();
Cursor = Cursors.WaitCursor;
@ -89,6 +102,8 @@ namespace Nikse.SubtitleEdit.Forms
buttonOK.Enabled = true;
if (!Configuration.IsRunningOnLinux())
buttonDownload.Enabled = true;
else
buttonDownload.Enabled = false;
Cursor = Cursors.Default;
MessageBox.Show(exception.Message + Environment.NewLine + Environment.NewLine + exception.StackTrace);
}

View File

@ -174,7 +174,7 @@ namespace Nikse.SubtitleEdit.Logic
GeneralSettings gs = Configuration.Settings.General;
if (Configuration.IsRunningOnLinux())
return new LibMpvMono();
return new LibMpvMono();
// Mono on OS X is 32 bit and thus requires 32 bit VLC. Place VLC in the same
// folder as Subtitle Edit and add this to the app.config inside the

View File

@ -378,7 +378,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
{
_mpvInitialize.Invoke(_mpvHandle);
string videoOutput = "vaapi";
string videoOutput = "direct3d_shaders";
if (!string.IsNullOrWhiteSpace(Configuration.Settings.General.MpvVideoOutput))
videoOutput = Configuration.Settings.General.MpvVideoOutput;
_mpvSetOptionString(_mpvHandle, GetUtf8Bytes("vo"), GetUtf8Bytes(videoOutput)); // "direct3d_shaders" is default, "direct3d" could be used for compabality with old systems