From: Vásáry Dániel Date: Fri, 24 Nov 2017 09:14:03 +0000 (+0000) Subject: git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube... X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=c9a0b05c451a909c236d039853af11fa36124572;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C30765 --- diff --git a/client/DxPlay/DxPlayer.cs b/client/DxPlay/DxPlayer.cs index 1c46e150..4f9b80dd 100644 --- a/client/DxPlay/DxPlayer.cs +++ b/client/DxPlay/DxPlayer.cs @@ -26,6 +26,7 @@ namespace DxPlay { public enum GraphState { Stopped, + Completed, Paused, Playing, Exiting @@ -128,6 +129,7 @@ namespace DxPlay { stateHunStringValues.Add(GraphState.Paused, StringResource.SZUNETELTETETT); stateHunStringValues.Add(GraphState.Playing, StringResource.LEJATSZAS); stateHunStringValues.Add(GraphState.Stopped, StringResource.MEGALLITVA); + stateHunStringValues.Add(GraphState.Completed, StringResource.VEGE); } private void TcWorker_DoWork(object sender, DoWorkEventArgs e) { @@ -141,6 +143,8 @@ namespace DxPlay { // start playing public void Play() { // If we aren't already playing (or shutting down) + //if (State == GraphState.Completed) + // Stop(); if (State == GraphState.Stopped || State == GraphState.Paused) { int hr = m_mediaCtrl.Run(); DsError.ThrowExceptionForHR(hr); @@ -352,9 +356,14 @@ namespace DxPlay { MediaDescription.duration = new Timecode(); MediaDescription.Duration.Set(ReferenceTimeToFrames(duration)); if (MediaDescription.FirstFrame == null) { - MXFFile mxf = new MXFFile(MediaDescription.FileName); - mxf.Inspect(); - MediaDescription.firstFrame = new Timecode(mxf.FirstSystemItem?.UserDateFullFrameNb, MediaDescription.FrameRate); + try { + MXFFile mxf = new MXFFile(MediaDescription.FileName); + mxf.Inspect(); + MediaDescription.firstFrame = new Timecode(mxf.FirstSystemItem?.UserDateFullFrameNb, MediaDescription.FrameRate); + } + catch (Exception ex) { + MediaDescription.firstFrame = new Timecode(); + } } //MediaDescription.firstFrame = new Timecode(); CurrentTC = new Timecode(MediaDescription.FirstFrame); @@ -595,7 +604,7 @@ namespace DxPlay { // If the clip is finished playing if (ec == EventCode.Complete) { - //Stop(); + //State = GraphState.Completed; } // Release any resources the message allocated diff --git a/client/DxPlay/PlayerForm.Designer.cs b/client/DxPlay/PlayerForm.Designer.cs index bba3516c..6ae7c08f 100644 --- a/client/DxPlay/PlayerForm.Designer.cs +++ b/client/DxPlay/PlayerForm.Designer.cs @@ -1,13 +1,14 @@  +using MaestroShared.Controls; using System.Windows.Forms; namespace DxPlay { partial class PlayerForm : Form { private Panel pVideo; - private Button btnPlay; - private Button btnPause; + private NoFocusCueButton btnPlay; + private NoFocusCueButton btnPause; private TextBox textCurrentTC; - private Button btnStop; + private NoFocusCueButton btnStop; private TextBox txtStartTC; private TextBox txtEndTC; private Panel panel3; @@ -51,9 +52,9 @@ namespace DxPlay { this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.panelPlayer = new System.Windows.Forms.Panel(); this.pControls = new System.Windows.Forms.FlowLayoutPanel(); - this.btnPlay = new System.Windows.Forms.Button(); - this.btnStop = new System.Windows.Forms.Button(); - this.btnPause = new System.Windows.Forms.Button(); + this.btnPlay = new NoFocusCueButton(); + this.btnStop = new NoFocusCueButton(); + this.btnPause = new NoFocusCueButton(); this.dgSegments = new System.Windows.Forms.DataGridView(); this.bsSegments = new System.Windows.Forms.BindingSource(this.components); this.menuButtonSegmentActions = new DxPlay.MenuButton(); @@ -259,6 +260,7 @@ namespace DxPlay { this.btnPlay.Name = "btnPlay"; this.btnPlay.Size = new System.Drawing.Size(54, 54); this.btnPlay.TabIndex = 1; + this.btnPlay.TabStop = false; this.btnPlay.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.btnPlay.UseVisualStyleBackColor = false; this.btnPlay.Click += new System.EventHandler(this.btnPlay_Click); @@ -274,6 +276,7 @@ namespace DxPlay { this.btnStop.Name = "btnStop"; this.btnStop.Size = new System.Drawing.Size(54, 54); this.btnStop.TabIndex = 16; + this.btnStop.TabStop = false; this.btnStop.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.btnStop.UseVisualStyleBackColor = false; this.btnStop.Click += new System.EventHandler(this.btnStop_Click); @@ -289,6 +292,7 @@ namespace DxPlay { this.btnPause.Name = "btnPause"; this.btnPause.Size = new System.Drawing.Size(54, 54); this.btnPause.TabIndex = 11; + this.btnPause.TabStop = false; this.btnPause.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.btnPause.UseVisualStyleBackColor = false; this.btnPause.Click += new System.EventHandler(this.btnPause_Click); diff --git a/client/DxPlay/PlayerForm.cs b/client/DxPlay/PlayerForm.cs index ba0ab37d..2e85b957 100644 --- a/client/DxPlay/PlayerForm.cs +++ b/client/DxPlay/PlayerForm.cs @@ -197,7 +197,7 @@ namespace DxPlay { private void PlayerForm_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if (e.KeyCode == Keys.Left || e.KeyCode == Keys.Right || e.KeyCode == Keys.Space || e.KeyCode == Keys.Escape) { - e.IsInputKey = true; + e.IsInputKey = false; } } @@ -212,7 +212,8 @@ namespace DxPlay { } private void PlayerForm_Load(object sender, EventArgs e) { - DisableHotKeysDefaults(this.Controls); + //DisableHotKeysDefaults(this.Controls); + InterceptKeys.Start(); InterceptKeys.GlobalKeyEvent += HandleHotKey; @@ -229,8 +230,12 @@ namespace DxPlay { } private void PlayerForm_KeyDown(object sender, KeyEventArgs e) { - e.Handled = true; - e.SuppressKeyPress = true; + if (dgSegments.IsCurrentCellInEditMode) + return; + if (e.KeyCode == Keys.Left || e.KeyCode == Keys.Right || e.KeyCode == Keys.Space || e.KeyCode == Keys.Escape) { + e.Handled = true; + e.SuppressKeyPress = true; + } } private bool HandleHotKey(Keys keyCode) { @@ -418,17 +423,22 @@ namespace DxPlay { private void dgSegments_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { - //MovieSegment actualSegment = bsSegments.Current as MovieSegment; - //if (actualSegment == null) - // return; - //if (e.ColumnIndex == 0) { - // m_play.Pause(); - // m_play.Seek(actualSegment.TCIn.ZeroBasedFrames); - //} - //if (e.ColumnIndex == 1) { - // m_play.Pause(); - // m_play.Seek(actualSegment.TCOut.ZeroBasedFrames); - //} + MovieSegment actualSegment = bsSegments.Current as MovieSegment; + if (actualSegment == null) + return; + if (e.ColumnIndex == 0) { + m_play.Pause(); + m_play.Seek(actualSegment.TCIn.Frames - m_play.MediaDescription.FirstFrame.Frames); + } + if (e.ColumnIndex == 1) { + m_play.Pause(); + int pos = actualSegment.TCOut.Frames - m_play.MediaDescription.FirstFrame.Frames; + //Az utolsó kocka nem jelenik meg egyébként + if (pos == m_play.MediaDescription.Duration.Frames) + pos--; + m_play.Seek(pos); + m_play.Play(); + } } } diff --git a/client/DxPlay/StringResource.Designer.cs b/client/DxPlay/StringResource.Designer.cs index 8b057bc4..34b4f6b7 100644 --- a/client/DxPlay/StringResource.Designer.cs +++ b/client/DxPlay/StringResource.Designer.cs @@ -239,5 +239,14 @@ namespace DxPlay { return ResourceManager.GetString("SZUNETELTETETT", resourceCulture); } } + + /// + /// Looks up a localized string similar to Vége. + /// + internal static string VEGE { + get { + return ResourceManager.GetString("VEGE", resourceCulture); + } + } } } diff --git a/client/DxPlay/StringResource.resx b/client/DxPlay/StringResource.resx index f1442fd4..efd48cd3 100644 --- a/client/DxPlay/StringResource.resx +++ b/client/DxPlay/StringResource.resx @@ -177,4 +177,7 @@ Szüneteltetett + + Vége + \ No newline at end of file diff --git a/client/Maestro/Configuration/global.json b/client/Maestro/Configuration/global.json index c2fc6118..52f76c00 100644 --- a/client/Maestro/Configuration/global.json +++ b/client/Maestro/Configuration/global.json @@ -1,7 +1,7 @@ { "minimizeToTray": true, "userDomain": { - "address": "intra.echotv.hu", + "address": "10.10.254.11", "userName": "echotest", "password": "F3QcfkSEW7hq+FcEraq9xv4UdHHeVoOh7jBH1G1k9SzEayTXyiT4WQ7XKtBO/ygnCpRU97AXoKXKoqXIGP8QlVkFurRqwzo8mywEb1q2VW7dUjkJcLFtLDkqQjM39+N9" } diff --git a/client/MaestroShared/Controls/NoFocusCueButton.cs b/client/MaestroShared/Controls/NoFocusCueButton.cs new file mode 100644 index 00000000..0b8938fb --- /dev/null +++ b/client/MaestroShared/Controls/NoFocusCueButton.cs @@ -0,0 +1,11 @@ +using System.Windows.Forms; + +namespace MaestroShared.Controls { + public class NoFocusCueButton : Button { + protected override bool ShowFocusCues { + get { + return false; + } + } + } +} diff --git a/client/MaestroShared/MaestroShared.csproj b/client/MaestroShared/MaestroShared.csproj index 3c08b76a..310b065a 100644 --- a/client/MaestroShared/MaestroShared.csproj +++ b/client/MaestroShared/MaestroShared.csproj @@ -88,6 +88,9 @@ + + Component +