예제 #1
0
 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;
     }
     }
 }
예제 #2
0
 public void AddVideoTrack(LocalVideoTrack track, string deviceName)
 {
     ThreadHelper.EnsureIsMainThread();
     VideoTracks.Add(new VideoTrackViewModel(track, deviceName));
     LocalTracks.Add(new LocalTrackViewModel(Symbol.Video)
     {
         DisplayName = deviceName
     });
 }
예제 #3
0
 public void AddAudioTrack(LocalAudioTrack track, string deviceName)
 {
     ThreadHelper.EnsureIsMainThread();
     AudioTracks.Add(new AudioTrackViewModel(track, deviceName));
     LocalTracks.Add(new LocalTrackViewModel(Symbol.Volume)
     {
         DisplayName = deviceName
     });
 }