private void MainForm_Load(object sender, EventArgs e) { this.monitorBuffer = new float[2048]; this.monitor = new WaveformMonitor(Color.FromArgb(139, 229, 139), this.monitorBox.Size); this.monitorBox.Image = this.monitor.Bitmap; this.volumeMonitor = new VolumeMonitor(Color.FromArgb(139, 229, 139), this.volumeMonitorBox.Size); this.volumeMonitorBox.Image = this.volumeMonitor.Bitmap; this.SwitchConnection(); Func <float[], int, int, int> process = (buffer, offset, count) => { int k = connector.Master.Read(buffer, offset, count); if (this.monitorBuffer.Length != buffer.Length) { this.monitorBuffer = new float[buffer.Length]; } buffer.CopyTo(this.monitorBuffer, 0); return(k); }; var setting = new PlayerSettings() { BufferSize = 1024, BufferCount = 32, BitPerSample = 16, SamplingFrequency = frequencty }; this.player = new SinglePlayer(process, setting); this.playing = true; this.Stop(); }
private void menu_waveform_Click(object sender, EventArgs e) { if (this.monitor != null) { this.monitor.Dispose(); } this.monitor = new WaveformMonitor(this.monitorBox.BackColor, this.monitorBox.Size); this.monitorBox.Image = this.monitor.Bitmap; }
private void menu_historyClick(object sender, EventArgs e) { if (this.monitor != null) { this.monitor.Dispose(); } this.monitor = new FrequencySpectrumMonitor(this.monitorBox.BackColor, this.monitorBox.Size); this.monitorBox.Image = this.monitor.Bitmap; }
private void menu_noMonitor_Click(object sender, EventArgs e) { if (this.monitor != null) { this.monitor.Dispose(); } this.monitor = null; this.monitorBox.Image = null; }
private void menu_waveform_Click(object sender, EventArgs e) { if (this.monitor != null) this.monitor.Dispose(); this.monitor = new WaveformMonitor(this.monitorBox.BackColor, this.monitorBox.Size); this.monitorBox.Image = this.monitor.Bitmap; }
private void menu_spectrum_Click(object sender, EventArgs e) { if (this.monitor != null) this.monitor.Dispose(); this.monitor = new FrequencyMonitor(this.monitorBox.BackColor, this.monitorBox.Size); this.monitorBox.Image = this.monitor.Bitmap; }
private void menu_noMonitor_Click(object sender, EventArgs e) { if (this.monitor != null) this.monitor.Dispose(); this.monitor = null; this.monitorBox.Image = null; }
private void MainForm_Load(object sender, EventArgs e) { this.monitorBuffer = new float[2048]; this.monitor = new WaveformMonitor(Color.FromArgb(139, 229, 139), this.monitorBox.Size); this.monitorBox.Image = this.monitor.Bitmap; this.volumeMonitor = new VolumeMonitor(Color.FromArgb(139, 229, 139), this.volumeMonitorBox.Size); this.volumeMonitorBox.Image = this.volumeMonitor.Bitmap; this.SwitchConnection(); Func<float[], int, int, int> process = (buffer, offset, count) => { int k = connector.Master.Read(buffer, offset, count); if (this.monitorBuffer.Length != buffer.Length) this.monitorBuffer = new float[buffer.Length]; buffer.CopyTo(this.monitorBuffer, 0); return k; }; var setting = new PlayerSettings() { BufferSize = 1024, BufferCount = 32, BitPerSample = 16, SamplingFrequency = frequencty }; this.player = new SinglePlayer(process, setting); this.playing = true; this.Stop(); }