Exemplo n.º 1
0
 private void CheckElement(GUIControl temp)
 {
     Log.Info(temp.GetType() + " : " + temp.GetID);
       if (temp.GetID == LabelId)
       {
     if (temp.GetType() == typeof(GUILabelControl))
     {
       _label = new LabelElement(temp);
     }
     else
     {
       Log.Info("VIDEO OSD: TYPE LABEL NOT FOUND FOR LABEL_ID=10 IN FULLSCREEN WINDOW. FOUND: " + temp.GetType());
     }
       }
       if (temp.GetID == BackgroundId)
       {
     if (temp.GetType() == typeof(GUIImage))
     {
       _background = new ImageElement(temp);
     }
     else
     {
       Log.Info("VIDEO OSD: TYPE IMAGE NOT FOUND FOR BACKGROUND_ID=0 IN FULLSCREEN WINDOW. FOUND: " + temp.GetType());
     }
       }
       if (temp.GetID == BackgroundId2)
       {
     if (temp.GetType() == typeof(GUIImage))
     {
       _background2 = new ImageElement(temp);
     }
     else
     {
       Log.Info("VIDEO OSD: TYPE IMAGE NOT FOUND FOR BACKGROUND_ID=104 IN FULLSCREEN WINDOW. FOUND: " + temp.GetType());
     }
       }
       if (temp.GetType() == typeof(GUIImage))
       {
     var imageElement = temp as GUIImage;
     if (imageElement != null)
       if (imageElement.FileName.Equals("osd_bg_top.png"))
       {
     _background3 = new ImageElement(temp);
       }
       }
       if ((temp.GetID == ProgressId) && (temp.GetType() == typeof(GUIProgressControl) || temp.GetType() == typeof(GUILabelControl))
     || (temp.GetID > PanelStart && temp.GetID < PanelEnd))
       {
     if (temp.GetType() == typeof(GUIImage))
     {
       _imageCacheElements.Add(GenerateElement(temp));
     }
     else
     {
       _cacheElements.Add(GenerateElement(temp));
     }
       }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Constructor, which creates all elements
 /// </summary>
 public FullscreenWindow()
 {
     _fullscreenWindow = GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO) as GUIVideoFullscreen;
       if (_fullscreenWindow != null)
       {
     _controlList = _fullscreenWindow.controlList;
     GenerateElements();
     _cacheElements = new List<BaseElement>();
     _imageCacheElements = new List<BaseElement>();
     foreach (var element in _controlList)
     {
       GUIControl temp = element;
       if (temp != null)
       {
     if (temp.GetType() == typeof(GUIGroup))
     {
       var help = temp as GUIGroup;
       if (help != null)
         foreach (var uiElement in help.Children)
         {
           GUIControl temp2 = uiElement;
           if (temp2 != null)
           {
             CheckElement(temp2);
           }
         }
     }
     CheckElement(temp);
       }
     }
     if (_background == null)
     {
       _background = _background2;
     }
     if (_background == null)
     {
       _background = _background3;
     }
       }
 }