Ejemplo n.º 1
0
    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();
            }
        }
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Получить выбранный узел из дерева каналов и устройств
 /// </summary>
 /// <returns>Выбранный в дереве узел</returns>
 public TreeNodeAdv GetSelectedNode()
 {
     try
     {
         TreeNodeAdv selectedNode = DevicesForm.GetLastSelectedNode();
         return(selectedNode);
     }
     catch
     {
         const string Message = "Некорректно выбран узел в " +
                                "дереве";
         throw new Exception(Message);
     }
 }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Обновление дерева устройств после привязки
 /// </summary>
 private void RefreshTree()
 {
     DevicesForm.RefreshTreeAfterBinding();
 }