public void SetUp() => Schedule(() =>
 {
     Child = new MicrophoneInputManager(-1)
     {
         Child = preview = new MicrophoneSoundVisualizer
         {
             Anchor     = Anchor.Centre,
             Origin     = Anchor.Centre,
             DeviceName = "Super large microphone device name : )"
         }
     };
 });
Esempio n. 2
0
        public MicrophoneDevicePreview()
        {
            ShowBackground = false;
            bindableMicrophoneDeviceName.BindValueChanged(x =>
            {
                // Find index by selection id
                var microphoneList = new MicrophoneManager().MicrophoneDeviceNames.ToList();
                var deviceName     = x.NewValue;
                var deviceIndex    = microphoneList.IndexOf(x.NewValue);
                var hasDevice      = !string.IsNullOrEmpty(x.NewValue);

                Child = new MicrophoneInputManager(deviceIndex)
                {
                    RelativeSizeAxes = Axes.Both,
                    Child            = new MicrophoneSoundVisualizer
                    {
                        Anchor     = Anchor.Centre,
                        Origin     = Anchor.Centre,
                        DeviceName = deviceName,
                        HasDevice  = hasDevice,
                    }
                };
            }, true);
        }