Inheritance: IDisposable
コード例 #1
0
        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();
        }
コード例 #2
0
        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;
        }
コード例 #3
0
        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;
        }
コード例 #4
0
        private void menu_noMonitor_Click(object sender, EventArgs e)
        {
            if (this.monitor != null)
            {
                this.monitor.Dispose();
            }

            this.monitor          = null;
            this.monitorBox.Image = null;
        }
コード例 #5
0
ファイル: MainForm.cs プロジェクト: nanase/ux
        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;
        }
コード例 #6
0
ファイル: MainForm.cs プロジェクト: nanase/ux
        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;
        }
コード例 #7
0
ファイル: MainForm.cs プロジェクト: nanase/ux
        private void menu_noMonitor_Click(object sender, EventArgs e)
        {
            if (this.monitor != null)
                this.monitor.Dispose();

            this.monitor = null;
            this.monitorBox.Image = null;
        }
コード例 #8
0
ファイル: MainForm.cs プロジェクト: nanase/ux
        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();
        }