From 9cffb6c29285bab5499d9a0e14d313543c86ce84 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bellai=20=C3=81d=C3=A1m?= Date: Tue, 14 Nov 2017 14:25:14 +0000 Subject: [PATCH] git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C30727 --- client/AudioRecorder/MainForm.cs | 34 ++++++++++++++--------------- client/AudioRecorder/WavRecorder.cs | 9 ++++++++ 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/client/AudioRecorder/MainForm.cs b/client/AudioRecorder/MainForm.cs index 25c3423f..da07f89c 100644 --- a/client/AudioRecorder/MainForm.cs +++ b/client/AudioRecorder/MainForm.cs @@ -49,29 +49,29 @@ namespace AudioRecorder { if (selectorForm.isDeviceConnected()) saveAudioDeviceToConfig(); timeCodeWorker = new TimeCodeWorker(timecodeLabel); - CreatenewThreadToListenMasterPeekVolume(); + //CreatenewThreadToListenMasterPeekVolume(); } catch (Exception e) { MessageBox.Show(e.Message, StringResources.ERROR_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Error); } } - private void CreatenewThreadToListenMasterPeekVolume() { - new Thread(() => { - while (true) { - try { - int panelHeight = (int)Math.Round(currentDevice.AudioMeterInformation.MasterPeakValue * 100); - Debug.WriteLine(String.Format("panelHeight {0}", panelHeight)); - // int panelHeight = (int)Math.Floor(currentDevice.AudioMeterInformation.MasterPeakValue * 79); - setPanelSizeHeight(panelHeight); - Thread.Sleep(1); - } - catch (Exception e) { - Console.WriteLine(e.Message); - } - } - }).Start(); - } + //private void CreatenewThreadToListenMasterPeekVolume() { + // new Thread(() => { + // while (true) { + // try { + // int panelHeight = (int)Math.Round(currentDevice.AudioMeterInformation.MasterPeakValue * 100); + // Debug.WriteLine(String.Format("panelHeight {0}", panelHeight)); + // // int panelHeight = (int)Math.Floor(currentDevice.AudioMeterInformation.MasterPeakValue * 79); + // setPanelSizeHeight(panelHeight); + // Thread.Sleep(1); + // } + // catch (Exception e) { + // Console.WriteLine(e.Message); + // } + // } + // }).Start(); + //} private void InitializeControlTexts() { recordButton.Text = Resources.FELVETEL; diff --git a/client/AudioRecorder/WavRecorder.cs b/client/AudioRecorder/WavRecorder.cs index 56c38fd5..2bf8d48f 100644 --- a/client/AudioRecorder/WavRecorder.cs +++ b/client/AudioRecorder/WavRecorder.cs @@ -58,6 +58,15 @@ namespace AudioRecorder { if (!pausing) { waveWriter.Write(e.Buffer, 0, e.BytesRecorded); waveWriter.Flush(); + try { + int panelHeight = (int)Math.Round(device.AudioMeterInformation.MasterPeakValue * 100); + Debug.WriteLine(String.Format("panelHeight {0}", panelHeight)); + // int panelHeight = (int)Math.Floor(currentDevice.AudioMeterInformation.MasterPeakValue * 79); + mainForm.setPanelSizeHeight(panelHeight); + } + catch (Exception ex) { + Console.WriteLine(ex.Message); + } } } -- 2.54.0