private void OnTracksChanged(object sender, NotifyCollectionChangedEventArgs e) { ThreadHelper.EnsureIsMainThread(); // We only care about local tracks, that can only be added at the moment. switch (e.Action) { case NotifyCollectionChangedAction.Add: { bool anyNewLocalTrack = false; foreach (var newItem in e.NewItems) { var tvm = (TrackViewModel)newItem; if (!tvm.IsRemote) { anyNewLocalTrack = true; _allSenders.Add(new SenderTrackViewModel(tvm.TrackImpl)); } } if (anyNewLocalTrack) { RaisePropertyChanged(nameof(AvailableSenders)); } break; } } }
public void AddVideoTrack(LocalVideoTrack track, string deviceName) { ThreadHelper.EnsureIsMainThread(); VideoTracks.Add(new VideoTrackViewModel(track, deviceName)); LocalTracks.Add(new LocalTrackViewModel(Symbol.Video) { DisplayName = deviceName }); }
public void AddAudioTrack(LocalAudioTrack track, string deviceName) { ThreadHelper.EnsureIsMainThread(); AudioTracks.Add(new AudioTrackViewModel(track, deviceName)); LocalTracks.Add(new LocalTrackViewModel(Symbol.Volume) { DisplayName = deviceName }); }