public MainForm() { // // Required for Windows Form Designer support // InitializeComponent(); DevicesForm devices = new DevicesForm(this); devices.ShowDialog(this); InitDirectSound(); if (null == applicationDevice) { Close(); } else { FormatsForm formats = new FormatsForm(this); if (formats.ShowDialog(this) == DialogResult.OK) { labelMainInputformatText.Text = string.Format("{0} Hz, {1}-bit ", InputFormat.SamplesPerSecond, InputFormat.BitsPerSample) + ((1 == InputFormat.Channels) ? "Mono" : "Stereo"); CreateCaptureBuffer(); } else { this.Close(); } } }
/// <summary> /// Получить выбранный узел из дерева каналов и устройств /// </summary> /// <returns>Выбранный в дереве узел</returns> public TreeNodeAdv GetSelectedNode() { try { TreeNodeAdv selectedNode = DevicesForm.GetLastSelectedNode(); return(selectedNode); } catch { const string Message = "Некорректно выбран узел в " + "дереве"; throw new Exception(Message); } }
private string InvokeDeviceEditor(string name) { var answer = DevicesForm.Invoke(_deviceNames, name); if (answer == null) { return(null); } _deviceNames = new List <Tuple <string, string> >(); foreach (var tuple in answer.Item1) { _deviceNames.Add(tuple); } return(answer.Item2); }
/// <summary> /// Обновление дерева устройств после привязки /// </summary> private void RefreshTree() { DevicesForm.RefreshTreeAfterBinding(); }