mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 14:32:35 +01:00
Undocked video windows: Better title text + updates title when changing video file + uses SE main icon + works better with VLC
git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@436 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
parent
a813ad2b93
commit
63bb06beff
2
src/Forms/Main.Designer.cs
generated
2
src/Forms/Main.Designer.cs
generated
@ -1575,7 +1575,7 @@
|
||||
this.fixCommonErrorsInSelectedLinesToolStripMenuItem,
|
||||
this.changeCasingForSelectedLinesToolStripMenuItem});
|
||||
this.contextMenuStripListview.Name = "contextMenuStripListview";
|
||||
this.contextMenuStripListview.Size = new System.Drawing.Size(285, 628);
|
||||
this.contextMenuStripListview.Size = new System.Drawing.Size(285, 606);
|
||||
this.contextMenuStripListview.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuStripListviewOpening);
|
||||
//
|
||||
// toolStripMenuItemDelete
|
||||
|
@ -1378,14 +1378,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
_change = false;
|
||||
_converted = false;
|
||||
|
||||
if (_videoControlsUnDocked != null && !_videoControlsUnDocked.IsDisposed)
|
||||
_videoControlsUnDocked.Text = fileName;
|
||||
|
||||
if (_videoPlayerUnDocked != null && !_videoPlayerUnDocked.IsDisposed)
|
||||
_videoPlayerUnDocked.Text = fileName;
|
||||
|
||||
if (_waveFormUnDocked != null && !_waveFormUnDocked.IsDisposed)
|
||||
_waveFormUnDocked.Text = fileName;
|
||||
SetUndockedWindowsTitle();
|
||||
|
||||
if (justConverted)
|
||||
{
|
||||
@ -1449,6 +1442,28 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
private void SetUndockedWindowsTitle()
|
||||
{
|
||||
string title = Configuration.Settings.Language.General.NoVideoLoaded;
|
||||
if (!string.IsNullOrEmpty(_videoFileName))
|
||||
title = Path.GetFileNameWithoutExtension(_videoFileName);
|
||||
|
||||
try //TODO: Remove in 3.2 final
|
||||
{
|
||||
if (_videoControlsUnDocked != null && !_videoControlsUnDocked.IsDisposed)
|
||||
_videoControlsUnDocked.Text = string.Format(Configuration.Settings.Language.General.ControlsWindowTitle, title);
|
||||
|
||||
if (_videoPlayerUnDocked != null && !_videoPlayerUnDocked.IsDisposed)
|
||||
_videoPlayerUnDocked.Text = string.Format(Configuration.Settings.Language.General.VideoWindowTitle, title);
|
||||
|
||||
if (_waveFormUnDocked != null && !_waveFormUnDocked.IsDisposed)
|
||||
_waveFormUnDocked.Text = string.Format(Configuration.Settings.Language.General.AudioWindowTitle, title);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void ImportAndOcrBdnXml(string fileName, BdnXml bdnXml, List<string> list)
|
||||
{
|
||||
Subtitle bdnSubtitle = new Subtitle();
|
||||
@ -1841,15 +1856,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
_change = false;
|
||||
_converted = false;
|
||||
|
||||
|
||||
if (_videoControlsUnDocked != null && !_videoControlsUnDocked.IsDisposed)
|
||||
_videoControlsUnDocked.Text = string.Empty;
|
||||
|
||||
if (_videoPlayerUnDocked != null && !_videoPlayerUnDocked.IsDisposed)
|
||||
_videoPlayerUnDocked.Text = string.Empty;
|
||||
|
||||
if (_waveFormUnDocked != null && !_waveFormUnDocked.IsDisposed)
|
||||
_waveFormUnDocked.Text = string.Empty;
|
||||
SetUndockedWindowsTitle();
|
||||
}
|
||||
|
||||
private void FileNew()
|
||||
@ -6955,6 +6962,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
timerWaveForm.Start();
|
||||
}
|
||||
Cursor = Cursors.Default;
|
||||
|
||||
SetUndockedWindowsTitle();
|
||||
}
|
||||
}
|
||||
|
||||
@ -9314,7 +9323,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private void UnDockVideoPlayer()
|
||||
{
|
||||
_videoPlayerUnDocked = new VideoPlayerUnDocked(this, labelVideoInfo.Text, _formPositionsAndSizes, mediaPlayer);
|
||||
_videoPlayerUnDocked = new VideoPlayerUnDocked(this, _formPositionsAndSizes, mediaPlayer);
|
||||
_formPositionsAndSizes.SetPositionAndSize(_videoPlayerUnDocked);
|
||||
|
||||
Control control = null;
|
||||
@ -9345,7 +9354,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private void UnDockWaveForm()
|
||||
{
|
||||
_waveFormUnDocked = new WaveFormUnDocked(this, labelVideoInfo.Text, _formPositionsAndSizes);
|
||||
_waveFormUnDocked = new WaveFormUnDocked(this, _formPositionsAndSizes);
|
||||
_formPositionsAndSizes.SetPositionAndSize(_waveFormUnDocked);
|
||||
|
||||
var control = AudioWaveForm;
|
||||
@ -9385,7 +9394,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private void UnDockVideoButtons()
|
||||
{
|
||||
_videoControlsUnDocked = new VideoControlsUndocked(this, labelVideoInfo.Text, _formPositionsAndSizes);
|
||||
_videoControlsUnDocked = new VideoControlsUndocked(this, _formPositionsAndSizes);
|
||||
_formPositionsAndSizes.SetPositionAndSize(_videoControlsUnDocked);
|
||||
var control = tabControlButtons;
|
||||
groupBoxVideo.Controls.Remove(control);
|
||||
@ -9429,11 +9438,13 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
_videoControlsUnDocked.Show(this);
|
||||
|
||||
_isVideoControlsUnDocked = true;
|
||||
SetUndockedWindowsTitle();
|
||||
|
||||
undockVideoControlsToolStripMenuItem.Visible = false;
|
||||
redockVideoControlsToolStripMenuItem.Visible = true;
|
||||
|
||||
tabControl1_SelectedIndexChanged(null, null);
|
||||
|
||||
}
|
||||
|
||||
private void redockVideoControlsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
|
@ -577,6 +577,9 @@
|
||||
<metadata name="toolStripWaveControls.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>208, 56</value>
|
||||
</metadata>
|
||||
<metadata name="toolStripWaveControls.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>208, 56</value>
|
||||
</metadata>
|
||||
<data name="toolStripButtonWaveFormZoomOut.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
@ -684,7 +687,7 @@
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAD2
|
||||
CAAAAk1TRnQBSQFMAgEBAgEAAZgBBQGYAQUBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
CAAAAk1TRnQBSQFMAgEBAgEAAagBBQGoAQUBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
|
||||
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
|
||||
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
|
||||
|
1
src/Forms/VideoControlsUndocked.Designer.cs
generated
1
src/Forms/VideoControlsUndocked.Designer.cs
generated
@ -46,7 +46,6 @@
|
||||
this.ClientSize = new System.Drawing.Size(458, 311);
|
||||
this.Controls.Add(this.panelContainer);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "VideoControlsUndocked";
|
||||
this.Text = "VideoControlsUndocked";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.VideoControlsUndocked_FormClosing);
|
||||
|
@ -22,12 +22,12 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
public VideoControlsUndocked(Main mainForm, string title, PositionsAndSizes positionsAndSizes)
|
||||
public VideoControlsUndocked(Main mainForm, PositionsAndSizes positionsAndSizes)
|
||||
{
|
||||
InitializeComponent();
|
||||
_mainForm = mainForm;
|
||||
this.Icon = (Icon)mainForm.Icon.Clone();
|
||||
_positionsAndSizes = positionsAndSizes;
|
||||
Text = title;
|
||||
}
|
||||
|
||||
public VideoControlsUndocked()
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
@ -17,13 +18,13 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
public VideoPlayerUnDocked(Main main, string title, PositionsAndSizes positionsAndSizes, Controls.VideoPlayerContainer videoPlayerContainer)
|
||||
public VideoPlayerUnDocked(Main main, PositionsAndSizes positionsAndSizes, Controls.VideoPlayerContainer videoPlayerContainer)
|
||||
{
|
||||
InitializeComponent();
|
||||
_mainForm = main;
|
||||
this.Icon = (Icon)_mainForm.Icon.Clone();
|
||||
_positionsAndSizes = positionsAndSizes;
|
||||
_videoPlayerContainer = videoPlayerContainer;
|
||||
Text = title;
|
||||
}
|
||||
|
||||
public VideoPlayerUnDocked()
|
||||
|
@ -22,12 +22,12 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
public WaveFormUnDocked(Main mainForm, string title, PositionsAndSizes positionsAndSizes)
|
||||
public WaveFormUnDocked(Main mainForm, PositionsAndSizes positionsAndSizes)
|
||||
{
|
||||
InitializeComponent();
|
||||
_mainForm = mainForm;
|
||||
this.Icon = (Icon)mainForm.Icon.Clone();
|
||||
_positionsAndSizes = positionsAndSizes;
|
||||
Text = title;
|
||||
}
|
||||
|
||||
public WaveFormUnDocked()
|
||||
|
@ -127,6 +127,9 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
UserNameAlreadyInUse = "Username already in use",
|
||||
WebServiceUrl = "Webservice url",
|
||||
IP = "IP",
|
||||
VideoWindowTitle = "Video - {0}",
|
||||
AudioWindowTitle = "Audio - {0}",
|
||||
ControlsWindowTitle = "Controls - {0}",
|
||||
};
|
||||
|
||||
About = new LanguageStructure.About
|
||||
|
@ -61,6 +61,9 @@
|
||||
public string UserNameAlreadyInUse { get; set; }
|
||||
public string WebServiceUrl { get; set; }
|
||||
public string IP { get; set; }
|
||||
public string VideoWindowTitle { get; set; }
|
||||
public string AudioWindowTitle { get; set; }
|
||||
public string ControlsWindowTitle { get; set; }
|
||||
}
|
||||
|
||||
public class About
|
||||
|
@ -485,9 +485,19 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
_mediaPlayer = _libvlc_media_player_new_from_media(media);
|
||||
_libvlc_media_release(media);
|
||||
|
||||
|
||||
// Linux: libvlc_media_player_set_xdrawable (_mediaPlayer, xdrawable);
|
||||
// Mac: libvlc_media_player_set_nsobject (_mediaPlayer, view);
|
||||
|
||||
_libvlc_media_player_set_hwnd(_mediaPlayer, ownerControl.Handle); // windows
|
||||
|
||||
//hack: sometimes vlc opens in it's own windows - this code seems to prevent this
|
||||
for (int j = 0; j < 50; j++)
|
||||
{
|
||||
System.Threading.Thread.Sleep(10);
|
||||
System.Windows.Forms.Application.DoEvents();
|
||||
}
|
||||
_libvlc_media_player_set_hwnd(_mediaPlayer, ownerControl.Handle); // windows
|
||||
|
||||
if (onVideoEnded != null)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user