using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace QCRPG.TSL.BT;

public class SCOoverHCIOptions : Form
{
	private uint sampleSize;

	private uint sampleRate;

	private uint frequency;

	private uint amplitude;

	private bool saveTxFile;

	private bool saveDummyPackets;

	private uint durationSec;

	private IContainer components;

	private Label label1;

	private Label label2;

	private Label label3;

	private Label label4;

	private TextBox textBoxSampleSize;

	private TextBox textBoxSampleRate;

	private TextBox textBoxFrequency;

	private TextBox textBoxAmplitude;

	private Button buttonOK;

	private Button buttonCancel;

	private CheckBox checkBoxSaveTxWavFile;

	private GroupBox groupBox1;

	private GroupBox groupBox2;

	private GroupBox groupBox3;

	private CheckBox checkBoxSaveDummyPackets;

	private TextBox textBoxDuration;

	private Label label5;

	public uint SampleSize
	{
		get
		{
			return sampleSize;
		}
		set
		{
			sampleSize = value;
		}
	}

	public uint SampleRate
	{
		get
		{
			return sampleRate;
		}
		set
		{
			sampleRate = value;
		}
	}

	public uint Frequency
	{
		get
		{
			return frequency;
		}
		set
		{
			frequency = value;
		}
	}

	public uint Amplitude
	{
		get
		{
			return amplitude;
		}
		set
		{
			amplitude = value;
		}
	}

	public bool SaveTxFile
	{
		get
		{
			return saveTxFile;
		}
		set
		{
			saveTxFile = value;
		}
	}

	public bool SaveDummyPackets
	{
		get
		{
			return saveDummyPackets;
		}
		set
		{
			saveDummyPackets = value;
		}
	}

	public uint DurationSec
	{
		get
		{
			return durationSec;
		}
		set
		{
			durationSec = value;
		}
	}

	public SCOoverHCIOptions()
	{
		InitializeComponent();
	}

	private void buttonOK_Click(object sender, EventArgs e)
	{
		uint.TryParse(textBoxSampleSize.Text, out sampleSize);
		uint.TryParse(textBoxSampleRate.Text, out sampleRate);
		uint.TryParse(textBoxFrequency.Text, out frequency);
		uint.TryParse(textBoxAmplitude.Text, out amplitude);
		uint.TryParse(textBoxDuration.Text, out durationSec);
		saveTxFile = checkBoxSaveTxWavFile.Checked;
		saveDummyPackets = checkBoxSaveDummyPackets.Checked;
	}

	private void SCOoverHCIOptions_Load(object sender, EventArgs e)
	{
		textBoxAmplitude.Text = amplitude.ToString();
		textBoxFrequency.Text = frequency.ToString();
		textBoxSampleRate.Text = sampleRate.ToString();
		textBoxSampleSize.Text = sampleSize.ToString();
		checkBoxSaveTxWavFile.Checked = saveTxFile;
		checkBoxSaveDummyPackets.Checked = saveDummyPackets;
		textBoxDuration.Text = durationSec.ToString();
	}

	protected override void Dispose(bool disposing)
	{
		if (disposing && components != null)
		{
			components.Dispose();
		}
		base.Dispose(disposing);
	}

	private void InitializeComponent()
	{
		this.label1 = new System.Windows.Forms.Label();
		this.label2 = new System.Windows.Forms.Label();
		this.label3 = new System.Windows.Forms.Label();
		this.label4 = new System.Windows.Forms.Label();
		this.textBoxSampleSize = new System.Windows.Forms.TextBox();
		this.textBoxSampleRate = new System.Windows.Forms.TextBox();
		this.textBoxFrequency = new System.Windows.Forms.TextBox();
		this.textBoxAmplitude = new System.Windows.Forms.TextBox();
		this.buttonOK = new System.Windows.Forms.Button();
		this.buttonCancel = new System.Windows.Forms.Button();
		this.checkBoxSaveTxWavFile = new System.Windows.Forms.CheckBox();
		this.groupBox1 = new System.Windows.Forms.GroupBox();
		this.groupBox2 = new System.Windows.Forms.GroupBox();
		this.groupBox3 = new System.Windows.Forms.GroupBox();
		this.checkBoxSaveDummyPackets = new System.Windows.Forms.CheckBox();
		this.label5 = new System.Windows.Forms.Label();
		this.textBoxDuration = new System.Windows.Forms.TextBox();
		this.groupBox1.SuspendLayout();
		this.groupBox2.SuspendLayout();
		this.groupBox3.SuspendLayout();
		base.SuspendLayout();
		this.label1.AutoSize = true;
		this.label1.Location = new System.Drawing.Point(6, 27);
		this.label1.Name = "label1";
		this.label1.Size = new System.Drawing.Size(66, 13);
		this.label1.TabIndex = 0;
		this.label1.Text = "Sample size:";
		this.label2.AutoSize = true;
		this.label2.Location = new System.Drawing.Point(6, 28);
		this.label2.Name = "label2";
		this.label2.Size = new System.Drawing.Size(66, 13);
		this.label2.TabIndex = 1;
		this.label2.Text = "Sample rate:";
		this.label3.AutoSize = true;
		this.label3.Location = new System.Drawing.Point(6, 54);
		this.label3.Name = "label3";
		this.label3.Size = new System.Drawing.Size(82, 13);
		this.label3.TabIndex = 2;
		this.label3.Text = "Frequency (Hz):";
		this.label4.AutoSize = true;
		this.label4.Location = new System.Drawing.Point(191, 28);
		this.label4.Name = "label4";
		this.label4.Size = new System.Drawing.Size(56, 13);
		this.label4.TabIndex = 3;
		this.label4.Text = "Amplitude:";
		this.textBoxSampleSize.Location = new System.Drawing.Point(85, 24);
		this.textBoxSampleSize.Name = "textBoxSampleSize";
		this.textBoxSampleSize.Size = new System.Drawing.Size(100, 20);
		this.textBoxSampleSize.TabIndex = 4;
		this.textBoxSampleRate.Location = new System.Drawing.Point(85, 25);
		this.textBoxSampleRate.Name = "textBoxSampleRate";
		this.textBoxSampleRate.Size = new System.Drawing.Size(100, 20);
		this.textBoxSampleRate.TabIndex = 5;
		this.textBoxFrequency.Location = new System.Drawing.Point(85, 51);
		this.textBoxFrequency.Name = "textBoxFrequency";
		this.textBoxFrequency.Size = new System.Drawing.Size(100, 20);
		this.textBoxFrequency.TabIndex = 6;
		this.textBoxAmplitude.Location = new System.Drawing.Point(247, 25);
		this.textBoxAmplitude.Name = "textBoxAmplitude";
		this.textBoxAmplitude.Size = new System.Drawing.Size(100, 20);
		this.textBoxAmplitude.TabIndex = 7;
		this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
		this.buttonOK.Location = new System.Drawing.Point(69, 332);
		this.buttonOK.Name = "buttonOK";
		this.buttonOK.Size = new System.Drawing.Size(75, 23);
		this.buttonOK.TabIndex = 8;
		this.buttonOK.Text = "OK";
		this.buttonOK.UseVisualStyleBackColor = true;
		this.buttonOK.Click += new System.EventHandler(buttonOK_Click);
		this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
		this.buttonCancel.Location = new System.Drawing.Point(223, 332);
		this.buttonCancel.Name = "buttonCancel";
		this.buttonCancel.Size = new System.Drawing.Size(75, 23);
		this.buttonCancel.TabIndex = 9;
		this.buttonCancel.Text = "Cancel";
		this.buttonCancel.UseVisualStyleBackColor = true;
		this.checkBoxSaveTxWavFile.AutoSize = true;
		this.checkBoxSaveTxWavFile.Location = new System.Drawing.Point(9, 77);
		this.checkBoxSaveTxWavFile.Name = "checkBoxSaveTxWavFile";
		this.checkBoxSaveTxWavFile.Size = new System.Drawing.Size(153, 17);
		this.checkBoxSaveTxWavFile.TabIndex = 10;
		this.checkBoxSaveTxWavFile.Text = "Save transmitted file (.wav)";
		this.checkBoxSaveTxWavFile.UseVisualStyleBackColor = true;
		this.groupBox1.Controls.Add(this.label1);
		this.groupBox1.Controls.Add(this.textBoxSampleSize);
		this.groupBox1.Location = new System.Drawing.Point(15, 12);
		this.groupBox1.Name = "groupBox1";
		this.groupBox1.Size = new System.Drawing.Size(353, 55);
		this.groupBox1.TabIndex = 11;
		this.groupBox1.TabStop = false;
		this.groupBox1.Text = "Synchronous Connection Parameters";
		this.groupBox2.Controls.Add(this.textBoxDuration);
		this.groupBox2.Controls.Add(this.label5);
		this.groupBox2.Controls.Add(this.label2);
		this.groupBox2.Controls.Add(this.textBoxSampleRate);
		this.groupBox2.Controls.Add(this.checkBoxSaveTxWavFile);
		this.groupBox2.Controls.Add(this.textBoxFrequency);
		this.groupBox2.Controls.Add(this.label3);
		this.groupBox2.Controls.Add(this.textBoxAmplitude);
		this.groupBox2.Controls.Add(this.label4);
		this.groupBox2.Location = new System.Drawing.Point(15, 76);
		this.groupBox2.Name = "groupBox2";
		this.groupBox2.Size = new System.Drawing.Size(353, 106);
		this.groupBox2.TabIndex = 12;
		this.groupBox2.TabStop = false;
		this.groupBox2.Text = "Wave generator parameters (Tx)";
		this.groupBox3.Controls.Add(this.checkBoxSaveDummyPackets);
		this.groupBox3.Location = new System.Drawing.Point(15, 188);
		this.groupBox3.Name = "groupBox3";
		this.groupBox3.Size = new System.Drawing.Size(353, 64);
		this.groupBox3.TabIndex = 13;
		this.groupBox3.TabStop = false;
		this.groupBox3.Text = "Receiver parameters";
		this.checkBoxSaveDummyPackets.AutoSize = true;
		this.checkBoxSaveDummyPackets.Location = new System.Drawing.Point(9, 28);
		this.checkBoxSaveDummyPackets.Name = "checkBoxSaveDummyPackets";
		this.checkBoxSaveDummyPackets.Size = new System.Drawing.Size(128, 17);
		this.checkBoxSaveDummyPackets.TabIndex = 0;
		this.checkBoxSaveDummyPackets.Text = "Save dummy packets";
		this.checkBoxSaveDummyPackets.UseVisualStyleBackColor = true;
		this.label5.AutoSize = true;
		this.label5.Location = new System.Drawing.Point(191, 54);
		this.label5.Name = "label5";
		this.label5.Size = new System.Drawing.Size(50, 13);
		this.label5.TabIndex = 11;
		this.label5.Text = "Duration:";
		this.textBoxDuration.Location = new System.Drawing.Point(247, 51);
		this.textBoxDuration.Name = "textBoxDuration";
		this.textBoxDuration.Size = new System.Drawing.Size(100, 20);
		this.textBoxDuration.TabIndex = 12;
		base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.ClientSize = new System.Drawing.Size(380, 405);
		base.Controls.Add(this.groupBox3);
		base.Controls.Add(this.groupBox2);
		base.Controls.Add(this.groupBox1);
		base.Controls.Add(this.buttonCancel);
		base.Controls.Add(this.buttonOK);
		base.Name = "SCOoverHCIOptions";
		this.Text = "SCOoverHCIOptions";
		base.Load += new System.EventHandler(SCOoverHCIOptions_Load);
		this.groupBox1.ResumeLayout(false);
		this.groupBox1.PerformLayout();
		this.groupBox2.ResumeLayout(false);
		this.groupBox2.PerformLayout();
		this.groupBox3.ResumeLayout(false);
		this.groupBox3.PerformLayout();
		base.ResumeLayout(false);
	}
}
