Пример #1
0
 public static TranslateTransform GetTranslateTransform(MediaElement m)
 {
     if (m.RenderTransform is TransformGroup renderTransformsA)
     {
         return(renderTransformsA.Children[0] as TranslateTransform);
     }
     else
     {
         renderTransformsA = new TransformGroup();
         var translateTransformA = new TranslateTransform(0, 0);
         renderTransformsA.Children.Add(translateTransformA);
         m.RenderTransform = renderTransformsA;
         return(translateTransformA);
     }
 }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.window = ((Unosquare.FFME.Windows.Sample.MainWindow)(target));
                return;

            case 2:
                this.Player = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.Media = ((Unosquare.FFME.MediaElement)(target));
                return;

            case 4:
                this.LayoutPanel = ((System.Windows.Controls.DockPanel)(target));
                return;

            case 5:
                this.ControllerPanel = ((Unosquare.FFME.Windows.Sample.Controls.ControllerPanelControl)(target));
                return;

            case 6:
                this.PlaylistPanel = ((Unosquare.FFME.Windows.Sample.Controls.PlaylistPanelControl)(target));
                return;

            case 7:
                this.PropertiesPanel = ((Unosquare.FFME.Windows.Sample.Controls.PropertiesPanelControl)(target));
                return;

            case 8:
                this.NotificationsGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 9:
                this.NotificationsBorder = ((System.Windows.Controls.Border)(target));
                return;

            case 10:
                this.NotificationTextBlock = ((System.Windows.Controls.TextBlock)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #3
0
 /// <summary>
 /// Gets the size of the font.
 /// </summary>
 /// <param name="obj">The object.</param>
 /// <returns>The value</returns>
 public static double GetFontSize(MediaElement obj)
 {
     return((double)obj.GetValue(FontSizeProperty));
 }
Пример #4
0
 /// <summary>
 /// Sets the outline brush.
 /// </summary>
 /// <param name="obj">The object.</param>
 /// <param name="value">The value.</param>
 public static void SetOutlineBrush(MediaElement obj, Brush value)
 {
     obj.SetValue(OutlineBrushProperty, value);
 }
Пример #5
0
 /// <summary>
 /// Gets the text.
 /// </summary>
 /// <param name="obj">The object.</param>
 /// <returns>The value</returns>
 public static string GetText(MediaElement obj)
 {
     return(obj.GetValue(TextProperty) as string);
 }
Пример #6
0
 /// <summary>
 /// Sets the effect.
 /// </summary>
 /// <param name="obj">The object.</param>
 /// <param name="value">The value.</param>
 public static void SetEffect(MediaElement obj, Effect value)
 {
     obj.SetValue(EffectProperty, value);
 }
Пример #7
0
 /// <summary>
 /// Sets the width of the outline.
 /// </summary>
 /// <param name="obj">The object.</param>
 /// <param name="value">The value.</param>
 public static void SetOutlineWidth(MediaElement obj, Thickness value)
 {
     obj.SetValue(OutlineWidthProperty, value);
 }
Пример #8
0
 /// <summary>
 /// Gets the font family.
 /// </summary>
 /// <param name="obj">The object.</param>
 /// <returns>The value</returns>
 public static FontFamily GetFontFamily(MediaElement obj)
 {
     return(obj.GetValue(FontFamilyProperty) as FontFamily);
 }
Пример #9
0
 /// <summary>
 /// Sets the text foreground.
 /// </summary>
 /// <param name="obj">The object.</param>
 /// <param name="value">The value.</param>
 public static void SetForeground(MediaElement obj, Brush value)
 {
     obj.SetValue(ForegroundProperty, value);
 }
Пример #10
0
 /// <summary>
 /// Sets the size of the font.
 /// </summary>
 /// <param name="obj">The object.</param>
 /// <param name="value">The value.</param>
 public static void SetFontSize(MediaElement obj, double value)
 {
     obj.SetValue(FontSizeProperty, value);
 }
Пример #11
0
 public static void GetTransformsFromMediaElement(ref MediaElement m, ref (TranslateTransform Translate, ScaleTransform Scale, RotateTransform Rotate) t)
Пример #12
0
 /// <summary>
 /// Gets the outline brush.
 /// </summary>
 /// <param name="obj">The object.</param>
 /// <returns>The value.</returns>
 public static Brush GetOutlineBrush(MediaElement obj)
 {
     return(obj.GetValue(OutlineBrushProperty) as Brush);
 }
Пример #13
0
 /// <summary>
 /// Sets the text.
 /// </summary>
 /// <param name="obj">The object.</param>
 /// <param name="value">The value.</param>
 public static void SetText(MediaElement obj, string value)
 {
     obj.SetValue(TextProperty, value);
 }
Пример #14
0
 /// <summary>
 /// Gets the width of the outline.
 /// </summary>
 /// <param name="obj">The object.</param>
 /// <returns>The value.</returns>
 public static Thickness GetOutlineWidth(MediaElement obj)
 {
     return((Thickness)obj.GetValue(OutlineWidthProperty));
 }
Пример #15
0
 /// <summary>
 /// Gets the effect.
 /// </summary>
 /// <param name="obj">The object.</param>
 /// <returns>The value</returns>
 public static Effect GetEffect(MediaElement obj)
 {
     return(obj.GetValue(EffectProperty) as Effect);
 }
Пример #16
0
 /// <summary>
 /// Gets the text foreground.
 /// </summary>
 /// <param name="obj">The object.</param>
 /// <returns>The value</returns>
 public static Brush GetForeground(MediaElement obj)
 {
     return(obj.GetValue(ForegroundProperty) as Brush);
 }
Пример #17
0
 /// <summary>
 /// Gets the font weight.
 /// </summary>
 /// <param name="obj">The object.</param>
 /// <returns>The value</returns>
 public static FontWeight GetFontWeight(MediaElement obj)
 {
     return((FontWeight)obj.GetValue(FontWeightProperty));
 }
Пример #18
0
 /// <summary>
 /// Gets the size of the font.
 /// </summary>
 /// <param name="element">The object.</param>
 /// <returns>The value</returns>
 public static double GetFontSize(MediaElement element) => (double)(element?.GetValue(FontSizeProperty) ?? default);
Пример #19
0
 /// <summary>
 /// Sets the font weight.
 /// </summary>
 /// <param name="obj">The object.</param>
 /// <param name="value">The value.</param>
 public static void SetFontWeight(MediaElement obj, FontWeight value)
 {
     obj.SetValue(FontWeightProperty, value);
 }
Пример #20
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 12 "..\..\..\..\Controls\PreviewerControls\VideoPlayer.xaml"
                ((JustTag.Controls.PreviewerControls.VideoPlayer)(target)).MouseEnter += new System.Windows.Input.MouseEventHandler(this.UserControl_MouseEnterOrLeave);

            #line default
            #line hidden

            #line 13 "..\..\..\..\Controls\PreviewerControls\VideoPlayer.xaml"
                ((JustTag.Controls.PreviewerControls.VideoPlayer)(target)).MouseLeave += new System.Windows.Input.MouseEventHandler(this.UserControl_MouseEnterOrLeave);

            #line default
            #line hidden
                return;

            case 2:
                this.videoPlayer = ((Unosquare.FFME.MediaElement)(target));

            #line 23 "..\..\..\..\Controls\PreviewerControls\VideoPlayer.xaml"
                this.videoPlayer.MediaFailed += new System.EventHandler <System.Windows.ExceptionRoutedEventArgs>(this.videoPlayer_MediaFailed);

            #line default
            #line hidden

            #line 24 "..\..\..\..\Controls\PreviewerControls\VideoPlayer.xaml"
                this.videoPlayer.PositionChanged += new System.EventHandler <Unosquare.FFME.Events.PositionChangedRoutedEventArgs>(this.videoPlayer_PositionChanged);

            #line default
            #line hidden

            #line 25 "..\..\..\..\Controls\PreviewerControls\VideoPlayer.xaml"
                this.videoPlayer.MediaEnded += new System.Windows.RoutedEventHandler(this.videoPlayer_MediaEnded);

            #line default
            #line hidden
                return;

            case 3:
                this.videoControls = ((System.Windows.Controls.Grid)(target));
                return;

            case 4:
                this.playButton = ((System.Windows.Controls.Button)(target));

            #line 48 "..\..\..\..\Controls\PreviewerControls\VideoPlayer.xaml"
                this.playButton.Click += new System.Windows.RoutedEventHandler(this.playButton_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.volumeControls = ((System.Windows.Controls.DockPanel)(target));

            #line 54 "..\..\..\..\Controls\PreviewerControls\VideoPlayer.xaml"
                this.volumeControls.MouseEnter += new System.Windows.Input.MouseEventHandler(this.volumeControls_MouseEnter);

            #line default
            #line hidden

            #line 55 "..\..\..\..\Controls\PreviewerControls\VideoPlayer.xaml"
                this.volumeControls.MouseLeave += new System.Windows.Input.MouseEventHandler(this.volumeControls_MouseLeave);

            #line default
            #line hidden
                return;

            case 6:
                this.muteButton = ((System.Windows.Controls.Button)(target));

            #line 61 "..\..\..\..\Controls\PreviewerControls\VideoPlayer.xaml"
                this.muteButton.Click += new System.Windows.RoutedEventHandler(this.muteButton_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.volumeIcon = ((System.Windows.Controls.Image)(target));
                return;

            case 8:
                this.volumeMutedIcon = ((System.Windows.Controls.Image)(target));
                return;

            case 9:
                this.volumeSlider = ((System.Windows.Controls.Slider)(target));

            #line 80 "..\..\..\..\Controls\PreviewerControls\VideoPlayer.xaml"
                this.volumeSlider.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.volumeSlider_ValueChanged);

            #line default
            #line hidden
                return;

            case 10:
                this.videoTimeSlider = ((System.Windows.Controls.Slider)(target));

            #line 88 "..\..\..\..\Controls\PreviewerControls\VideoPlayer.xaml"
                this.videoTimeSlider.MouseMove += new System.Windows.Input.MouseEventHandler(this.videoTimeSlider_MouseMoved);

            #line default
            #line hidden

            #line 89 "..\..\..\..\Controls\PreviewerControls\VideoPlayer.xaml"
                this.videoTimeSlider.PreviewMouseDown += new System.Windows.Input.MouseButtonEventHandler(this.videoTimeSlider_MouseDown);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Пример #21
0
 /// <summary>
 /// Sets the font family.
 /// </summary>
 /// <param name="obj">The object.</param>
 /// <param name="value">The value.</param>
 public static void SetFontFamily(MediaElement obj, FontFamily value)
 {
     obj.SetValue(FontFamilyProperty, value);
 }
Пример #22
0
 /// <summary>
 /// Gets the text.
 /// </summary>
 /// <param name="element">The object.</param>
 /// <returns>The value</returns>
 public static string GetText(MediaElement element) => element?.GetValue(TextProperty) as string;