Esempio n. 1
0
        /*****************************************************************
        * Gets called when the user clicks the stop button. It sends the
        * message to the win32 handle to stop recording and acquires the
        * recorded samples. The buttons are then re-enabled and if data was
        * recorded a new wav file is created and drawn to the chart. If no
        * data was recorded an error message is displayed.
        ******************************************************************/
        private void stopButton_Click(object sender, EventArgs e)
        {
            handle.recordData = handle.data_stop();
            recordButton.Enabled = true;
            stopButton.Enabled = false;

            if (handle.recordData != null)
            {
                wav = new Wav(handle.recordData);
                toggle_wait_cursor();
                drawChart(wav.dataToDouble());
                toggle_wait_cursor();
                playButton.Enabled = true;

            }
            else
            {
                MessageBox.Show("No data was recorded", "Recording error",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }