ItemMediaInfo.xaml.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using MediaBrowser.Model.Entities;
  2. using System.Collections.Generic;
  3. using System.Windows;
  4. namespace MediaBrowser.Plugins.DefaultTheme.Controls.Details
  5. {
  6. /// <summary>
  7. /// Interaction logic for ItemMediaInfo.xaml
  8. /// </summary>
  9. public partial class ItemMediaInfo : BaseDetailsControl
  10. {
  11. /// <summary>
  12. /// Initializes a new instance of the <see cref="ItemMediaInfo" /> class.
  13. /// </summary>
  14. public ItemMediaInfo()
  15. {
  16. InitializeComponent();
  17. }
  18. /// <summary>
  19. /// Called when [item changed].
  20. /// </summary>
  21. protected override void OnItemChanged()
  22. {
  23. MediaStreams.Children.Clear();
  24. TxtPath.Text = Item.Path;
  25. if (Item.VideoFormat.HasValue && Item.VideoFormat.Value != VideoFormat.Standard)
  26. {
  27. TxtVideoFormat.Visibility = Visibility.Visible;
  28. TxtVideoFormat.Text = Item.VideoFormat.Value == VideoFormat.Digital3D ? "Digital 3D" : "SBS 3D";
  29. }
  30. else
  31. {
  32. TxtVideoFormat.Visibility = Visibility.Collapsed;
  33. }
  34. foreach (var stream in Item.MediaStreams ?? new List<MediaStream> {})
  35. {
  36. MediaStreams.Children.Add(new MediaStreamControl
  37. {
  38. MediaStream = stream
  39. });
  40. }
  41. }
  42. }
  43. }