Esempio n. 1
0
        /// <summary>
        /// Pastes copied data to the selected position in the time domain.
        /// </summary>
        /// <param name="sender">Unused.</param>
        /// <param name="e">Unused.</param>
        private void Paste(object sender, EventArgs e)
        {
            // Checks if the window has two channels
            bool dualChannel = this.window.Header.Channels == 2;

            // Gets the data from the clipboard
            ClipboardData copyData = (ClipboardData)Clipboard.GetData("AudioPanel");

            if (copyData != null)
            {
                // Pastes the data and upsamples or downsamples if needed
                if (this.window.Header.SampleRate == copyData.Header.SampleRate || window.LChannel == null)
                {
                    FileEditor.Paste(this.window, copyData, dualChannel);
                    this.window.LTimeChannel.LoadData(this.window.LChannel);
                    this.window.LTimeChannel.Chart.Refresh();

                    dualChannel = this.window.Header.Channels == 2;
                    if (dualChannel)
                    {
                        this.window.RTimeChannel.LoadData(this.window.RChannel);
                        this.window.RTimeChannel.Chart.Refresh();
                    }
                }
                else if (this.window.Header.SampleRate < copyData.Header.SampleRate)
                {
                    FileEditor.DownSamplePaste(this.window, copyData, dualChannel);
                }
                else
                {
                    FileEditor.UpSamplePaste(this.window, copyData, dualChannel);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Deletes a selected range in the time domain.
        /// </summary>
        /// <param name="sender">Unused.</param>
        /// <param name="e">Unused.</param>
        private void Delete(object sender, EventArgs e)
        {
            bool dualChannel = this.window.Header.Channels == 2;

            FileEditor.Delete(this.window, dualChannel);

            if (this.window.LChannel != null)
            {
                this.window.LTimeChannel.LoadData(this.window.LChannel);
                this.window.LTimeChannel.Chart.Refresh();
                if (this.window.LChannel.Count == 0)
                {
                    this.window.LChannel = null;
                }
            }

            if (dualChannel)
            {
                if (this.window.RChannel != null)
                {
                    this.window.RTimeChannel.LoadData(this.window.RChannel);
                    this.window.RTimeChannel.Chart.Refresh();
                    if (this.window.RChannel.Count == 0)
                    {
                        this.window.RChannel = null;
                    }
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Copies a selected range in the time domain.
        /// </summary>
        /// <param name="sender">Unused.</param>
        /// <param name="e">Unused.</param>
        private void Copy(object sender, EventArgs e)
        {
            bool dualChannel = this.window.Header.Channels == 2;

            FileEditor.Copy(this.window, dualChannel);
        }