From: Bellai Ádám Date: Tue, 14 Nov 2017 14:25:14 +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=9cffb6c29285bab5499d9a0e14d313543c86ce84;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C30727 --- 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); + } } }