From 22070a7102a560ffcb42374ef4be9097aaece291 Mon Sep 17 00:00:00 2001 From: Sweidan Omar Date: Mon, 17 Jan 2022 12:35:54 +0000 Subject: [PATCH] #310 git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C32750 --- .../Controls/PlayerControls.Designer.cs | 85 +++++++++---------- client/DxPlay/Controls/PlayerControls.cs | 44 +--------- 2 files changed, 42 insertions(+), 87 deletions(-) diff --git a/client/DxPlay/Controls/PlayerControls.Designer.cs b/client/DxPlay/Controls/PlayerControls.Designer.cs index a502c504..440670cb 100644 --- a/client/DxPlay/Controls/PlayerControls.Designer.cs +++ b/client/DxPlay/Controls/PlayerControls.Designer.cs @@ -47,9 +47,9 @@ this.btnStop = new MaestroShared.Controls.NoFocusCueButton(); this.btnStepForward = new MaestroShared.Controls.NoFocusCueButton(); this.btnForward = new MaestroShared.Controls.NoFocusCueButton(); + this.playSpeed = new DxPlay.Controls.VideoSpeedTrackbar(); this.lblPlaySpeed = new System.Windows.Forms.Label(); this.logoPanel = new System.Windows.Forms.Panel(); - this.playSpeed = new DxPlay.Controls.VideoSpeedTrackbar(); this.mainPanel.SuspendLayout(); this.timecodePanel.SuspendLayout(); this.controlsPanel.SuspendLayout(); @@ -106,9 +106,9 @@ // this.timecodePanel.AutoSize = true; this.timecodePanel.ColumnCount = 3; - this.timecodePanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); - this.timecodePanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 42.22821F)); - this.timecodePanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 37.8257F)); + this.timecodePanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 26.32525F)); + this.timecodePanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 46.63073F)); + this.timecodePanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 26.95418F)); this.timecodePanel.Controls.Add(this.lbCurrentTC, 0, 1); this.timecodePanel.Controls.Add(this.lbStartTC, 0, 1); this.timecodePanel.Controls.Add(this.lbStart, 0, 0); @@ -132,10 +132,10 @@ | System.Windows.Forms.AnchorStyles.Right))); this.lbCurrentTC.BackColor = System.Drawing.Color.Transparent; 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(226, 16); + this.lbCurrentTC.Location = new System.Drawing.Point(297, 16); this.lbCurrentTC.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbCurrentTC.Name = "lbCurrentTC"; - this.lbCurrentTC.Size = new System.Drawing.Size(461, 33); + this.lbCurrentTC.Size = new System.Drawing.Size(511, 33); this.lbCurrentTC.TabIndex = 25; this.lbCurrentTC.Text = "00:00:00.00"; this.lbCurrentTC.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -149,7 +149,7 @@ this.lbStartTC.Location = new System.Drawing.Point(4, 16); this.lbStartTC.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbStartTC.Name = "lbStartTC"; - this.lbStartTC.Size = new System.Drawing.Size(214, 21); + this.lbStartTC.Size = new System.Drawing.Size(285, 21); this.lbStartTC.TabIndex = 23; this.lbStartTC.Text = "00:00:00.00"; // @@ -161,7 +161,7 @@ this.lbStart.Location = new System.Drawing.Point(4, 0); this.lbStart.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbStart.Name = "lbStart"; - this.lbStart.Size = new System.Drawing.Size(214, 16); + this.lbStart.Size = new System.Drawing.Size(285, 16); this.lbStart.TabIndex = 19; this.lbStart.Text = "START"; this.lbStart.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -171,10 +171,10 @@ this.lbStatus.BackColor = System.Drawing.Color.Transparent; this.lbStatus.Dock = System.Windows.Forms.DockStyle.Top; this.lbStatus.Font = new System.Drawing.Font("Calibri", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.lbStatus.Location = new System.Drawing.Point(226, 0); + this.lbStatus.Location = new System.Drawing.Point(297, 0); this.lbStatus.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbStatus.Name = "lbStatus"; - this.lbStatus.Size = new System.Drawing.Size(461, 16); + this.lbStatus.Size = new System.Drawing.Size(511, 16); this.lbStatus.TabIndex = 21; this.lbStatus.Text = "NO INPUT"; this.lbStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -184,10 +184,10 @@ this.lbDuration.BackColor = System.Drawing.Color.Transparent; this.lbDuration.Dock = System.Windows.Forms.DockStyle.Top; this.lbDuration.Font = new System.Drawing.Font("Calibri", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.lbDuration.Location = new System.Drawing.Point(695, 0); + this.lbDuration.Location = new System.Drawing.Point(816, 0); this.lbDuration.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbDuration.Name = "lbDuration"; - this.lbDuration.Size = new System.Drawing.Size(414, 16); + this.lbDuration.Size = new System.Drawing.Size(293, 16); this.lbDuration.TabIndex = 22; this.lbDuration.Text = "DURATION"; this.lbDuration.TextAlign = System.Drawing.ContentAlignment.MiddleRight; @@ -198,10 +198,10 @@ this.lbEndTC.Dock = System.Windows.Forms.DockStyle.Top; this.lbEndTC.Font = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.lbEndTC.ForeColor = System.Drawing.SystemColors.WindowText; - this.lbEndTC.Location = new System.Drawing.Point(695, 16); + this.lbEndTC.Location = new System.Drawing.Point(816, 16); this.lbEndTC.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbEndTC.Name = "lbEndTC"; - this.lbEndTC.Size = new System.Drawing.Size(414, 21); + this.lbEndTC.Size = new System.Drawing.Size(293, 21); this.lbEndTC.TabIndex = 24; this.lbEndTC.Text = "00:00:00.00"; this.lbEndTC.TextAlign = System.Drawing.ContentAlignment.MiddleRight; @@ -228,19 +228,19 @@ this.buttonsPanel.AutoSize = true; this.buttonsPanel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.buttonsPanel.Controls.Add(this.btnPlay); + this.buttonsPanel.Controls.Add(this.playSpeed); + this.buttonsPanel.Controls.Add(this.lblPlaySpeed); this.buttonsPanel.Controls.Add(this.btnPause); 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.Controls.Add(this.playSpeed); - this.buttonsPanel.Controls.Add(this.lblPlaySpeed); 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(866, 126); + this.buttonsPanel.Size = new System.Drawing.Size(730, 126); this.buttonsPanel.TabIndex = 20; // // btnPlay @@ -268,7 +268,7 @@ this.btnPause.FlatAppearance.BorderSize = 0; this.btnPause.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnPause.Image = global::DxPlay.Properties.Resources.ic_pause_black_24dp_2x; - this.btnPause.Location = new System.Drawing.Point(84, 4); + this.btnPause.Location = new System.Drawing.Point(254, 4); this.btnPause.Margin = new System.Windows.Forms.Padding(4); this.btnPause.Name = "btnPause"; this.btnPause.Size = new System.Drawing.Size(72, 66); @@ -285,7 +285,7 @@ this.btnRewind.FlatAppearance.BorderSize = 0; this.btnRewind.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnRewind.Image = ((System.Drawing.Image)(resources.GetObject("btnRewind.Image"))); - this.btnRewind.Location = new System.Drawing.Point(164, 4); + this.btnRewind.Location = new System.Drawing.Point(334, 4); this.btnRewind.Margin = new System.Windows.Forms.Padding(4); this.btnRewind.Name = "btnRewind"; this.btnRewind.Size = new System.Drawing.Size(72, 66); @@ -302,7 +302,7 @@ 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(244, 4); + this.btnStepBack.Location = new System.Drawing.Point(414, 4); this.btnStepBack.Margin = new System.Windows.Forms.Padding(4); this.btnStepBack.Name = "btnStepBack"; this.btnStepBack.Size = new System.Drawing.Size(72, 66); @@ -319,7 +319,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(324, 4); + this.btnStop.Location = new System.Drawing.Point(494, 4); this.btnStop.Margin = new System.Windows.Forms.Padding(4); this.btnStop.Name = "btnStop"; this.btnStop.Size = new System.Drawing.Size(72, 66); @@ -336,7 +336,7 @@ 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(404, 4); + this.btnStepForward.Location = new System.Drawing.Point(574, 4); this.btnStepForward.Margin = new System.Windows.Forms.Padding(4); this.btnStepForward.Name = "btnStepForward"; this.btnStepForward.Size = new System.Drawing.Size(72, 66); @@ -353,7 +353,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(484, 4); + this.btnForward.Location = new System.Drawing.Point(654, 4); this.btnForward.Margin = new System.Windows.Forms.Padding(4); this.btnForward.Name = "btnForward"; this.btnForward.Size = new System.Drawing.Size(72, 66); @@ -362,14 +362,28 @@ this.btnForward.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.btnForward.UseVisualStyleBackColor = false; // + // playSpeed + // + this.playSpeed.CurrentSpeed = 0F; + this.playSpeed.LargeChange = 1; + this.playSpeed.Location = new System.Drawing.Point(83, 3); + this.playSpeed.Maximum = 5; + this.playSpeed.Minimum = 0; + this.playSpeed.Name = "playSpeed"; + this.playSpeed.Size = new System.Drawing.Size(136, 56); + this.playSpeed.TabIndex = 26; + this.playSpeed.Tag = "PlaySpeed"; + this.playSpeed.TickStyle = System.Windows.Forms.TickStyle.None; + this.playSpeed.Value = 2; + // // lblPlaySpeed // this.lblPlaySpeed.AutoSize = true; - this.lblPlaySpeed.Location = new System.Drawing.Point(705, 0); + this.lblPlaySpeed.Location = new System.Drawing.Point(225, 0); this.lblPlaySpeed.Name = "lblPlaySpeed"; - this.lblPlaySpeed.Size = new System.Drawing.Size(158, 17); + this.lblPlaySpeed.Size = new System.Drawing.Size(22, 17); this.lblPlaySpeed.TabIndex = 27; - this.lblPlaySpeed.Text = "Lejátszási sebesség: 1x"; + this.lblPlaySpeed.Text = "x1"; // // logoPanel // @@ -383,25 +397,6 @@ this.logoPanel.Size = new System.Drawing.Size(232, 126); this.logoPanel.TabIndex = 21; // - // playSpeed - // - this.playSpeed.AvailableSpeeds = new float[] { - 0.25F, - 0.5F, - 1F, - 2F, - 3F, - 5F}; - this.playSpeed.CurrentSpeed = 0F; - this.playSpeed.Location = new System.Drawing.Point(563, 3); - this.playSpeed.Maximum = 5; - this.playSpeed.Minimum = 0; - this.playSpeed.Name = "playSpeed"; - this.playSpeed.Size = new System.Drawing.Size(136, 56); - this.playSpeed.TabIndex = 26; - this.playSpeed.Value = 2; - this.playSpeed.ValueChanged += new System.EventHandler(this.OnPlaySpeedChanged); - // // PlayerControls // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); diff --git a/client/DxPlay/Controls/PlayerControls.cs b/client/DxPlay/Controls/PlayerControls.cs index 84cc04b6..ab447e9d 100644 --- a/client/DxPlay/Controls/PlayerControls.cs +++ b/client/DxPlay/Controls/PlayerControls.cs @@ -29,48 +29,8 @@ namespace DxPlay.Controls public NoFocusCueButton Forward { get => btnForward; } public NoFocusCueButton StepBack { get => btnStepBack; } public NoFocusCueButton StepForward { get => btnStepForward; } + public Label PlaySpeedLabel { get => lblPlaySpeed; } + public VideoSpeedTrackbar PlaySpeed { get => playSpeed; } - private void onPlaySpeedChanged(object sender, System.EventArgs e) - { - logger.Info(sender); - switch (((VideoSpeedTrackbar)sender).Value) - { - case 1: - ((VideoSpeedTrackbar)sender).CurrentSpeed = 0.25F; - setVideoSpeed(); - lblPlaySpeed.Text = "Lejátszási sebesség: 0.25x"; - break; - case 2: - ((VideoSpeedTrackbar)sender).CurrentSpeed = 0.5F; - setVideoSpeed(); - lblPlaySpeed.Text = "Lejátszási sebesség: 0.5x"; - break; - case 3: - ((VideoSpeedTrackbar)sender).CurrentSpeed = 1F; - setVideoSpeed(); - lblPlaySpeed.Text = "Lejátszási sebesség: 1x"; - break; - case 4: - ((VideoSpeedTrackbar)sender).CurrentSpeed = 2F; - setVideoSpeed(); - lblPlaySpeed.Text = "Lejátszási sebesség: 2x"; - break; - case 5: - ((VideoSpeedTrackbar)sender).CurrentSpeed = 3F; - setVideoSpeed(); - lblPlaySpeed.Text = "Lejátszási sebesség: 3x"; - break; - case 6: - ((VideoSpeedTrackbar)sender).CurrentSpeed = 5F; - setVideoSpeed(); - lblPlaySpeed.Text = "Lejátszási sebesség: 5x"; - break; - } - } - - private void setVideoSpeed() - { - //throw new NotImplementedException(); - } } } \ No newline at end of file -- 2.54.0