From: Vásáry Dániel Date: Tue, 2 Oct 2018 14:37:09 +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=963cae596689662e5ee114cb5839424e6610a527;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C31307 --- diff --git a/client/AudioRecorder/AudioRecorderSettings.cs b/client/AudioRecorder/AudioRecorderSettings.cs index 21ff49a3..344638c0 100644 --- a/client/AudioRecorder/AudioRecorderSettings.cs +++ b/client/AudioRecorder/AudioRecorderSettings.cs @@ -11,5 +11,6 @@ namespace AudioRecorder { public MetadataProvider[] Metadatas { get; set; } public Target OctopusTarget { get; set; } public Target TrafficTarget { get; set; } + public Target FreeTarget { get; set; } } } diff --git a/client/AudioRecorder/Configuration/audiorecorder.en b/client/AudioRecorder/Configuration/audiorecorder.en index 69185a79..61ede426 100644 --- a/client/AudioRecorder/Configuration/audiorecorder.en +++ b/client/AudioRecorder/Configuration/audiorecorder.en @@ -10,5 +10,8 @@ "PAUSE": "Pause", "PLAY": "Play", "RECORD": "Record", - "STOP": "Stop" + "STOP": "Stop", + "SUCCESSMESSAGE": "Successfull transfer to path: '{0}', file name: '{1}'", + "ERRORCONFIGURATION": "Found incomplete 'audiorecorder.json' configuration file, 'target' section is missing.", + "ERROREMPTYID": "Selected ID cna not be empty." } diff --git a/client/AudioRecorder/Configuration/audiorecorder.json b/client/AudioRecorder/Configuration/audiorecorder.json index f44fe685..4e1f4341 100644 --- a/client/AudioRecorder/Configuration/audiorecorder.json +++ b/client/AudioRecorder/Configuration/audiorecorder.json @@ -4,17 +4,17 @@ "workingDirectory": "file://C:\\temp", "peekMeterStep": 200, "octopusTarget": { - "label": "Octopus mappába küldés", - "processor": "FTPTargetProcessor", - "tag": "Betöltés", + "processor": "UNCTargetProcessor", "outputFormat": "%ID%", - "subFolderFormat": "%IDROOT%-%TEXT%", - "killDateDays": 7, "remote": { - "address": "ftp://localhost", - "userName": "dani", - "password": "pSCkmnEXm7xhrWh/AzxrnklEcGeJU4SVFkuag3B5H+rTcNVEELDgsF6uTiDISSdnnJyDn/kKwoxg521neTJXV6FIs/p2QmpHKaexiCmm47R1tsZeCFmmpTv4MHuiGjwL", - "timeout": 1000 + "address": "file://C:\\temp" + } + }, + "freeTarget": { + "processor": "UNCTargetProcessor", + "outputFormat": "%ID%", + "remote": { + "address": "file://C:\\temp1" } }, "metadatas": [ @@ -27,6 +27,11 @@ "timeout": 3000 }, "uiFileName": "audiorecorder.en" + }, + { + "$type": "FreeMetadata", + "useAlternateTarget": true, + "uiFileName": "audiorecorder.en" } ] } \ No newline at end of file diff --git a/client/AudioRecorder/MainForm.Designer.cs b/client/AudioRecorder/MainForm.Designer.cs index af36a0b7..187001a9 100644 --- a/client/AudioRecorder/MainForm.Designer.cs +++ b/client/AudioRecorder/MainForm.Designer.cs @@ -38,6 +38,7 @@ namespace AudioRecorder { this.groupBox3 = new System.Windows.Forms.GroupBox(); this.txtRecordFilePath = new System.Windows.Forms.TextBox(); this.panel1 = new System.Windows.Forms.Panel(); + this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); this.pmVolume = new Ernzo.WinForms.Controls.PeakMeterCtrl(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -199,6 +200,12 @@ namespace AudioRecorder { this.panel1.Size = new System.Drawing.Size(399, 55); this.panel1.TabIndex = 11; // + // saveFileDialog + // + this.saveFileDialog.DefaultExt = "wav"; + this.saveFileDialog.Filter = "WAV files (*.wav)|*.wav"; + this.saveFileDialog.RestoreDirectory = true; + // // pmVolume // this.pmVolume.BandsCount = 1; @@ -261,6 +268,7 @@ namespace AudioRecorder { private System.Windows.Forms.TrackBar tbVolume; private System.Windows.Forms.TextBox txtRecordFilePath; private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.SaveFileDialog saveFileDialog; } } diff --git a/client/AudioRecorder/MainForm.cs b/client/AudioRecorder/MainForm.cs index 4b397266..1c9190eb 100644 --- a/client/AudioRecorder/MainForm.cs +++ b/client/AudioRecorder/MainForm.cs @@ -14,6 +14,7 @@ using MaestroShared.Targets; using static AudioRecorder.MetadataSelectorForm; using MaestroShared.Metadata; using AudioRecorder.Properties; +using System.Threading; namespace AudioRecorder { public delegate void RefreshPanelDelegate(); @@ -29,7 +30,7 @@ namespace AudioRecorder { private AudioRecorderSettings parameters; private ITimeCodeWorker timeCodeWorker; private bool recording; - private Timer countDownTimer; + private System.Windows.Forms.Timer countDownTimer; private int countDown = 3; private MMDevice currentDevice; private bool pausing; @@ -76,13 +77,13 @@ namespace AudioRecorder { private void OnMainShown(object sender, EventArgs e) { try { - Type[] knownTypes = { typeof(OctopusMetadata), typeof(NativeOctopusMetadata), typeof(TrafficMetadata), typeof(MediaCubeMetadata) }; + Type[] knownTypes = { typeof(FreeMetadata), typeof(OctopusMetadata), typeof(NativeOctopusMetadata), typeof(TrafficMetadata), typeof(MediaCubeMetadata) }; parameters = ConfigurationSerializer.Load(CONFIG_FILE, knownTypes); InitializeControlTexts(); UpdateGUI(); timeCodeWorker = new TimeCodeWorker(timecodeLabel); - countDownTimer = new Timer(); + countDownTimer = new System.Windows.Forms.Timer(); countDownTimer.Interval = 1000; countDownTimer.Tick += new EventHandler(OnCountDownTick); devicesDetector = new AudioDevicesDetector(); @@ -204,12 +205,63 @@ namespace AudioRecorder { } } + + public DialogResult ShowMTAFileSaveDialog(SaveFileDialog sd) { + DialogResult dlgRes = DialogResult.Cancel; + Thread theThread = new Thread((ThreadStart)delegate + { + //Create a layout dialog instance on the current thread to align the file dialog Form + Form frmLayout = new Form(); + frmLayout.StartPosition = FormStartPosition.Manual; + frmLayout.Location = this.Location; + frmLayout.DesktopLocation = this.DesktopLocation; + + //the layout form is not visible + frmLayout.Width = 0; + frmLayout.Height = 0; + dlgRes = sd.ShowDialog(frmLayout); + }); + + try { + //set STA as the Open file dialog needs it to work + theThread.TrySetApartmentState(ApartmentState.STA); + + //start the thread + theThread.Start(); + + // Wait for thread to get started + while (!theThread.IsAlive) { Thread.Sleep(1); } + + // Wait a tick more (@see: http://scn.sap.com/thread/45710) + Thread.Sleep(1); + + //wait for the dialog thread to finish + theThread.Join(); + + } catch (Exception e) { + MsgBox.Error(e.Message); + } + + return (dlgRes); + } + private void OnRecordClick(object sender, EventArgs e) { - MetadataSelectorForm idSelectorForm = new MetadataSelectorForm(parameters); - if (idSelectorForm.ShowDialog() == DialogResult.Cancel) - return; - currentMetadata = idSelectorForm.SelectedMetadata; - currentRecordingPath = CreateCurrenRecordingPath(parameters.WorkingDirectory.LocalPath, currentMetadata.ID); + if (parameters.Metadatas == null || parameters.Metadatas.Length == 0) { + saveFileDialog.InitialDirectory = parameters.WorkingDirectory.LocalPath; + saveFileDialog.RestoreDirectory = true; + if (ShowMTAFileSaveDialog(saveFileDialog) == DialogResult.Cancel) + return; + FileInfo fi = new FileInfo(saveFileDialog.FileName); + currentMetadata = new Metadata() { ID = Path.GetFileNameWithoutExtension(fi.Name) }; + currentRecordingPath = saveFileDialog.FileName; + } else { + MetadataSelectorForm idSelectorForm = new MetadataSelectorForm(parameters); + if (idSelectorForm.ShowDialog() == DialogResult.Cancel) + return; + currentMetadata = idSelectorForm.SelectedMetadata; + currentRecordingPath = CreateCurrenRecordingPath(parameters.WorkingDirectory.LocalPath, currentMetadata.ID); + } + txtRecordFilePath.Text = currentRecordingPath; if (String.IsNullOrEmpty(currentRecordingPath)) return; @@ -233,9 +285,10 @@ namespace AudioRecorder { private void OnPlayClick(object sender, EventArgs e) { if (String.IsNullOrEmpty(currentRecordingPath) || !File.Exists(currentRecordingPath)) return; - Process process = new Process(); - process.StartInfo = new ProcessStartInfo() { - FileName = currentRecordingPath + Process process = new Process { + StartInfo = new ProcessStartInfo() { + FileName = currentRecordingPath + } }; process.Start(); } @@ -280,23 +333,30 @@ namespace AudioRecorder { private void Export() { if (String.IsNullOrEmpty(currentMetadata.ID)) { - MsgBox.Error("A kiválasztott metaadat azonosító nem lehet üres."); + MsgBox.Error(parameters.Resource("ERROREMPTYID", Resources.ERROREMPTYID)); return; } MetadataType metadataType = MetadataTypeUtil.Guess(currentMetadata.ID); - Target target = parameters.OctopusTarget; + Target target = null; - switch (metadataType) { - case MetadataType.TrafficAD: - case MetadataType.TrafficPromo: - case MetadataType.TrafficMaterial: + switch (currentMetadata.TargetType) { + + case TargetType.Octopus: + target = parameters.OctopusTarget; + break; + case TargetType.TrafficAD: + case TargetType.TrafficPromo: + case TargetType.TrafficMaterial: target = parameters.TrafficTarget; break; + case TargetType.Free: + target = parameters.FreeTarget; + break; } if (target == null) { - MsgBox.Error("Hiányos az 'audiorecorder.json' konfigurációs állomány, nem található 'target' beállítás."); + MsgBox.Error(parameters.Resource("ERRORCONFIGURATION", Resources.ERRORCONFIGURATION)); return; } @@ -320,7 +380,7 @@ namespace AudioRecorder { if (TargetProcessor.READY.Equals(processor.Status)) { string path = Path.GetDirectoryName(processor.Output); string name = Path.GetFileName(processor.Output); - MsgBox.Info(String.Format($"Sikeres betöltés a '{path}' mappába, '{name}' néven.")); + MsgBox.Info(String.Format(parameters.Resource("SUCCESSMESSAGE", Resources.SUCCESSMESSAGE), path, name)); } else MsgBox.Error(processor.Message); diff --git a/client/AudioRecorder/MainForm.resx b/client/AudioRecorder/MainForm.resx index 6ef2a826..6631d131 100644 --- a/client/AudioRecorder/MainForm.resx +++ b/client/AudioRecorder/MainForm.resx @@ -177,6 +177,9 @@ 2zYMwxC7J/J4J8uyfsunrxvJQkThRl7Jn1zIPz8uSV/nWE9kicDiSwAAAABJRU5ErkJggg== + + 17, 17 + 162 diff --git a/client/AudioRecorder/MetadataSelectorForm.cs b/client/AudioRecorder/MetadataSelectorForm.cs index da46e980..cedd49b5 100644 --- a/client/AudioRecorder/MetadataSelectorForm.cs +++ b/client/AudioRecorder/MetadataSelectorForm.cs @@ -1,5 +1,5 @@ using AudioRecorder.Properties; -using MaestroShared.Configuration; +using MaestroShared.Metadata; using System; using System.Windows.Forms; @@ -7,9 +7,14 @@ namespace AudioRecorder { public partial class MetadataSelectorForm : Form { private Metadata selectedMetadata; + public enum TargetType { + Free, Octopus, TrafficPromo, TrafficAD, TrafficMaterial + } + public class Metadata { public string ID { get; set; } public string Text { get; set; } + public TargetType TargetType { get; set; } } public Metadata SelectedMetadata { @@ -30,6 +35,7 @@ namespace AudioRecorder { metadataIDSelector.NativeOctopusIDSelector.IDChangedEvent += NativeOctopusIDChangedEvent; metadataIDSelector.TrafficIDSelector.IDChangedEvent += TrafficIDChangedEvent; metadataIDSelector.MetadataIDText.TextChanged += OnMetadataIDChanged; + metadataIDSelector.FreeIDText.TextChanged += OnFreeIDChanged; buttonCancel.Text = settings.Resource("CANCEL", Resources.CANCEL); buttonOK.Text = settings.Resource("DONE", Resources.DONE); Text = settings.Resource("SELECTORTITLE", Resources.SELECTORTITLE); @@ -39,6 +45,17 @@ namespace AudioRecorder { SelectedMetadata = null; } + private void OnFreeIDChanged(object sender, EventArgs e) { + string text = metadataIDSelector.FreeIDText == null ? null : metadataIDSelector.FreeIDText.Text.Trim(); + if (text == null || text.Length == 0) + SelectedMetadata = null; + else + SelectedMetadata = new Metadata() { + ID = text, + TargetType = TargetType.Free + }; + } + private void UpdateOkButtonEnabled() { buttonOK.Enabled = !String.IsNullOrEmpty(SelectedMetadata?.ID); } @@ -49,7 +66,8 @@ namespace AudioRecorder { else SelectedMetadata = new Metadata() { ID = name, - Text = text + Text = text, + TargetType = TargetType.Octopus }; } @@ -59,18 +77,33 @@ namespace AudioRecorder { else SelectedMetadata = new Metadata() { ID = name, - Text = text + Text = text, + TargetType = TargetType.Octopus }; } private void TrafficIDChangedEvent(string id, int variantID, string text) { if (id == null) SelectedMetadata = null; - else - SelectedMetadata = new Metadata() { + else { + var metadata = new Metadata() { ID = id, Text = text }; + MetadataType metadataType = MetadataTypeUtil.Guess(id); + switch (metadataType) { + case MetadataType.TrafficAD: + metadata.TargetType = TargetType.TrafficAD; + break; + case MetadataType.TrafficPromo: + metadata.TargetType = TargetType.TrafficPromo; + break; + case MetadataType.TrafficMaterial: + metadata.TargetType = TargetType.TrafficMaterial; + break; + } + SelectedMetadata = metadata; + } } private void OnCancelClick(object sender, EventArgs e) { diff --git a/client/AudioRecorder/Program.cs b/client/AudioRecorder/Program.cs index 84a7a7f0..56c82bd1 100644 --- a/client/AudioRecorder/Program.cs +++ b/client/AudioRecorder/Program.cs @@ -7,6 +7,7 @@ namespace AudioRecorder { /// /// The main entry point for the application. /// + //[STAThread] [MTAThread] static void Main() { Application.EnableVisualStyles(); diff --git a/client/AudioRecorder/Properties/AssemblyInfo.cs b/client/AudioRecorder/Properties/AssemblyInfo.cs index 869c8e85..994f5c8f 100644 --- a/client/AudioRecorder/Properties/AssemblyInfo.cs +++ b/client/AudioRecorder/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.7.0")] -[assembly: AssemblyFileVersion("2.0.7.0")] +[assembly: AssemblyVersion("2.0.7.2")] +[assembly: AssemblyFileVersion("2.0.7.2")] diff --git a/client/AudioRecorder/Properties/Resources.Designer.cs b/client/AudioRecorder/Properties/Resources.Designer.cs index fc729285..ccb7ca48 100644 --- a/client/AudioRecorder/Properties/Resources.Designer.cs +++ b/client/AudioRecorder/Properties/Resources.Designer.cs @@ -97,6 +97,24 @@ namespace AudioRecorder.Properties { } } + /// + /// Looks up a localized string similar to Hiányos az 'audiorecorder.json' konfigurációs állomány, nem található 'target' beállítás.. + /// + internal static string ERRORCONFIGURATION { + get { + return ResourceManager.GetString("ERRORCONFIGURATION", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A kiválasztott metaadat azonosító nem lehet üres.. + /// + internal static string ERROREMPTYID { + get { + return ResourceManager.GetString("ERROREMPTYID", resourceCulture); + } + } + /// /// Looks up a localized string similar to Szunet. /// @@ -141,5 +159,14 @@ namespace AudioRecorder.Properties { return ResourceManager.GetString("STOP", resourceCulture); } } + + /// + /// Looks up a localized string similar to Sikeres betöltés a '{0}' mappába, '{1}' néven.. + /// + internal static string SUCCESSMESSAGE { + get { + return ResourceManager.GetString("SUCCESSMESSAGE", resourceCulture); + } + } } } diff --git a/client/AudioRecorder/Properties/Resources.resx b/client/AudioRecorder/Properties/Resources.resx index 7f9af991..ca80cd28 100644 --- a/client/AudioRecorder/Properties/Resources.resx +++ b/client/AudioRecorder/Properties/Resources.resx @@ -145,4 +145,13 @@ ..\Resources\bs-user-logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Hiányos az 'audiorecorder.json' konfigurációs állomány, nem található 'target' beállítás. + + + A kiválasztott metaadat azonosító nem lehet üres. + + + Sikeres betöltés a '{0}' mappába, '{1}' néven. + \ No newline at end of file diff --git a/client/DxPlay/Configuration/dxplay.en b/client/DxPlay/Configuration/dxplay.en index 1c2e824e..6e689af7 100644 --- a/client/DxPlay/Configuration/dxplay.en +++ b/client/DxPlay/Configuration/dxplay.en @@ -13,12 +13,14 @@ "NOINPUT": "NO INPUT", "OPEN": "Open", "OPTIONAL": "Optional", - "PAUSE": "Pause (Esc)", - "FORWARD": "Forward (->)", - "REWIND": "Rewind (<-)", + "PAUSE": "Pause (Space)", + "FORWARD": "Forward (Ctrl + >)", + "REWIND": "Rewind (Ctrl + <)", "PAUSED": "PAUSED", - "PLAY": "Play (Esc)", + "PLAY": "Play (Space)", "PLAYING": "PLAYING", + "STEPBACK": "Step back (<)", + "STEPFORWARD": "Step forward (>)", "POSITIONASTCIN": "Current position as TC in", "POSITIONASTCOUT": "Current position as TC out", "SEGMENTS": "Segments", diff --git a/client/DxPlay/Controls/PlayerControls.Designer.cs b/client/DxPlay/Controls/PlayerControls.Designer.cs index 713a359a..0493bb4c 100644 --- a/client/DxPlay/Controls/PlayerControls.Designer.cs +++ b/client/DxPlay/Controls/PlayerControls.Designer.cs @@ -33,13 +33,18 @@ this.lbStatus = new System.Windows.Forms.Label(); this.lbDuration = new System.Windows.Forms.Label(); this.lbEndTC = new System.Windows.Forms.Label(); + this.controlsPanel = new System.Windows.Forms.TableLayoutPanel(); this.buttonsPanel = new System.Windows.Forms.FlowLayoutPanel(); this.btnPlay = new MaestroShared.Controls.NoFocusCueButton(); this.btnRewind = new MaestroShared.Controls.NoFocusCueButton(); + this.btnStepBack = new MaestroShared.Controls.NoFocusCueButton(); this.btnStop = new MaestroShared.Controls.NoFocusCueButton(); + this.btnStepForward = new MaestroShared.Controls.NoFocusCueButton(); this.btnForward = new MaestroShared.Controls.NoFocusCueButton(); + this.logoPanel = new System.Windows.Forms.Panel(); this.mainPanel.SuspendLayout(); this.timecodePanel.SuspendLayout(); + this.controlsPanel.SuspendLayout(); this.buttonsPanel.SuspendLayout(); this.SuspendLayout(); // @@ -50,7 +55,7 @@ this.mainPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.mainPanel.Controls.Add(this.trackBar, 0, 1); this.mainPanel.Controls.Add(this.timecodePanel, 0, 0); - this.mainPanel.Controls.Add(this.buttonsPanel, 0, 2); + this.mainPanel.Controls.Add(this.controlsPanel, 0, 2); this.mainPanel.Dock = System.Windows.Forms.DockStyle.Top; this.mainPanel.Location = new System.Drawing.Point(0, 0); this.mainPanel.Margin = new System.Windows.Forms.Padding(0); @@ -58,8 +63,8 @@ this.mainPanel.RowCount = 3; this.mainPanel.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.mainPanel.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.mainPanel.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.mainPanel.Size = new System.Drawing.Size(835, 116); + this.mainPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 65F)); + this.mainPanel.Size = new System.Drawing.Size(835, 121); this.mainPanel.TabIndex = 0; // // trackBar @@ -113,8 +118,10 @@ // // lbCurrentTC // + this.lbCurrentTC.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.lbCurrentTC.BackColor = System.Drawing.Color.Transparent; - this.lbCurrentTC.Dock = System.Windows.Forms.DockStyle.Top; this.lbCurrentTC.Font = new System.Drawing.Font("Calibri", 16F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.lbCurrentTC.Location = new System.Drawing.Point(170, 13); this.lbCurrentTC.Name = "lbCurrentTC"; @@ -184,20 +191,37 @@ this.lbEndTC.Text = "00:00:00.00"; this.lbEndTC.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // + // controlsPanel + // + this.controlsPanel.AutoSize = true; + this.controlsPanel.ColumnCount = 2; + this.controlsPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 75F)); + this.controlsPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.controlsPanel.Controls.Add(this.buttonsPanel, 0, 0); + this.controlsPanel.Controls.Add(this.logoPanel, 1, 0); + this.controlsPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.controlsPanel.Location = new System.Drawing.Point(3, 59); + this.controlsPanel.Name = "controlsPanel"; + this.controlsPanel.RowCount = 1; + this.controlsPanel.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.controlsPanel.Size = new System.Drawing.Size(829, 59); + this.controlsPanel.TabIndex = 21; + // // buttonsPanel // this.buttonsPanel.AutoSize = true; - this.buttonsPanel.BackgroundImage = global::DxPlay.Properties.Resources.bs_user_logo; this.buttonsPanel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.buttonsPanel.Controls.Add(this.btnPlay); this.buttonsPanel.Controls.Add(this.btnRewind); + this.buttonsPanel.Controls.Add(this.btnStepBack); this.buttonsPanel.Controls.Add(this.btnStop); + this.buttonsPanel.Controls.Add(this.btnStepForward); this.buttonsPanel.Controls.Add(this.btnForward); - this.buttonsPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.buttonsPanel.Location = new System.Drawing.Point(0, 56); + this.buttonsPanel.Dock = System.Windows.Forms.DockStyle.Left; + this.buttonsPanel.Location = new System.Drawing.Point(0, 0); this.buttonsPanel.Margin = new System.Windows.Forms.Padding(0); this.buttonsPanel.Name = "buttonsPanel"; - this.buttonsPanel.Size = new System.Drawing.Size(835, 60); + this.buttonsPanel.Size = new System.Drawing.Size(360, 60); this.buttonsPanel.TabIndex = 20; // // btnPlay @@ -232,6 +256,22 @@ this.btnRewind.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.btnRewind.UseVisualStyleBackColor = false; // + // btnStepBack + // + this.btnStepBack.AutoSize = true; + this.btnStepBack.BackColor = System.Drawing.Color.Transparent; + this.btnStepBack.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnStepBack.FlatAppearance.BorderSize = 0; + this.btnStepBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnStepBack.Image = global::DxPlay.Properties.Resources.baseline_skip_previous_black_24dp; + this.btnStepBack.Location = new System.Drawing.Point(123, 3); + this.btnStepBack.Name = "btnStepBack"; + this.btnStepBack.Size = new System.Drawing.Size(54, 54); + this.btnStepBack.TabIndex = 21; + this.btnStepBack.TabStop = false; + this.btnStepBack.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; + this.btnStepBack.UseVisualStyleBackColor = false; + // // btnStop // this.btnStop.AutoSize = true; @@ -240,7 +280,7 @@ this.btnStop.FlatAppearance.BorderSize = 0; this.btnStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnStop.Image = global::DxPlay.Properties.Resources.ic_stop_black_24dp_2x; - this.btnStop.Location = new System.Drawing.Point(123, 3); + this.btnStop.Location = new System.Drawing.Point(183, 3); this.btnStop.Name = "btnStop"; this.btnStop.Size = new System.Drawing.Size(54, 54); this.btnStop.TabIndex = 19; @@ -248,6 +288,22 @@ this.btnStop.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.btnStop.UseVisualStyleBackColor = false; // + // btnStepForward + // + this.btnStepForward.AutoSize = true; + this.btnStepForward.BackColor = System.Drawing.Color.Transparent; + this.btnStepForward.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnStepForward.FlatAppearance.BorderSize = 0; + this.btnStepForward.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnStepForward.Image = global::DxPlay.Properties.Resources.baseline_skip_next_black_24dp; + this.btnStepForward.Location = new System.Drawing.Point(243, 3); + this.btnStepForward.Name = "btnStepForward"; + this.btnStepForward.Size = new System.Drawing.Size(54, 54); + this.btnStepForward.TabIndex = 22; + this.btnStepForward.TabStop = false; + this.btnStepForward.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; + this.btnStepForward.UseVisualStyleBackColor = false; + // // btnForward // this.btnForward.AutoSize = true; @@ -256,7 +312,7 @@ this.btnForward.FlatAppearance.BorderSize = 0; this.btnForward.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnForward.Image = global::DxPlay.Properties.Resources.baseline_fast_forward_black_24dp; - this.btnForward.Location = new System.Drawing.Point(183, 3); + this.btnForward.Location = new System.Drawing.Point(303, 3); this.btnForward.Name = "btnForward"; this.btnForward.Size = new System.Drawing.Size(54, 54); this.btnForward.TabIndex = 20; @@ -264,6 +320,18 @@ this.btnForward.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.btnForward.UseVisualStyleBackColor = false; // + // logoPanel + // + this.logoPanel.AutoSize = true; + this.logoPanel.BackgroundImage = global::DxPlay.Properties.Resources.bs_user_logo; + this.logoPanel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.logoPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.logoPanel.Location = new System.Drawing.Point(621, 0); + this.logoPanel.Margin = new System.Windows.Forms.Padding(0); + this.logoPanel.Name = "logoPanel"; + this.logoPanel.Size = new System.Drawing.Size(208, 60); + this.logoPanel.TabIndex = 21; + // // PlayerControls // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -272,10 +340,12 @@ this.Controls.Add(this.mainPanel); this.Margin = new System.Windows.Forms.Padding(0); this.Name = "PlayerControls"; - this.Size = new System.Drawing.Size(835, 116); + this.Size = new System.Drawing.Size(835, 126); this.mainPanel.ResumeLayout(false); this.mainPanel.PerformLayout(); this.timecodePanel.ResumeLayout(false); + this.controlsPanel.ResumeLayout(false); + this.controlsPanel.PerformLayout(); this.buttonsPanel.ResumeLayout(false); this.buttonsPanel.PerformLayout(); this.ResumeLayout(false); @@ -299,5 +369,9 @@ private MaestroShared.Controls.NoFocusCueButton btnStop; private MaestroShared.Controls.NoFocusCueButton btnRewind; private MaestroShared.Controls.NoFocusCueButton btnForward; + private System.Windows.Forms.TableLayoutPanel controlsPanel; + private System.Windows.Forms.Panel logoPanel; + private MaestroShared.Controls.NoFocusCueButton btnStepBack; + private MaestroShared.Controls.NoFocusCueButton btnStepForward; } } diff --git a/client/DxPlay/Controls/PlayerControls.cs b/client/DxPlay/Controls/PlayerControls.cs index 899051f4..21cf06cf 100644 --- a/client/DxPlay/Controls/PlayerControls.cs +++ b/client/DxPlay/Controls/PlayerControls.cs @@ -18,6 +18,8 @@ namespace DxPlay.Controls { public NoFocusCueButton Stop { get => btnStop; } public NoFocusCueButton Rewind { get => btnRewind; } public NoFocusCueButton Forward { get => btnForward; } + public NoFocusCueButton StepBack { get => btnStepBack; } + public NoFocusCueButton StepForward { get => btnStepForward; } } } diff --git a/client/DxPlay/Controls/PlayerControls.resx b/client/DxPlay/Controls/PlayerControls.resx index 88f6ba0d..9b86b793 100644 --- a/client/DxPlay/Controls/PlayerControls.resx +++ b/client/DxPlay/Controls/PlayerControls.resx @@ -120,13 +120,13 @@ - iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAEqSURBVGhD7dgtTgNRFMXxCUlFDaZJDboSgWUFaFS3wArYQbsD1oCpZgVYBBJdRWqqmkAInMfk - JS/Nnem7d46Z5vySf1LMuYaPGRoRERERobpEz+3HQVg7Lrdoi37/v4pj7VSboBX6Qelo9DBrx2WB3lA+ - GD3M2nF5QAd0fNR7mLVTbYZekHUwV4O143KHPpF1rOwU1k61KXpC1hGrLqwdl2v0gawDXVlYO9Uu0CP6 - QtZ4XyXWjssVekXWaE0Za8flHu2RNVhbwtpxWyLGYdZOyKi/hbL8w/eNrPG+SqydsBvE+PXH2gkZ9R+y - UnoE2CHrWNkprJ2QOWI8hLF2wkb7OF1KLyLvaOhh1k5IehVcI8YrJWMnbLQv9aX075BN+3EQ1o6IiIjI - mWqaP9Jxlnyjr5KKAAAAAElFTkSuQmCC + iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAASpJREFUaEPt + 2C1OA1EUxfEJSUUNpkkNuhKBZQVoVLfACthBuwPWgKlmBVgEEl1FaqqaQAicx+QlL82d6bt3jpnm/JJ/ + Usy5ho8ZGhERERGhukTP7cdBWDsut2iLfv+/imPtVJugFfpB6Wj0MGvHZYHeUD4YPczacXlAB3R81HuY + tVNthl6QdTBXg7Xjcoc+kXWs7BTWTrUpekLWEasurB2Xa/SBrANdWVg71S7QI/pC1nhfJdaOyxV6RdZo + TRlrx+Ue7ZE1WFvC2nFbIsZh1k7IqL+FsvzD942s8b5KrJ2wG8T49cfaCRn1H7JSegTYIetY2SmsnZA5 + YjyEsXbCRvs4XUovIu9o6GHWTkh6FVwjxislYydstC/1pfTvkE37cRDWjoiIiMiZapo/0nGWfKOvkooA + AAAASUVORK5CYII= \ No newline at end of file diff --git a/client/DxPlay/DxPlayer.cs b/client/DxPlay/DxPlayer.cs index 89677b55..101655ab 100644 --- a/client/DxPlay/DxPlayer.cs +++ b/client/DxPlay/DxPlayer.cs @@ -13,7 +13,6 @@ using System.Collections.Generic; using Myriadbits.MXF; using MaestroShared.Metadata; using NLog; -using MaestroShared.Configuration; using DxPlay.Properties; namespace DxPlay { @@ -48,31 +47,49 @@ namespace DxPlay { private object tcLock = new object(); Bitmap m_Bitmap = null; public bool IsError { get; set; } + + private object SeekToLock = new object(); + private int seekTo; + public int SeekTo { + get { + lock (SeekToLock) { + return seekTo; + } + } + set { + lock (SeekToLock) { + seekTo = value; + } + } + } + private int m_stride; Control playerWindow; private PlayerGraph graph; + private readonly DxPlaySettings settings; // Play an avi file into a window. Allow for snapshots. // (Control to show video in, Avi file to play - public DxPlayer(Control hWin, ref MediaDescription mediaDesc, UISettings properties) { - stringValues.Add(GraphState.Exiting, properties.Resource("EXITING", Resources.EXITING)); - stringValues.Add(GraphState.Paused, properties.Resource("PAUSED", Resources.PAUSED)); - stringValues.Add(GraphState.Playing, properties.Resource("PLAYING", Resources.PLAYING)); - stringValues.Add(GraphState.Stopped, properties.Resource("STOPPED", Resources.STOPPED)); - stringValues.Add(GraphState.Completed, properties.Resource("COMPLETED", Resources.COMPLETED)); + public DxPlayer(Control hWin, ref MediaDescription mediaDesc, DxPlaySettings settings) { + this.settings = settings; + + stringValues.Add(GraphState.Exiting, settings.Resource("EXITING", Resources.EXITING)); + stringValues.Add(GraphState.Paused, settings.Resource("PAUSED", Resources.PAUSED)); + stringValues.Add(GraphState.Playing, settings.Resource("PLAYING", Resources.PLAYING)); + stringValues.Add(GraphState.Stopped, settings.Resource("STOPPED", Resources.STOPPED)); + stringValues.Add(GraphState.Completed, settings.Resource("COMPLETED", Resources.COMPLETED)); State = GraphState.Stopped; try { int hr; MediaDescription = mediaDesc; // Set up the graph playerWindow = hWin; - //playerWindow.Invalidate(); SetupGraph(); - hWin.Hide(); - hWin.Show(); + //hWin.Hide(); + //hWin.Show(); // Get the event handle the graph will use to signal // when events occur @@ -89,33 +106,43 @@ namespace DxPlay { m_eventThread.Name = "Media Event Thread"; m_eventThread.Start(); - m_Bitmap = Properties.Resources.lgs; + m_Bitmap = Resources.lgs; tcWorker = new BackgroundWorker(); tcWorker.DoWork += TcWorker_DoWork; tcWorker.WorkerSupportsCancellation = true; tcWorker.RunWorkerAsync(tcLock); - } catch { + } catch (Exception e) { + logger.Error(e); Dispose(); throw; } + } private void SetupGraph() { graph = new PlayerGraph(MediaDescription.FileName, playerWindow.Handle); + //TODO hogy lesz igy framrate? + //if (graph.SampleGrabber == null) + // return; + + if (graph.SampleGrabber == null) + throw new Exception("Audio only file is not supported."); + AMMediaType media = new AMMediaType(); graph.SampleGrabber.GetConnectedMediaType(media); logger.Debug("SaveSizeInfo"); SaveSizeInfo(media); DsUtils.FreeAMMediaType(media); - logger.Debug("ConfigureSampleGrabber"); - ConfigureSampleGrabber(graph.SampleGrabber); logger.Debug("SetTimeCodes"); SetTimeCodes(); - logger.Debug("ConfigureVideoWindow"); + + logger.Debug("ConfigureSampleGrabber"); + ConfigureSampleGrabber(graph.SampleGrabber); + logger.Debug("UpdateVideoWindow"); UpdateVideoWindow(); RenderFirstFrame(); } @@ -124,12 +151,20 @@ namespace DxPlay { graph.MediaControl.Run(); graph.MediaSeeking.SetPositions(1, AMSeekingSeekingFlags.AbsolutePositioning, null, AMSeekingSeekingFlags.NoPositioning); graph.MediaControl.Pause(); + //ForceRepaintFrame(); } private void TcWorker_DoWork(object sender, DoWorkEventArgs e) { while (!e.Cancel) { UpdateTC(); Thread.Sleep(10); + + if (SeekTo != 0) { + RealSeek(SeekTo); + Thread.Sleep(100); + SeekTo = 0; + } + } } @@ -183,8 +218,11 @@ namespace DxPlay { Seek(CurrentTC.ZeroBasedFrames + step); } } - public void Seek(int value) { + SeekTo = value; + } + + public void RealSeek(int value) { if (graph == null || graph.MediaSeeking == null) return; double frameLength = (double)MEDIATIME_REFERENCE / MediaDescription.FrameRate; @@ -205,6 +243,7 @@ namespace DxPlay { DsError.ThrowExceptionForHR(hr); corrected = true; } + //ForceRepaintFrame(); logger.Debug("Seeking requested frame {0} got frame {1}, media position {2}, frame length {3}, corrected {4}", value, reachedFrames, requestedPosition, avgTimePerFrame, corrected); } @@ -236,29 +275,47 @@ namespace DxPlay { MediaDescription.duration = new Timecode(); MediaDescription.Duration.Set(ReferenceTimeToFrames(duration)); if (MediaDescription.FirstFrame == null) { - try { - MXFFile mxf = new MXFFile(MediaDescription.FileName); - mxf.Inspect(); - //MediaDescription.firstFrame = new Timecode(mxf.FirstSystemItem?.UserDateFullFrameNb, MediaDescription.FrameRate); - MediaDescription.firstFrame = new Timecode((int)mxf.TimecodeComponent.StartTimecode, (float)mxf.TimecodeComponent.RoundedTimecodeBase); - } catch (Exception ex) { + if (settings.IsStandalone) { + // BSH Kenya playout nem kezel start TC-t, minden 0 alapu MediaDescription.firstFrame = new Timecode(); + } else { + try { + MXFFile mxf = new MXFFile(MediaDescription.FileName); + mxf.Inspect(); + MediaDescription.firstFrame = new Timecode((int)mxf.TimecodeComponent.StartTimecode, (float)mxf.TimecodeComponent.RoundedTimecodeBase); + } catch { + MediaDescription.firstFrame = new Timecode(); + } } } - //MediaDescription.firstFrame = new Timecode(); CurrentTC = new Timecode(MediaDescription.FirstFrame); } + [StructLayout(LayoutKind.Sequential)] + struct PAINTSTRUCT { + public IntPtr hdc; + public bool fErase; + public RECT rcPaint; + public bool fRestore; + public bool fIncUpdate; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public byte[] rgbReserved; + } + [DllImport("user32.dll")] + static extern IntPtr BeginPaint(IntPtr hwnd, out PAINTSTRUCT lpPaint); + + [DllImport("user32.dll")] + static extern bool EndPaint(IntPtr hWnd, [In] ref PAINTSTRUCT lpPaint); public void UpdateVideoWindow() { - if (graph.WindowlessControl != null) { - graph.WindowlessControl.GetNativeVideoSize(out int w, out int h, out int aw, out int ah); - DsRect src = new DsRect(0, 0, w, h); - DsRect dst = new DsRect(playerWindow.ClientRectangle); - graph.WindowlessControl.SetVideoPosition(src, dst); - return; - } + //if (graph.WindowlessControl != null) { + // graph.WindowlessControl.GetNativeVideoSize(out int w, out int h, out int aw, out int ah); + // DsRect src = new DsRect(0, 0, w, h); + // DsRect dst = new DsRect(playerWindow.ClientRectangle); + // graph.WindowlessControl.SetVideoPosition(src, dst); + // ForceRepaintFrame(); + // return; + //} Size resolution = MediaDescription.Resolution; if (resolution.Width == 0 || resolution.Height == 0) @@ -285,24 +342,28 @@ namespace DxPlay { } } + //private void ForceRepaintFrame() { + // if (graph.WindowlessControl == null) + // return; + // using (Graphics g = playerWindow.CreateGraphics()) { + // IntPtr hdc = BeginPaint(playerWindow.Handle, out PAINTSTRUCT lpPaint); + // graph.WindowlessControl.RepaintVideo(playerWindow.Handle, hdc); + // EndPaint(playerWindow.Handle, ref lpPaint); + // } + //} + public void ToggleFullscreen() { - if (graph == null) + if (graph == null || graph.VideoWindow == null) return; graph.VideoWindow.put_FullScreenMode(IsFullscreen() ? OABool.False : OABool.True); } public bool IsFullscreen() { - - //if (graph == null) + if (graph == null || graph.VideoWindow == null) return false; - - if (graph.VideoWindow != null) { - int hr = graph.VideoWindow.get_FullScreenMode(out OABool isFullscreen); - DsError.ThrowExceptionForHR(hr); - return isFullscreen == OABool.True ? true : false; - } - - return false; + int hr = graph.VideoWindow.get_FullScreenMode(out OABool isFullscreen); + DsError.ThrowExceptionForHR(hr); + return isFullscreen == OABool.True ? true : false; } // Set the options on the sa_ve grabber @@ -331,16 +392,23 @@ namespace DxPlay { //hr = sampGrabber.GetConnectedMediaType(media); //DsError.ThrowExceptionForHR(hr); - if ((media.formatType != FormatType.VideoInfo) || (media.formatPtr == IntPtr.Zero)) { - throw new NotSupportedException("Unknown Grabber Media Format"); + if (media.formatType == FormatType.VideoInfo) { + VideoInfoHeader videoInfoHeader = (VideoInfoHeader)Marshal.PtrToStructure(media.formatPtr, typeof(VideoInfoHeader)); + MediaDescription.resolution = new Size(videoInfoHeader.BmiHeader.Width, videoInfoHeader.BmiHeader.Height); + MediaDescription.frameRate = MEDIATIME_REFERENCE / videoInfoHeader.AvgTimePerFrame; + + m_stride = videoInfoHeader.BmiHeader.Width * (videoInfoHeader.BmiHeader.BitCount / 8); + return; } - // Grab the size info - VideoInfoHeader videoInfoHeader = (VideoInfoHeader)Marshal.PtrToStructure(media.formatPtr, typeof(VideoInfoHeader)); - MediaDescription.resolution = new Size(videoInfoHeader.BmiHeader.Width, videoInfoHeader.BmiHeader.Height); - MediaDescription.frameRate = MEDIATIME_REFERENCE / videoInfoHeader.AvgTimePerFrame; + if (media.formatType == FormatType.WaveEx) { + VideoInfoHeader videoInfoHeader = (VideoInfoHeader)Marshal.PtrToStructure(media.formatPtr, typeof(VideoInfoHeader)); + MediaDescription.resolution = new Size(videoInfoHeader.BmiHeader.Width, videoInfoHeader.BmiHeader.Height); + MediaDescription.frameRate = MEDIATIME_REFERENCE / videoInfoHeader.AvgTimePerFrame; + return; + } - m_stride = videoInfoHeader.BmiHeader.Width * (videoInfoHeader.BmiHeader.BitCount / 8); + throw new NotSupportedException("Unknown Grabber Media Format"); } // Shut down capture @@ -427,11 +495,7 @@ namespace DxPlay { private void EventWait() { // Returned when GetEvent is called but there are no events const int E_ABORT = unchecked((int)0x80004004); - int hr; - IntPtr p1, p2; - EventCode ec; - do { // Wait for an event m_mre.WaitOne(-1, true); @@ -442,7 +506,7 @@ namespace DxPlay { if (State != GraphState.Exiting) { // Read the event for ( - hr = graph.MediaEvent.GetEvent(out ec, out p1, out p2, 0); + hr = graph.MediaEvent.GetEvent(out EventCode ec, out IntPtr p1, out IntPtr p2, 0); hr >= 0; hr = graph.MediaEvent.GetEvent(out ec, out p1, out p2, 0) ) { diff --git a/client/DxPlay/DxPlayerx.cs b/client/DxPlay/DxPlayerx.cs index acf852b1..0f7c16fe 100644 --- a/client/DxPlay/DxPlayerx.cs +++ b/client/DxPlay/DxPlayerx.cs @@ -240,6 +240,9 @@ namespace DxPlay { m_mediaCtrl = m_FilterGraph as IMediaControl; m_videoWindow = m_FilterGraph as IVideoWindow; + logger.Debug("SetTimeCodes"); + SetTimeCodes(); + #if DEBUG m_DsRot = new DsROTEntry(m_FilterGraph); #endif @@ -354,8 +357,6 @@ namespace DxPlay { //logger.Debug("SaveSizeInfo"); //SaveSizeInfo(sampGrabber as ISampleGrabber); - logger.Debug("SetTimeCodes"); - SetTimeCodes(); logger.Debug("ConfigureVideoWindow"); ConfigureVideoWindow(); diff --git a/client/DxPlay/PlayerForm.Designer.cs b/client/DxPlay/PlayerForm.Designer.cs index 79263161..49944a66 100644 --- a/client/DxPlay/PlayerForm.Designer.cs +++ b/client/DxPlay/PlayerForm.Designer.cs @@ -83,7 +83,7 @@ namespace DxPlay { this.pVideo.Dock = System.Windows.Forms.DockStyle.Fill; this.pVideo.Location = new System.Drawing.Point(0, 0); this.pVideo.Name = "pVideo"; - this.pVideo.Size = new System.Drawing.Size(741, 487); + this.pVideo.Size = new System.Drawing.Size(478, 419); this.pVideo.TabIndex = 0; this.pVideo.TabStop = true; this.pVideo.SizeChanged += new System.EventHandler(this.panel1_SizeChanged); @@ -106,8 +106,8 @@ namespace DxPlay { this.mainSplit.Panel2.Controls.Add(this.tableLayoutPanel1); this.mainSplit.Panel2.Controls.Add(this.pMetadataDisplay); this.mainSplit.Panel2MinSize = 300; - this.mainSplit.Size = new System.Drawing.Size(1068, 489); - this.mainSplit.SplitterDistance = 743; + this.mainSplit.Size = new System.Drawing.Size(784, 421); + this.mainSplit.SplitterDistance = 480; this.mainSplit.TabIndex = 20; // // panelPlayer @@ -116,7 +116,7 @@ namespace DxPlay { this.panelPlayer.Dock = System.Windows.Forms.DockStyle.Fill; this.panelPlayer.Location = new System.Drawing.Point(0, 0); this.panelPlayer.Name = "panelPlayer"; - this.panelPlayer.Size = new System.Drawing.Size(741, 487); + this.panelPlayer.Size = new System.Drawing.Size(478, 419); this.panelPlayer.TabIndex = 0; // // tableLayoutPanel1 @@ -132,7 +132,7 @@ namespace DxPlay { this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 1; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(319, 424); + this.tableLayoutPanel1.Size = new System.Drawing.Size(298, 356); this.tableLayoutPanel1.TabIndex = 4; // // tabEditor @@ -149,7 +149,7 @@ namespace DxPlay { this.tabEditor.Name = "tabEditor"; this.tabEditor.Padding = new System.Drawing.Point(10, 5); this.tabEditor.SelectedIndex = 0; - this.tabEditor.Size = new System.Drawing.Size(292, 416); + this.tabEditor.Size = new System.Drawing.Size(271, 348); this.tabEditor.TabIndex = 2; // // tpMetadata @@ -161,7 +161,7 @@ namespace DxPlay { this.tpMetadata.Location = new System.Drawing.Point(4, 4); this.tpMetadata.Name = "tpMetadata"; this.tpMetadata.Padding = new System.Windows.Forms.Padding(3); - this.tpMetadata.Size = new System.Drawing.Size(284, 377); + this.tpMetadata.Size = new System.Drawing.Size(263, 309); this.tpMetadata.TabIndex = 0; this.tpMetadata.Text = "Metadata"; // @@ -173,7 +173,7 @@ namespace DxPlay { this.trafficBrowser.Location = new System.Drawing.Point(3, 3); this.trafficBrowser.Margin = new System.Windows.Forms.Padding(0); this.trafficBrowser.Name = "trafficBrowser"; - this.trafficBrowser.Size = new System.Drawing.Size(278, 371); + this.trafficBrowser.Size = new System.Drawing.Size(257, 303); this.trafficBrowser.TabIndex = 0; // // tpSegments @@ -338,13 +338,13 @@ namespace DxPlay { this.pMetadataDisplay.Controls.Add(this.labelSelectedMetadata, 0, 0); this.pMetadataDisplay.Controls.Add(this.txtSelectedID, 0, 1); this.pMetadataDisplay.Dock = System.Windows.Forms.DockStyle.Bottom; - this.pMetadataDisplay.Location = new System.Drawing.Point(0, 424); + this.pMetadataDisplay.Location = new System.Drawing.Point(0, 356); this.pMetadataDisplay.Margin = new System.Windows.Forms.Padding(0); this.pMetadataDisplay.Name = "pMetadataDisplay"; this.pMetadataDisplay.RowCount = 2; this.pMetadataDisplay.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.pMetadataDisplay.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.pMetadataDisplay.Size = new System.Drawing.Size(319, 63); + this.pMetadataDisplay.Size = new System.Drawing.Size(298, 63); this.pMetadataDisplay.TabIndex = 5; // // btnApprove @@ -355,7 +355,7 @@ namespace DxPlay { this.btnApprove.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnApprove.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.btnApprove.Image = ((System.Drawing.Image)(resources.GetObject("btnApprove.Image"))); - this.btnApprove.Location = new System.Drawing.Point(217, 29); + this.btnApprove.Location = new System.Drawing.Point(196, 29); this.btnApprove.Margin = new System.Windows.Forms.Padding(0, 4, 0, 0); this.btnApprove.Name = "btnApprove"; this.btnApprove.Size = new System.Drawing.Size(102, 30); @@ -375,7 +375,7 @@ namespace DxPlay { this.labelSelectedMetadata.Location = new System.Drawing.Point(3, 0); this.labelSelectedMetadata.Name = "labelSelectedMetadata"; this.labelSelectedMetadata.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); - this.labelSelectedMetadata.Size = new System.Drawing.Size(211, 25); + this.labelSelectedMetadata.Size = new System.Drawing.Size(190, 25); this.labelSelectedMetadata.TabIndex = 13; this.labelSelectedMetadata.Text = "Selected metadata"; // @@ -387,7 +387,7 @@ namespace DxPlay { this.txtSelectedID.Font = new System.Drawing.Font("Microsoft Sans Serif", 16F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.txtSelectedID.Location = new System.Drawing.Point(3, 28); this.txtSelectedID.Name = "txtSelectedID"; - this.txtSelectedID.Size = new System.Drawing.Size(211, 32); + this.txtSelectedID.Size = new System.Drawing.Size(190, 32); this.txtSelectedID.TabIndex = 12; // // mainMenu @@ -396,7 +396,7 @@ namespace DxPlay { this.fileToolStripMenuItem}); this.mainMenu.Location = new System.Drawing.Point(0, 0); this.mainMenu.Name = "mainMenu"; - this.mainMenu.Size = new System.Drawing.Size(1068, 24); + this.mainMenu.Size = new System.Drawing.Size(784, 24); this.mainMenu.TabIndex = 21; this.mainMenu.Text = "menuStrip1"; // @@ -431,10 +431,10 @@ namespace DxPlay { this.playerControls.BackColor = System.Drawing.Color.Transparent; this.playerControls.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.playerControls.Dock = System.Windows.Forms.DockStyle.Bottom; - this.playerControls.Location = new System.Drawing.Point(0, 513); + this.playerControls.Location = new System.Drawing.Point(0, 445); this.playerControls.Margin = new System.Windows.Forms.Padding(0); this.playerControls.Name = "playerControls"; - this.playerControls.Size = new System.Drawing.Size(1068, 116); + this.playerControls.Size = new System.Drawing.Size(784, 116); this.playerControls.TabIndex = 22; // // PlayerForm @@ -442,7 +442,7 @@ namespace DxPlay { this.AllowDrop = true; this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.BackColor = System.Drawing.Color.White; - this.ClientSize = new System.Drawing.Size(1068, 629); + this.ClientSize = new System.Drawing.Size(784, 561); this.Controls.Add(this.mainSplit); this.Controls.Add(this.mainMenu); this.Controls.Add(this.playerControls); diff --git a/client/DxPlay/PlayerForm.cs b/client/DxPlay/PlayerForm.cs index 3fe967d8..84580376 100644 --- a/client/DxPlay/PlayerForm.cs +++ b/client/DxPlay/PlayerForm.cs @@ -45,13 +45,13 @@ namespace DxPlay { /// /// User control cimkejenek rendszeres frissitese villogast eredmenyez e nelkul /// - protected override CreateParams CreateParams { - get { - CreateParams cp = base.CreateParams; - cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED - return cp; - } - } + //protected override CreateParams CreateParams { + // get { + // CreateParams cp = base.CreateParams; + // cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED + // return cp; + // } + //} public bool openFileDialogOpened; @@ -91,15 +91,20 @@ namespace DxPlay { public PlayerForm() { InitializeComponent(); - playerControls.Play.Click += btnPlay_Click; - playerControls.Stop.Click += btnStop_Click; - playerControls.Rewind.MouseDown += btnRewind_MouseDown; - playerControls.Rewind.MouseUp += btnRewind_MouseUp; - playerControls.Forward.MouseUp += btnForward_MouseUp; - playerControls.Forward.MouseDown += btnForward_MouseDown; + playerControls.Play.Click += OnPlayClick; + playerControls.Stop.Click += OnStopClick; + playerControls.Rewind.MouseDown += OnRewindMouseDown; + playerControls.Rewind.MouseUp += OnRewindMouseUp; + playerControls.Forward.MouseUp += OnForwardMouseUp; + playerControls.Forward.MouseDown += OnForwardMouseDown; + playerControls.StepBack.MouseDown += OnStepBackMouseDown; + playerControls.StepBack.MouseUp += OnStepBackMouseUp; + playerControls.StepForward.MouseUp += OnStepForwardMouseUp; + playerControls.StepForward.MouseDown += OnStepForwardMouseDown; - playerControls.TrackBar.MouseDown += trackBar1_MouseDown; - playerControls.TrackBar.MouseUp += trackBar1_MouseUp; + playerControls.TrackBar.MouseDown += OnTrackBarMouseDown; + playerControls.TrackBar.MouseUp += OnTrackBarMouseUp; + playerControls.TrackBar.Scroll += OnTrackBarScroll; } private void InitializeTexts() { @@ -117,6 +122,8 @@ namespace DxPlay { tooltips = new ToolTip(); tooltips.SetToolTip(playerControls.Rewind, Settings.Resource("REWIND", Resources.REWIND)); tooltips.SetToolTip(playerControls.Forward, Settings.Resource("FORWARD", Resources.FORWARD)); + tooltips.SetToolTip(playerControls.StepBack, Settings.Resource("STEPBACK", Resources.STEPBACK)); + tooltips.SetToolTip(playerControls.StepForward, Settings.Resource("STEPFORWARD", Resources.STEPFORWARD)); tooltips.SetToolTip(playerControls.Play, Settings.Resource("PLAY", Resources.PLAY)); tooltips.SetToolTip(playerControls.Stop, Settings.Resource("STOP", Resources.STOP)); playerControls.Status.Text = Settings.Resource("NOINPUT", Resources.NOINPUT); @@ -182,6 +189,13 @@ namespace DxPlay { logger.Error(e); } } + + + //for (int i = 0; i < 100; i++) { + // m_play.Seek(i); + // Application.DoEvents(); + // Thread.Sleep(100); + //} } @@ -207,28 +221,26 @@ namespace DxPlay { m_play.UpdateVideoWindow(); } - private void trackBar1_MouseDown(object sender, MouseEventArgs e) { + private void OnTrackBarMouseDown(object sender, MouseEventArgs e) { trackBarAtUser = true; lastClick = DateTime.Now; } - private void trackBar1_MouseUp(object sender, MouseEventArgs e) { - if (trackBarAtUser) { - trackBarAtUser = false; - if (m_play != null) - m_play.Seek(playerControls.TrackBar.Value); - else - playerControls.TrackBar.Value = 0; - } + private void OnTrackBarMouseUp(object sender, MouseEventArgs e) { + trackBarAtUser = false; + } + + private void OnTrackBarScroll(object sender, ScrollEventArgs e) { + if (m_play != null) + m_play.Seek(playerControls.TrackBar.Value); } + private void PlayOrPause() { if (m_play == null) return; if (m_play.State == GraphState.Playing) { - m_play.Pause(); - playerControls.Play.Image = Resources.ic_play_arrow_black_24dp_2x; - tooltips.SetToolTip(playerControls.Play, Settings.Resource("PLAY", Resources.PLAY)); + Pause(); return; } m_play.Play(); @@ -236,11 +248,17 @@ namespace DxPlay { tooltips.SetToolTip(playerControls.Play, Settings.Resource("PAUSE", Resources.PAUSE)); } - private void btnPlay_Click(object sender, EventArgs e) { + private void Pause() { + m_play.Pause(); + playerControls.Play.Image = Resources.ic_play_arrow_black_24dp_2x; + tooltips.SetToolTip(playerControls.Play, Settings.Resource("PLAY", Resources.PLAY)); + } + + private void OnPlayClick(object sender, EventArgs e) { PlayOrPause(); } - private void btnStop_Click(object sender, EventArgs e) { + private void OnStopClick(object sender, EventArgs e) { if (m_play != null && m_play.State != GraphState.Stopped) { m_play.Stop(); } @@ -249,30 +267,51 @@ namespace DxPlay { private bool buttonDown; - private void btnRewind_MouseUp(object sender, MouseEventArgs e) { + private void OnRewindMouseUp(object sender, MouseEventArgs e) { buttonDown = false; } - private void btnRewind_MouseDown(object sender, MouseEventArgs e) { + private void OnRewindMouseDown(object sender, MouseEventArgs e) { buttonDown = true; - int num = 0; do { - num++; - Rewind(); + m_play.Rewind(10); Application.DoEvents(); } while (buttonDown); } - private void btnForward_MouseUp(object sender, MouseEventArgs e) { + private void OnForwardMouseUp(object sender, MouseEventArgs e) { buttonDown = false; } - private void btnForward_MouseDown(object sender, EventArgs e) { + private void OnForwardMouseDown(object sender, EventArgs e) { buttonDown = true; int num = 0; do { - num++; - Forward(); + m_play.Forward(10); + Application.DoEvents(); + } while (buttonDown); + } + + private void OnStepBackMouseUp(object sender, MouseEventArgs e) { + buttonDown = false; + } + + private void OnStepBackMouseDown(object sender, MouseEventArgs e) { + buttonDown = true; + do { + m_play.Rewind(1); + Application.DoEvents(); + } while (buttonDown); + } + + private void OnStepForwardMouseUp(object sender, MouseEventArgs e) { + buttonDown = false; + } + + private void OnStepForwardMouseDown(object sender, EventArgs e) { + buttonDown = true; + do { + m_play.Forward(1); Application.DoEvents(); } while (buttonDown); } @@ -280,14 +319,14 @@ namespace DxPlay { private void Rewind() { if (m_play == null) return; - int step = ModifierKeys.HasFlag(Keys.Control) ? 5 : 1; + int step = ModifierKeys.HasFlag(Keys.Control) ? 10 : 1; m_play.Rewind(step); } private void Forward() { if (m_play == null) return; - int step = ModifierKeys.HasFlag(Keys.Control) ? 5 : 1; + int step = ModifierKeys.HasFlag(Keys.Control) ? 10 : 1; m_play.Forward(step); } @@ -404,11 +443,14 @@ namespace DxPlay { } private void OnPlayEvent() { - //if (!IsHandleCreated || Disposing || IsDisposed || m_play == null) - // return; - //if (Disposing || IsDisposed || m_play == null) - // return; - playerControls.Invoke((Action)(() => { + if (!IsHandleCreated || Disposing || IsDisposed || m_play == null) + return; + + BeginInvoke((Action)(() => { + if (Disposing || IsDisposed || m_play == null) + return; + if (m_play.State == GraphState.Completed) + Pause(); if (!trackBarAtUser) playerControls.TrackBar.Value = m_play.CurrentTC.ZeroBasedFrames; playerControls.CurrentTC.Text = m_play.CurrentTC.ToString(); @@ -431,12 +473,24 @@ namespace DxPlay { // m_play.Dispose(); } + private void ProcessCommandLine() { + String[] arguments = Environment.GetCommandLineArgs(); + if (arguments.Length > 1) { + FileInfo fi = new FileInfo(arguments[1]); + if (fi.Exists) + OpenFile(fi); + } + } + private void PlayerForm_Shown(object sender, EventArgs e) { logger.Debug("PlayerForm_Shown"); InitializeTexts(); if (true.Equals(Settings?.Player?.SegmentEditor) && true.Equals(Settings?.IsStandalone)) { mainMenu.Visible = true; } + + ProcessCommandLine(); + if (m_play != null && true.Equals(Settings?.Player?.AutoStart)) m_play.Play(); } diff --git a/client/DxPlay/PlayerForm.resx b/client/DxPlay/PlayerForm.resx index a3f828ce..675af611 100644 --- a/client/DxPlay/PlayerForm.resx +++ b/client/DxPlay/PlayerForm.resx @@ -173,7 +173,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABo - CAAAAk1TRnQBSQFMAgEBAgEAAXgBAQF4AQEBGAEAARgBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CAAAAk1TRnQBSQFMAgEBAgEAAYgBAQGIAQEBGAEAARgBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABYAMAARgDAAEBAQABCAYAAQkYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/client/DxPlay/PlayerGraph.cs b/client/DxPlay/PlayerGraph.cs index 967d6ac3..8c38ff3d 100644 --- a/client/DxPlay/PlayerGraph.cs +++ b/client/DxPlay/PlayerGraph.cs @@ -15,7 +15,7 @@ namespace DxPlay { public IMediaSeeking MediaSeeking { get; private set; } public IMediaControl MediaControl { get; private set; } public IMediaEvent MediaEvent { get; private set; } - public IVMRWindowlessControl9 WindowlessControl { get; private set; } + //public IVMRWindowlessControl9 WindowlessControl { get; private set; } private bool isDisposed; @@ -24,7 +24,7 @@ namespace DxPlay { MediaSeeking = this as IMediaSeeking; MediaControl = this as IMediaControl; MediaEvent = this as IMediaEvent; - //VideoWindow = this as IVideoWindow; + VideoWindow = this as IVideoWindow; IGraphBuilder graphBuilder = this as IGraphBuilder; #if DEBUG m_DsRot = new DsROTEntry(graphBuilder); @@ -33,21 +33,35 @@ namespace DxPlay { DsError.ThrowExceptionForHR(graphBuilder.AddSourceFilter(fileName, fileName, out IBaseFilter sourceFilter)); IBaseFilter splitter = AddSplitter(graphBuilder, sourceFilter); - IBaseFilter videoDecoder = AddVideoDecoder(graphBuilder, splitter); - IBaseFilter sampleGrabber = AddSampleGrabber(graphBuilder, videoDecoder); - SampleGrabber = (ISampleGrabber)sampleGrabber; - IBaseFilter videoRenderer = AddRenderer(graphBuilder, sampleGrabber, handle); - FilterGraphTools.RenderPin(graphBuilder, sampleGrabber, "Output"); - //IBaseFilter videoRenderer = AddSimpleRenderer(graphBuilder, sampleGrabber); + bool audioOnly = true; + if (DsFindPin.ByName(splitter, "Video") != null) { + audioOnly = false; + IBaseFilter videoDecoder = AddVideoDecoder(graphBuilder, splitter); + EnableDeinterlace(videoDecoder); + IBaseFilter sampleGrabber = AddSampleGrabber(graphBuilder, videoDecoder); + SampleGrabber = (ISampleGrabber)sampleGrabber; + //IBaseFilter videoRenderer = AddRenderer(graphBuilder, sampleGrabber, handle); + IBaseFilter videoRenderer = AddSimpleRenderer(graphBuilder, sampleGrabber, handle); + FilterGraphTools.RenderPin(graphBuilder, sampleGrabber, "Output"); + ConfigureSimpleRenderer(handle); + + } else { + logger.Warn("Video pin not available"); + } if (DsFindPin.ByName(splitter, "Audio") != null) { IBaseFilter audioDecoder = AddAudioDecoder(graphBuilder, splitter); - FilterGraphTools.RenderPin(graphBuilder, audioDecoder, "Output"); + if (audioOnly) { + throw new Exception("Audio only file is not supported."); + //IBaseFilter sampleGrabber = AddSampleGrabber(graphBuilder, audioDecoder); + //SampleGrabber = (ISampleGrabber)sampleGrabber; + //FilterGraphTools.RenderPin(graphBuilder, sampleGrabber, "Output"); + } else + FilterGraphTools.RenderPin(graphBuilder, audioDecoder, "Output"); } else { logger.Warn("Audio pin not available"); } SearchAudioTracks(splitter); - EnableDeinterlace(videoDecoder); } catch (Exception e) { logger.Error(e.Message); @@ -80,29 +94,23 @@ namespace DxPlay { logger.Debug("Connect SampleGrabber -> VideoMixingRenderer9"); try { - IVMRFilterConfig9 filterConfig = (IVMRFilterConfig9) videoRenderer; - filterConfig.SetRenderingMode(VMR9Mode.Windowless); - WindowlessControl = (IVMRWindowlessControl9) videoRenderer; - WindowlessControl.SetVideoClippingWindow(handle); - //VideoWindow = (IVideoWindow) filterConfig; - //FilterGraphTools.ConnectFilters(graphBuilder, sampleGrabber, "Output", videoRenderer, "VMR Input0", true); - + //IVMRFilterConfig9 filterConfig = (IVMRFilterConfig9) videoRenderer; + //filterConfig.SetRenderingMode(VMR9Mode.Windowless); + //WindowlessControl = (IVMRWindowlessControl9) videoRenderer; + //WindowlessControl.SetVideoClippingWindow(handle); + //WindowlessControl.SetAspectRatioMode(VMR9AspectRatioMode.LetterBox); + FilterGraphTools.ConnectFilters(graphBuilder, sampleGrabber, "Output", videoRenderer, "VMR Input0", true); } catch (Exception e) { logger.Error(e); graphBuilder.RemoveFilter(videoRenderer); logger.Info("Trying default VideoRenderer instead Video Mixing Renderer 9"); AddSimpleRenderer(graphBuilder, sampleGrabber, handle); } + return videoRenderer; } - private IBaseFilter AddSimpleRenderer(IGraphBuilder graphBuilder, IBaseFilter sampleGrabber, IntPtr handle) { - logger.Debug("Add default VideoRenderer to graph"); - IBaseFilter videoRenderer = (IBaseFilter)new VideoRendererDefault(); - DsError.ThrowExceptionForHR(graphBuilder.AddFilter(videoRenderer, "VideoRendererDefault")); - FilterGraphTools.ConnectFilters(graphBuilder, sampleGrabber, "Output", videoRenderer, "VMR Input0", true); - VideoWindow = (IVideoWindow)videoRenderer; - + private void ConfigureSimpleRenderer(IntPtr handle) { // Set the output window int hr; @@ -119,7 +127,13 @@ namespace DxPlay { // Make the window visible hr = VideoWindow.put_Visible(OABool.True); DsError.ThrowExceptionForHR(hr); + } + private IBaseFilter AddSimpleRenderer(IGraphBuilder graphBuilder, IBaseFilter sampleGrabber, IntPtr handle) { + logger.Debug("Add default VideoRenderer to graph"); + IBaseFilter videoRenderer = (IBaseFilter)new VideoRendererDefault(); + DsError.ThrowExceptionForHR(graphBuilder.AddFilter(videoRenderer, "VideoRendererDefault")); + //FilterGraphTools.ConnectFilters(graphBuilder, sampleGrabber, "Output", videoRenderer, "VMR Input0", true); return videoRenderer; } @@ -157,8 +171,7 @@ namespace DxPlay { private void SearchAudioTracks(IBaseFilter splitter) { IAMStreamSelect amStreamSelect = (IAMStreamSelect)splitter; if (amStreamSelect != null) { - int count = 0; - amStreamSelect.Count(out count); + amStreamSelect.Count(out int count); int audioCount = 0; for (int i = 0; i < count; i++) { amStreamSelect.Info(i, out AMMediaType ppmt, out AMStreamSelectInfoFlags pdwFlags, out int plcid, out int pdwGroup, out string ppszName, out object ppObject, out object ppUnk); diff --git a/client/DxPlay/Program.cs b/client/DxPlay/Program.cs index d885389d..67c37c12 100644 --- a/client/DxPlay/Program.cs +++ b/client/DxPlay/Program.cs @@ -21,21 +21,11 @@ namespace Maestro { LoadSettings(playerForm); if (playerForm.Settings == null) playerForm.Settings = new DxPlaySettings(); - if (ProcessCommandLine(playerForm)) - return; + //if (ProcessCommandLine(playerForm)) + // return; Application.Run(playerForm); } - private static bool ProcessCommandLine(PlayerForm playerForm) { - String[] arguments = Environment.GetCommandLineArgs(); - if (arguments.Length > 1) { - FileInfo fi = new FileInfo(arguments[1]); - if (fi.Exists) - playerForm.OpenFile(fi); - } - return playerForm.IsDisposed; - } - private static void LoadSettings(PlayerForm playerForm) { try { FileInfo dxPlayConfig = new FileInfo(ConfigurationSerializer.Combine(DXPLAY_FILE)); diff --git a/client/DxPlay/Properties/AssemblyInfo.cs b/client/DxPlay/Properties/AssemblyInfo.cs index 3c7bdc6f..f0f736d4 100644 --- a/client/DxPlay/Properties/AssemblyInfo.cs +++ b/client/DxPlay/Properties/AssemblyInfo.cs @@ -26,7 +26,7 @@ using System.Runtime.CompilerServices; // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("2.0.8.2")] +[assembly: AssemblyVersion("2.0.8.4")] // // In order to sign your assembly you must specify a key to use. Refer to the @@ -56,5 +56,5 @@ using System.Runtime.CompilerServices; [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: AssemblyKeyName("")] -[assembly: AssemblyFileVersion("2.0.8.2")] +[assembly: AssemblyFileVersion("2.0.8.4")] diff --git a/client/DxPlay/Properties/Resources.Designer.cs b/client/DxPlay/Properties/Resources.Designer.cs index abcb81c9..6ede38cf 100644 --- a/client/DxPlay/Properties/Resources.Designer.cs +++ b/client/DxPlay/Properties/Resources.Designer.cs @@ -219,7 +219,7 @@ namespace DxPlay.Properties { } /// - /// Looks up a localized string similar to Előre csévélés. + /// Looks up a localized string similar to Előre csévélés (Ctrl + >). /// internal static string FORWARD { get { @@ -331,7 +331,7 @@ namespace DxPlay.Properties { } /// - /// Looks up a localized string similar to Szünet. + /// Looks up a localized string similar to Szünet (Szóköz). /// internal static string PAUSE { get { @@ -349,7 +349,7 @@ namespace DxPlay.Properties { } /// - /// Looks up a localized string similar to Lejátszás. + /// Looks up a localized string similar to Lejátszás (Szóköz). /// internal static string PLAY { get { @@ -385,7 +385,7 @@ namespace DxPlay.Properties { } /// - /// Looks up a localized string similar to Hátra csévélés. + /// Looks up a localized string similar to Hátra csévélés (Ctrl + <). /// internal static string REWIND { get { @@ -420,6 +420,24 @@ namespace DxPlay.Properties { } } + /// + /// Looks up a localized string similar to Vissza léptetés (<). + /// + internal static string STEPBACK { + get { + return ResourceManager.GetString("STEPBACK", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Előre léptetés (>). + /// + internal static string STEPFORWARD { + get { + return ResourceManager.GetString("STEPFORWARD", resourceCulture); + } + } + /// /// Looks up a localized string similar to Leállítás. /// diff --git a/client/DxPlay/Properties/Resources.resx b/client/DxPlay/Properties/Resources.resx index ae390899..258c9ba4 100644 --- a/client/DxPlay/Properties/Resources.resx +++ b/client/DxPlay/Properties/Resources.resx @@ -131,7 +131,7 @@ NINCS BEMENET - Lejátszás + Lejátszás (Szóköz) Metaadat @@ -161,7 +161,7 @@ ..\resources\lgs.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - Szünet + Szünet (Szóköz) Aktuális pozíció belépőként @@ -242,9 +242,15 @@ ..\Resources\baseline_fast_rewind_black_24dp1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - Előre csévélés + Előre csévélés (Ctrl + >) - Hátra csévélés + Hátra csévélés (Ctrl + <) + + + Vissza léptetés (<) + + + Előre léptetés (>) \ No newline at end of file diff --git a/client/Maestro/Configuration/configuration-nle.json b/client/Maestro/Configuration/configuration-nle.json index 4040a89d..cacd30fe 100644 --- a/client/Maestro/Configuration/configuration-nle.json +++ b/client/Maestro/Configuration/configuration-nle.json @@ -187,8 +187,10 @@ "outputFormat": "%ID%", "tag": "Archiválás", "saveArchiveMetadata": true, + "deleteAfterCopy": true, + "temporaryCopy": true, "remote": { - "address": "ftp://10.10.1.100/ARCHIVE", + "address": "ftp://10.10.1.100/ARCHIVE/ONE", "userName": "mediacube", "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy", "timeout": 1000 diff --git a/client/MaestroShared/Configuration/ConfigurationInfo.cs b/client/MaestroShared/Configuration/ConfigurationInfo.cs index df846994..9d0ebeba 100644 --- a/client/MaestroShared/Configuration/ConfigurationInfo.cs +++ b/client/MaestroShared/Configuration/ConfigurationInfo.cs @@ -183,6 +183,9 @@ namespace MaestroShared.Configuration { public class NativeOctopusMetadata : MetadataProvider { } + public class FreeMetadata : MetadataProvider { + } + public class TrafficMetadata : MetadataProvider { public ProjectSettings ProjectSettings { get; set; } public string FunctionName { get; set; } diff --git a/client/MaestroShared/Properties/AssemblyInfo.cs b/client/MaestroShared/Properties/AssemblyInfo.cs index 444c2585..53dd2457 100644 --- a/client/MaestroShared/Properties/AssemblyInfo.cs +++ b/client/MaestroShared/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.8.5")] -[assembly: AssemblyFileVersion("2.0.8.5")] +[assembly: AssemblyVersion("2.0.8.6")] +[assembly: AssemblyFileVersion("2.0.8.6")] diff --git a/client/MetadataSelector/MetadataIDSelector.Designer.cs b/client/MetadataSelector/MetadataIDSelector.Designer.cs index dfa74a37..4e018a70 100644 --- a/client/MetadataSelector/MetadataIDSelector.Designer.cs +++ b/client/MetadataSelector/MetadataIDSelector.Designer.cs @@ -31,6 +31,9 @@ this.nativeOctopusIDSelector = new NativeOctopusClient.NativeOctopusIDSelector(); this.tpTraffic = new System.Windows.Forms.TabPage(); this.trafficIDSelector = new TrafficClient.TrafficIDSelector(); + this.tpFree = new System.Windows.Forms.TabPage(); + this.txtID = new System.Windows.Forms.TextBox(); + this.lName = new System.Windows.Forms.Label(); this.pMetadataDisplay = new System.Windows.Forms.TableLayoutPanel(); this.btnLookupMetadata = new System.Windows.Forms.Button(); this.labelSelectedMetadata = new System.Windows.Forms.Label(); @@ -39,6 +42,7 @@ this.tpOctopus.SuspendLayout(); this.tpNativeOctopus.SuspendLayout(); this.tpTraffic.SuspendLayout(); + this.tpFree.SuspendLayout(); this.pMetadataDisplay.SuspendLayout(); this.SuspendLayout(); // @@ -47,6 +51,7 @@ this.tabMetadata.Controls.Add(this.tpOctopus); this.tabMetadata.Controls.Add(this.tpNativeOctopus); this.tabMetadata.Controls.Add(this.tpTraffic); + this.tabMetadata.Controls.Add(this.tpFree); this.tabMetadata.Dock = System.Windows.Forms.DockStyle.Fill; this.tabMetadata.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.tabMetadata.Location = new System.Drawing.Point(0, 0); @@ -119,6 +124,36 @@ this.trafficIDSelector.Size = new System.Drawing.Size(359, 422); this.trafficIDSelector.TabIndex = 0; // + // tpFree + // + this.tpFree.Controls.Add(this.txtID); + this.tpFree.Controls.Add(this.lName); + this.tpFree.Location = new System.Drawing.Point(4, 24); + this.tpFree.Name = "tpFree"; + this.tpFree.Padding = new System.Windows.Forms.Padding(3); + this.tpFree.Size = new System.Drawing.Size(365, 428); + this.tpFree.TabIndex = 3; + this.tpFree.Text = "Free"; + this.tpFree.UseVisualStyleBackColor = true; + // + // txtID + // + this.txtID.Dock = System.Windows.Forms.DockStyle.Top; + this.txtID.Location = new System.Drawing.Point(3, 18); + this.txtID.Name = "txtID"; + this.txtID.Size = new System.Drawing.Size(359, 21); + this.txtID.TabIndex = 1; + // + // lName + // + this.lName.AutoSize = true; + this.lName.Dock = System.Windows.Forms.DockStyle.Top; + this.lName.Location = new System.Drawing.Point(3, 3); + this.lName.Name = "lName"; + this.lName.Size = new System.Drawing.Size(19, 15); + this.lName.TabIndex = 0; + this.lName.Text = "ID"; + // // pMetadataDisplay // this.pMetadataDisplay.AutoSize = true; @@ -194,6 +229,8 @@ this.tpNativeOctopus.ResumeLayout(false); this.tpTraffic.ResumeLayout(false); this.tpTraffic.PerformLayout(); + this.tpFree.ResumeLayout(false); + this.tpFree.PerformLayout(); this.pMetadataDisplay.ResumeLayout(false); this.pMetadataDisplay.PerformLayout(); this.ResumeLayout(false); @@ -214,5 +251,8 @@ private TrafficClient.TrafficIDSelector trafficIDSelector; private System.Windows.Forms.TabPage tpNativeOctopus; private NativeOctopusClient.NativeOctopusIDSelector nativeOctopusIDSelector; + private System.Windows.Forms.TabPage tpFree; + private System.Windows.Forms.TextBox txtID; + private System.Windows.Forms.Label lName; } } diff --git a/client/MetadataSelector/MetadataIDSelector.cs b/client/MetadataSelector/MetadataIDSelector.cs index ce2f3b1e..a37ae9c0 100644 --- a/client/MetadataSelector/MetadataIDSelector.cs +++ b/client/MetadataSelector/MetadataIDSelector.cs @@ -23,6 +23,7 @@ namespace MaestroShared.Controls { private MetadataProvider[] providers; public TextBox MetadataIDText { get => textSelectedMetadata; } + public TextBox FreeIDText { get => txtID; } public OctopusIDSelector OctopusIDSelector { get => octopusIDSelector; } public NativeOctopusIDSelector NativeOctopusIDSelector { get => nativeOctopusIDSelector; } public TrafficIDSelector TrafficIDSelector { get => trafficIDSelector; } @@ -36,6 +37,7 @@ namespace MaestroShared.Controls { InitializeTrafficSelector(); InitializeOctopusSelector(); InitializeNativeOctopusSelector(); + InitializeFreeSelector(); } } @@ -74,6 +76,27 @@ namespace MaestroShared.Controls { trafficIDSelector.IDChangedEvent += TrafficIDChangedEvent; } + private void InitializeFreeSelector() { + FreeMetadata freeConfiguration = MetadataProvider.Get(Providers); + if (freeConfiguration == null) { + tabMetadata.TabPages.Remove(tpFree); + return; + } + + txtID.TextChanged += OnFreeMetadataChanged; + } + + private void ClearFreeMetadata() { + txtID.Text = ""; + } + + private void OnFreeMetadataChanged(object sender, EventArgs e) { + octopusIDSelector.ClearSelection(); + trafficIDSelector.ClearSelection(); + nativeOctopusIDSelector.ClearSelection(); + + } + private void InitializeOctopusSelector() { OctopusMetadata octopusConfiguration = MetadataProvider.Get(Providers); if (octopusConfiguration == null) { @@ -105,18 +128,21 @@ namespace MaestroShared.Controls { private void OctopusIDChangedEvent(string id, string name, string text) { trafficIDSelector.ClearSelection(); nativeOctopusIDSelector.ClearSelection(); + ClearFreeMetadata(); textSelectedMetadata.Text = name; } private void NativeOctopusIDChangedEvent(string id, string name, string text) { octopusIDSelector.ClearSelection(); trafficIDSelector.ClearSelection(); + ClearFreeMetadata(); textSelectedMetadata.Text = name; } private void TrafficIDChangedEvent(string id, int variantID, string text) { octopusIDSelector.ClearSelection(); nativeOctopusIDSelector.ClearSelection(); + ClearFreeMetadata(); textSelectedMetadata.Text = id; } diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/CleanupMountedLocationStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/CleanupMountedLocationStep.java index 0921586c..99c26650 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/CleanupMountedLocationStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/CleanupMountedLocationStep.java @@ -183,8 +183,10 @@ public class CleanupMountedLocationStep extends JobStep implements FileVisitor

killDateFiles = getKillDateFiles(filePath); - if (killDateFiles.size() == 0) + if (killDateFiles.size() == 0) { + logger.warn(marker, "A {} fájlhoz nem található 'killdate' állomány.", filePath); return; + } if (killDateFiles.size() != 1) logger.warn(marker, "A {} fájlhoz több 'killdate' állomány található, a legújabb dátum határozza meg a törlés időpontját.", filePath);