Ejemplo n.º 1
0
        public async Task <IEnumerable <string> > GetExternalDeviceIds()
        {
            DeviceInformationCollection devices =
                await DeviceInformation.FindAllAsync(DeviceClass.PortableStorageDevice);

            return(devices.Select(d => d.Id));
        }
Ejemplo n.º 2
0
        public async Task <IEnumerable <Device> > ListInputDevices()
        {
            // Find all input MIDI devices
            string midiInputQueryString = MidiInPort.GetDeviceSelector();
            DeviceInformationCollection midiInputDevices = await DeviceInformation.FindAllAsync(midiInputQueryString);

            return(midiInputDevices.Select(x =>
            {
                return new MidiDevice {
                    info = x
                };
            }));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Finds all Intelligent Headset devices that are paired on the device.
        /// </summary>
        /// <remarks>You may need to call this from time to time to find any newly connected or newly disconnected Intelligent Headset devices.</remarks>
        /// <returns>An IEnumerable of IntelligentHeadsetSensorDevice objects representing Intelligent Headset devices that are paired on the device.</returns>
        public static async Task <IEnumerable <IntelligentHeadsetSensorDevice> > FindDevicesAsync()
        {
            var result = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(DeviceClass.AudioRender);

            foreach (var r in result)
            {
                Debug.WriteLine($"id:{r.Id}, Name: {r.Name}");
            }

            // Create a device selector for devices advertising the IMU service.
            var deviceSelector = GattDeviceService.GetDeviceSelectorFromUuid(Guid.Parse(Identifiers.GnImuService)); //GnGpsService

            // Asynchonously obtain the device information collection for devices advertising the IMU service.
            DeviceInformationCollection deviceInformationCollection = await DeviceInformation.FindAllAsync(deviceSelector, new string[] { "System.Devices.Connected" });

            // Return the devices.
            return(deviceInformationCollection.Select(deviceInformation => new IntelligentHeadsetSensorDevice(deviceInformation)).ToList <IntelligentHeadsetSensorDevice>());
        }
        public async Task StartLiveStream()
        {
            Debug.WriteLine("StartLiveStream");
            await CleanupCameraAsync();

            if (_devices == null)
            {
                try
                {
                    _devices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.Message);
                    _devices = null;
                }
                if ((_devices == null) || (_devices.Count == 0))
                {
                    // No camera sources found
                    Debug.WriteLine("No cameras found");
                    NotifyUser(false, "No cameras found.");
                    return;
                }
                _appModel.CameraNamesList = _devices.Select(device => device.Name);
                return;
            }
            // If just above 0 you fool
            if (_appModel.SelectedCameraIndex >= 0)
            {
                Debug.WriteLine("StartLive: already 0");
                await ChangeLiveStream();

                return;
            }
            // If already have the list, set to the default
            _appModel.SelectedCameraIndex = 0;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Get the available camera names
        /// </summary>
        public static async Task <IEnumerable <string> > GetAvailableCameraNamesAsync()
        {
            DeviceInformationCollection deviceInfo = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);

            return(deviceInfo.Select(d => GetCameraName(d, deviceInfo)).OrderBy(name => name));
        }
Ejemplo n.º 6
0
        private async void OnBaseStationConnectionDialogLoaded(object sender, RoutedEventArgs e)
        {
            Devices = await DeviceInformation.FindAllAsync(SerialDevice.GetDeviceSelector());

            DevicesListView.ItemsSource = Devices.Select(x => x.Name);
        }
Ejemplo n.º 7
0
 /// <summary>
 /// デバイス一覧を得る
 /// </summary>
 /// <returns>一覧</returns>
 public async Task<string[]> GetDevices()
 {
     _Devices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);
     var array = _Devices.Select(p => p.Name).ToArray();
     return array;
 }