From: Bellai Ádám Date: Wed, 15 Nov 2017 14:05:20 +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=2fb872a558e0bc1b455bb928271efcd79a7e8ae7;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C30729 --- diff --git a/client/AudioRecorder/MainForm.Designer.cs b/client/AudioRecorder/MainForm.Designer.cs index 784534c0..20994f0b 100644 --- a/client/AudioRecorder/MainForm.Designer.cs +++ b/client/AudioRecorder/MainForm.Designer.cs @@ -154,6 +154,7 @@ namespace AudioRecorder { this.verticalProgressBar1.Location = new System.Drawing.Point(18, 19); this.verticalProgressBar1.Name = "verticalProgressBar1"; this.verticalProgressBar1.Size = new System.Drawing.Size(15, 203); + this.verticalProgressBar1.Step = 1; this.verticalProgressBar1.TabIndex = 12; // // customTrackBar1 diff --git a/client/AudioRecorder/MainForm.cs b/client/AudioRecorder/MainForm.cs index da07f89c..a645dcee 100644 --- a/client/AudioRecorder/MainForm.cs +++ b/client/AudioRecorder/MainForm.cs @@ -5,7 +5,6 @@ using System.Drawing; using NAudio.CoreAudioApi; using System.Windows.Forms; using System.IO; -using System.Runtime.InteropServices; using System.Threading; namespace AudioRecorder { @@ -13,9 +12,6 @@ namespace AudioRecorder { public partial class MainForm : Form, IMainForm { - [DllImport("user32.dll")] - public static extern int SendMessage(IntPtr hWnd, int wMsg, int wParam, int lParam); - //private const String CONFIG_FILE = "Resources/configuration.json"; private const String CONFIG_FILE = "Configuration/audiorecorder.json"; @@ -50,6 +46,7 @@ namespace AudioRecorder { saveAudioDeviceToConfig(); timeCodeWorker = new TimeCodeWorker(timecodeLabel); //CreatenewThreadToListenMasterPeekVolume(); + } catch (Exception e) { MessageBox.Show(e.Message, StringResources.ERROR_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Error); @@ -133,9 +130,11 @@ namespace AudioRecorder { try { if (recording) { if (volumeHeight >= settings.getLoudValue()) - SendMessage(verticalProgressBar1.Handle, 1040, 2, 0); + //SendMessage(verticalProgressBar1.Handle, 1040, 2, 0); + verticalProgressBar1.ForeColor = Color.Red; else - SendMessage(verticalProgressBar1.Handle, 1040, 1, 0); + // SendMessage(verticalProgressBar1.Handle, 1040, 1, 0); + verticalProgressBar1.ForeColor = Color.Green; verticalProgressBar1.Value = (int)volumeHeight; } } catch (Exception e) { diff --git a/client/AudioRecorder/VerticalProgressBar.cs b/client/AudioRecorder/VerticalProgressBar.cs index 04ccaca7..123e7127 100644 --- a/client/AudioRecorder/VerticalProgressBar.cs +++ b/client/AudioRecorder/VerticalProgressBar.cs @@ -4,10 +4,27 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using System.Runtime.InteropServices; namespace AudioRecorder { class VerticalProgressBar : ProgressBar { + [DllImport("uxtheme.dll", CharSet = CharSet.Unicode)] + public extern static int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string pszSubIdList); + + public VerticalProgressBar() { + Style = ProgressBarStyle.Blocks; + + } + + protected override void CreateHandle() { + base.CreateHandle(); + try { + SetWindowTheme(this.Handle, "", ""); + } + catch { } + } + protected override CreateParams CreateParams { get { CreateParams cp = base.CreateParams; diff --git a/client/AudioRecorder/WavRecorder.cs b/client/AudioRecorder/WavRecorder.cs index 2bf8d48f..04cb7c18 100644 --- a/client/AudioRecorder/WavRecorder.cs +++ b/client/AudioRecorder/WavRecorder.cs @@ -60,8 +60,6 @@ namespace AudioRecorder { 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) {