Esempio n. 1
0
 private void ClearDeviceList()
 {
     MainCameras.Clear();
     SecondaryCameras.Clear();
     MainMicrophones.Clear();
     SecondaryMicrophones.Clear();
     Speakers.Clear();
 }
Esempio n. 2
0
        private async Task RefreshExclusiveDataSourceAsync(ConfigItemKey configItemKey, string exclusiveItem)
        {
            await _meetingConfigView.Dispatcher.BeginInvoke(new Action(() =>
            {
                switch (configItemKey)
                {
                case ConfigItemKey.MainCamera:

                    string tempSecondaryCamera = MeetingConfigResult.SecondaryCamera.Name;

                    SecondaryCameras.Clear();

                    CachedCameras.ForEach((camera) =>
                    {
                        if (camera != exclusiveItem)
                        {
                            SecondaryCameras.Add(camera);
                        }
                    });
                    if (!SecondaryCameras.Contains(NonExclusiveItem))
                    {
                        SecondaryCameras.Add(NonExclusiveItem);
                    }
                    MeetingConfigResult.SecondaryCamera.Name = tempSecondaryCamera;

                    break;

                case ConfigItemKey.SecondaryCamera:

                    string tempMainCamera = MeetingConfigResult.MainCamera.Name;
                    MainCameras.Clear();
                    CachedCameras.ForEach((camera) =>
                    {
                        if (camera != exclusiveItem)
                        {
                            MainCameras.Add(camera);
                        }
                    });

                    if (!MainCameras.Contains(NonExclusiveItem))
                    {
                        MainCameras.Add(NonExclusiveItem);
                    }
                    MeetingConfigResult.MainCamera.Name = tempMainCamera;

                    break;

                case ConfigItemKey.MainMicrophone:
                    string tempSecondaryMic = MeetingConfigResult.AudioConfig.SecondaryMicrophone;

                    SecondaryMicrophones.Clear();

                    CachedMicrophones.ForEach((mic) =>
                    {
                        if (mic != exclusiveItem)
                        {
                            SecondaryMicrophones.Add(mic);
                        }
                    });

                    if (!SecondaryMicrophones.Contains(NonExclusiveItem))
                    {
                        SecondaryMicrophones.Add(NonExclusiveItem);
                    }

                    MeetingConfigResult.AudioConfig.SecondaryMicrophone = tempSecondaryMic;
                    break;

                case ConfigItemKey.SecondaryMicrophone:
                    string tempMainMic = MeetingConfigResult.AudioConfig.MainMicrophone;

                    MainMicrophones.Clear();
                    CachedMicrophones.ForEach((mic) =>
                    {
                        if (mic != exclusiveItem)
                        {
                            MainMicrophones.Add(mic);
                        }
                    });

                    if (!MainMicrophones.Contains(NonExclusiveItem))
                    {
                        MainMicrophones.Add(NonExclusiveItem);
                    }
                    MeetingConfigResult.AudioConfig.MainMicrophone = tempMainMic;
                    break;

                case ConfigItemKey.Unknown:
                default:
                    break;
                }
            }));
        }