diff --git a/Langs/Strings.ar-SA.resx b/Langs/Strings.ar-SA.resx index 6d3baf9..f0707e3 100644 --- a/Langs/Strings.ar-SA.resx +++ b/Langs/Strings.ar-SA.resx @@ -220,7 +220,7 @@ معدل الإطار فيديو - شاشة أو محدد منطقة + محدد الشاشة اللغات @@ -277,4 +277,7 @@ TutorialesVbNET FFmpeg NAudio و Flaticon. الصوت النظام والميكروفون + + تسجيل منطقة مخصصة + \ No newline at end of file diff --git a/Langs/Strings.de-DE.Designer.cs b/Langs/Strings.de-DE.Designer.cs index 6647c4d..ff1f3f8 100644 --- a/Langs/Strings.de-DE.Designer.cs +++ b/Langs/Strings.de-DE.Designer.cs @@ -450,12 +450,6 @@ internal static string labelMonitorSelector return ResourceManager.GetString("labelMonitorSelector", resourceCulture); } } - internal static string radioButtonCustomArea - { - get - { - return ResourceManager.GetString("radioButtonCustomArea", resourceCulture); - } - } + } } diff --git a/Langs/Strings.de-DE.resx b/Langs/Strings.de-DE.resx index 8ecba05..6204065 100644 --- a/Langs/Strings.de-DE.resx +++ b/Langs/Strings.de-DE.resx @@ -223,7 +223,7 @@ Originalautor: Lextrack. Bilder pro Sekunde - Monitor oder Bereichswähler + Monitorauswahl Sprachen @@ -281,4 +281,7 @@ TutorialesVbNET, FFmpeg, NAudio und Flaticon. Systemsound und Mikrofonaudio + + Benutzerdefinierten Bereich aufzeichnen + \ No newline at end of file diff --git a/Langs/Strings.en-US.Designer.cs b/Langs/Strings.en-US.Designer.cs index 82a091b..cec49b1 100644 --- a/Langs/Strings.en-US.Designer.cs +++ b/Langs/Strings.en-US.Designer.cs @@ -547,5 +547,13 @@ internal static string DesktopAudio } } + internal static string ButtonCustomArea + { + get + { + return ResourceManager.GetString("ButtonCustomArea", resourceCulture); + } + } + } } diff --git a/Langs/Strings.en-US.resx b/Langs/Strings.en-US.resx index 409b83c..66185a5 100644 --- a/Langs/Strings.en-US.resx +++ b/Langs/Strings.en-US.resx @@ -220,7 +220,7 @@ Original author: Lextrack. Video framerate - Monitor or area selector + Monitor selector Languages @@ -277,7 +277,7 @@ TutorialesVbNET, FFmpeg, NAudio and Flaticon. System sound and microphone audio - - pruebaaaa + + Record a custom area \ No newline at end of file diff --git a/Langs/Strings.es-ES.Designer.cs b/Langs/Strings.es-ES.Designer.cs index 5a28a00..fb0e331 100644 --- a/Langs/Strings.es-ES.Designer.cs +++ b/Langs/Strings.es-ES.Designer.cs @@ -372,5 +372,12 @@ internal static string labelCodec return ResourceManager.GetString("labelCodec", resourceCulture); } } + internal static string ButtonCustomArea + { + get + { + return ResourceManager.GetString("ButtonCustomArea", resourceCulture); + } + } } } diff --git a/Langs/Strings.es-ES.resx b/Langs/Strings.es-ES.resx index ec8a1ee..ef7aad1 100644 --- a/Langs/Strings.es-ES.resx +++ b/Langs/Strings.es-ES.resx @@ -220,7 +220,7 @@ Autor original: Lextrack. Fotogramas por segundo - Monitor o selector de área + Selector de monitor Idiomas @@ -277,4 +277,7 @@ TutorialesVbNET, FFmpeg, NAudio y Flaticon. Audio del sistema y micrófono + + Grabar un área personalizada + \ No newline at end of file diff --git a/Langs/Strings.fr-FR.resx b/Langs/Strings.fr-FR.resx index 3c1008d..7a04ff0 100644 --- a/Langs/Strings.fr-FR.resx +++ b/Langs/Strings.fr-FR.resx @@ -223,7 +223,7 @@ Auteur original : Lextrack. Fréquence d'images - Moniteur ou sélecteur de zone + Sélecteur de moniteur Langues @@ -281,4 +281,7 @@ TutorialesVbNET, FFmpeg, NAudio et Flaticon. Son système et audio du microphone + + Enregistrer une zone personnalisée + \ No newline at end of file diff --git a/Langs/Strings.it-IT.resx b/Langs/Strings.it-IT.resx index d916901..8ed0faf 100644 --- a/Langs/Strings.it-IT.resx +++ b/Langs/Strings.it-IT.resx @@ -220,7 +220,7 @@ Autore originale: Lextrack. Frequenza fotogrammi video - Monitor o selettore di area + Selettore monitor Lingua UI @@ -277,4 +277,7 @@ TutorialesVbNET, FFmpeg, NAudio e Flaticon. Audio sistema e audio microfono + + Registrare un'area personalizzata + \ No newline at end of file diff --git a/Langs/Strings.ja-JP.resx b/Langs/Strings.ja-JP.resx index e39ecba..53330dd 100644 --- a/Langs/Strings.ja-JP.resx +++ b/Langs/Strings.ja-JP.resx @@ -220,7 +220,7 @@ ビデオフレームレート - モニターまたはエリアセレクター + モニターセレクター 言語 @@ -279,4 +279,7 @@ NAudio、FFmpeg、およびFlaticon システムサウンドとマイクロフォンオーディオ + + カスタムエリアを記録する + \ No newline at end of file diff --git a/Langs/Strings.pt-BR.resx b/Langs/Strings.pt-BR.resx index b52f595..0b91c1b 100644 --- a/Langs/Strings.pt-BR.resx +++ b/Langs/Strings.pt-BR.resx @@ -220,7 +220,7 @@ Autor original: Lextrack. Quadros por segundo - Monitor ou seletor de área + Seletor de tela Línguas @@ -277,4 +277,7 @@ TutorialesVbNET, FFmpeg, NAudio e Flaticon. Sistema de som e microfone de áudio + + Registre uma área personalizada + \ No newline at end of file diff --git a/Langs/Strings.uk-UA.resx b/Langs/Strings.uk-UA.resx index 6128ecf..c7c54cc 100644 --- a/Langs/Strings.uk-UA.resx +++ b/Langs/Strings.uk-UA.resx @@ -175,7 +175,7 @@ Виберіть відеофайл - Захоплення всіх моніторів одночасно + Захоплення всіх моніторів Налаштування відео @@ -224,7 +224,7 @@ Частота кадрів - Монітор або селектор області + Вибір монітора Мова @@ -283,4 +283,7 @@ TutorialesVbNET, FFmpeg, NAudio і Flaticon. Системний звук і звук мікрофона + + Запис користувацької області + \ No newline at end of file diff --git a/Langs/Strings.zh-CN.resx b/Langs/Strings.zh-CN.resx index 65f0487..44999e3 100644 --- a/Langs/Strings.zh-CN.resx +++ b/Langs/Strings.zh-CN.resx @@ -220,7 +220,7 @@ Windows 的开源屏幕和音频录制工具。 视频帧率 - 显示器或区域选择器 + 显示器选择器 语言 @@ -276,4 +276,7 @@ Windows 的开源屏幕和音频录制工具。 系统声音和话筒音频 + + 记录自定义区域 + \ No newline at end of file diff --git a/Simple-Screen-Recorder.csproj b/Simple-Screen-Recorder.csproj index 5b61396..860ce3b 100644 --- a/Simple-Screen-Recorder.csproj +++ b/Simple-Screen-Recorder.csproj @@ -9,11 +9,11 @@ enable Simple_Screen_Recorder.Program True - 1.3.2 + 1.3.3 Lextrack Lextrack - 1.3.2 - 1.3.2 + 1.3.3 + 1.3.3 screen recorder.png Resources\screen recorder.ico x64 @@ -37,7 +37,7 @@ - + diff --git a/UI/AboutForm.Designer.cs b/UI/AboutForm.Designer.cs index 7adfd2f..3c53a46 100644 --- a/UI/AboutForm.Designer.cs +++ b/UI/AboutForm.Designer.cs @@ -66,7 +66,7 @@ private void InitializeComponent() label3.Name = "label3"; label3.Size = new Size(151, 38); label3.TabIndex = 7; - label3.Text = "Simple Screen Recorder\r\nv1.3.2"; + label3.Text = "Simple Screen Recorder\r\nv1.3.3"; // // labelCopyright // diff --git a/UI/AreaSelector.cs b/UI/AreaSelector.cs index 009cacb..03d0bfe 100644 --- a/UI/AreaSelector.cs +++ b/UI/AreaSelector.cs @@ -20,7 +20,7 @@ public AreaSelector() Label guideLabel = new Label { - Text = "Click and drag to select an area. Release the click to finish.", + Text = "Click and drag to select an area. Release the button to finish and then press the start recording button.", ForeColor = Color.White, BackColor = Color.Black, AutoSize = false, @@ -67,7 +67,7 @@ private void AreaSelector_MouseUp(object sender, MouseEventArgs e) if (width < 10 || height < 10) { - MessageBox.Show("This selection is invalid, please try again.", "Confirm Selection"); + MessageBox.Show("This selection is invalid, please try again.", "Error"); startPoint = Point.Empty; endPoint = Point.Empty; this.Invalidate(); diff --git a/UI/RecorderScreenMainWindow.Designer.cs b/UI/RecorderScreenMainWindow.Designer.cs index 6861ea9..9131adb 100644 --- a/UI/RecorderScreenMainWindow.Designer.cs +++ b/UI/RecorderScreenMainWindow.Designer.cs @@ -52,6 +52,7 @@ private void InitializeComponent() labelCodec = new Label(); comboBoxCodec = new ReaLTaiizor.Controls.CrownComboBox(); crownGroupBox1 = new ReaLTaiizor.Controls.CrownGroupBox(); + ButtonCustomArea = new ReaLTaiizor.Controls.CrownButton(); comboBoxBitrate = new ReaLTaiizor.Controls.CrownComboBox(); RefreshMonitors = new ReaLTaiizor.Controls.CrownButton(); labelMonitorSelector = new Label(); @@ -260,6 +261,7 @@ private void InitializeComponent() // crownGroupBox1 // crownGroupBox1.BorderColor = Color.Gray; + crownGroupBox1.Controls.Add(ButtonCustomArea); crownGroupBox1.Controls.Add(comboBoxBitrate); crownGroupBox1.Controls.Add(RefreshMonitors); crownGroupBox1.Controls.Add(labelMonitorSelector); @@ -279,6 +281,16 @@ private void InitializeComponent() crownGroupBox1.TabStop = false; crownGroupBox1.Text = "Video settings"; // + // ButtonCustomArea + // + ButtonCustomArea.Font = new Font("Segoe UI", 8.25F); + ButtonCustomArea.Location = new Point(230, 127); + ButtonCustomArea.Name = "ButtonCustomArea"; + ButtonCustomArea.Padding = new Padding(5); + ButtonCustomArea.Size = new Size(203, 23); + ButtonCustomArea.TabIndex = 7; + ButtonCustomArea.Click += ButtonCustomArea_Click; + // // comboBoxBitrate // comboBoxBitrate.DrawMode = DrawMode.OwnerDrawVariable; @@ -287,7 +299,7 @@ private void InitializeComponent() comboBoxBitrate.Location = new Point(372, 99); comboBoxBitrate.Name = "comboBoxBitrate"; comboBoxBitrate.Size = new Size(61, 23); - comboBoxBitrate.TabIndex = 7; + comboBoxBitrate.TabIndex = 11; // // RefreshMonitors // @@ -710,5 +722,6 @@ private void InitializeComponent() private ToolStripMenuItem العربيةToolStripMenuItem; private ToolStripMenuItem aboutToolStripMenuItem; private MenuStrip menuStrip1; + private ReaLTaiizor.Controls.CrownButton ButtonCustomArea; } } \ No newline at end of file diff --git a/UI/RecorderScreenMainWindow.cs b/UI/RecorderScreenMainWindow.cs index 2efd621..62e2b9c 100644 --- a/UI/RecorderScreenMainWindow.cs +++ b/UI/RecorderScreenMainWindow.cs @@ -18,8 +18,8 @@ public partial class RecorderScreenMainWindow private DateTime TimeRec = DateTime.MinValue; private string VideoName = ""; public static string ResourcePath = Path.Combine(Directory.GetCurrentDirectory(), @"FFmpegResources\ffmpeg"); - private RadioButton radioButtonCustomArea; - public int ProcessId { get; private set; } + private Rectangle? SelectedCustomArea = null; + private bool IsCustomAreaSelected = false; public RecorderScreenMainWindow() { @@ -35,20 +35,6 @@ private void InitializeForm() CreateOutputFolder(); SetKeyPreview(); LoadUserSettingsCombobox(); - RadioButtonArea(); - } - - private void RadioButtonArea() - { - radioButtonCustomArea = new RadioButton(); - radioButtonCustomArea.Text = "Record a custom area"; - radioButtonCustomArea.CheckedChanged += RadioButtonCustomArea_CheckedChanged; - } - - private void RadioButtonCustomArea_CheckedChanged(object sender, EventArgs e) - { - comboBoxMonitors.Enabled = !radioButtonCustomArea.Checked; - CheckBoxAllMonitors.Enabled = !radioButtonCustomArea.Checked; } private void Form1_Load(object sender, EventArgs e) @@ -93,17 +79,16 @@ private void InitializeComboBoxes() private void CheckMonitors() { - var monitorOptions = Screen.AllScreens.Select((screen, index) => + var monitorNames = Screen.AllScreens.Select((screen, index) => { var prefix = screen.Primary ? "Main monitor" : $"Monitor {index + 1}"; return $"{prefix} ({screen.Bounds.Width}x{screen.Bounds.Height})"; - }).ToList(); - - monitorOptions.Add("Record a custom area"); + }).ToArray(); - comboBoxMonitors.DataSource = monitorOptions; + comboBoxMonitors.DataSource = monitorNames; comboBoxMonitors.SelectedIndex = 0; } + private void RefreshMonitors_Click(object sender, EventArgs e) { CheckMonitors(); @@ -112,7 +97,44 @@ private void RefreshMonitors_Click(object sender, EventArgs e) private void CheckBoxAllMonitors_CheckedChanged(object sender, EventArgs e) { comboBoxMonitors.Enabled = !CheckBoxAllMonitors.Checked; + ButtonCustomArea.Enabled = !CheckBoxAllMonitors.Checked; if (CheckBoxAllMonitors.Checked) + { + comboBoxMonitors.SelectedIndex = 0; + ResetCustomAreaSelection(); + } + + } + + private void ButtonCustomArea_Click(object sender, EventArgs e) + { + using (var areaSelector = new AreaSelector()) + { + if (areaSelector.ShowDialog() == DialogResult.OK) + { + SelectedCustomArea = areaSelector.SelectedArea; + IsCustomAreaSelected = true; + + comboBoxMonitors.Enabled = false; + CheckBoxAllMonitors.Checked = false; + CheckBoxAllMonitors.Enabled = false; + comboBoxMonitors.Text = $"Custom Area ({SelectedCustomArea.Value.Width}x{SelectedCustomArea.Value.Height})"; + } + else + { + ResetCustomAreaSelection(); + } + } + } + + private void ResetCustomAreaSelection() + { + SelectedCustomArea = null; + IsCustomAreaSelected = false; + comboBoxMonitors.Enabled = !CheckBoxAllMonitors.Checked; + CheckBoxAllMonitors.Enabled = true; + ButtonCustomArea.Enabled = !CheckBoxAllMonitors.Checked; + if (!CheckBoxAllMonitors.Checked) { comboBoxMonitors.SelectedIndex = 0; } @@ -128,20 +150,10 @@ private async void btnStartRecording_Click(object sender, EventArgs e) { codecArgs = "-i desktop"; } - else if (comboBoxMonitors.SelectedItem.ToString() == "Record a custom area") + else if (IsCustomAreaSelected && SelectedCustomArea.HasValue) { - using (var areaSelector = new AreaSelector()) - { - if (areaSelector.ShowDialog() == DialogResult.OK) - { - Rectangle selectedArea = areaSelector.SelectedArea; - codecArgs = $"-video_size {selectedArea.Width}x{selectedArea.Height} -offset_x {selectedArea.Left} -offset_y {selectedArea.Top} -i desktop"; - } - else - { - return; - } - } + Rectangle area = SelectedCustomArea.Value; + codecArgs = $"-video_size {area.Width}x{area.Height} -offset_x {area.Left} -offset_y {area.Top} -i desktop"; } else { @@ -250,7 +262,7 @@ private void CheckFfmpegProcces() { process.CloseMainWindow(); - if (!process.WaitForExit(2000)) + if (!process.WaitForExit(3000)) { process.Kill(); process.WaitForExit(); @@ -290,6 +302,7 @@ private void BtnStop_Click(object sender, EventArgs e) LbTimer.Text = "00:00:00"; CountRecVideo.Enabled = false; StopRecordingProcess(); + ResetCustomAreaSelection(); } catch (Exception) @@ -395,7 +408,7 @@ private void BtnExit_Click(object sender, EventArgs e) } } - #region Some shit about UI + #region Enable/disableUI private void EnableElementsUI() { btnStartRecording.Enabled = true; @@ -409,7 +422,7 @@ private void EnableElementsUI() menuStrip1.Enabled = true; comboBoxBitrate.Enabled = true; comboBoxAudioSource.Enabled = true; - + ButtonCustomArea.Enabled = !CheckBoxAllMonitors.Checked; comboBoxMonitors.Enabled = !CheckBoxAllMonitors.Checked; } @@ -427,6 +440,7 @@ private void DisableElementsUI() menuStrip1.Enabled = false; comboBoxBitrate.Enabled = false; comboBoxAudioSource.Enabled = false; + ButtonCustomArea.Enabled = false; } #endregion @@ -461,6 +475,7 @@ private void GetTextsMain() labelFormat.Text = StringsEN.labelFormat; labelMonitorSelector.Text = StringsEN.labelMonitorSelector; btnMergedFiles.Text = StringsEN.btnMergedFiles; + ButtonCustomArea.Text = StringsEN.ButtonCustomArea; int selectedIndex = comboBoxAudioSource.SelectedIndex; comboBoxAudioSource.Items.Clear();