예제 #1
0
        protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
        {
            if (control.GetType() == typeof (GUIButtonControl))
            {
                if (controlId > 100 && controlId <= Settings.LocalPresetsNumber + 100 &&
                    _setting.PresetStations[controlId - 100 - 1] != null &&
                    _setting.PresetStations[controlId - 100 - 1].GuidId != null)
                {
                    DoPlay(_setting.PresetStations[controlId - 100 - 1]);
                    if (_setting.JumpNowPlaying)
                        GUIWindowManager.ActivateWindow(25652);
                }
            }
            if (control == homeButton)
            {
                GUIWindowManager.ActivateWindow(25650);
            }
            else if (control == folderButton)
            {
                var s = GetPresetFolder();
                if (s == noPresetFolders)
                {
                    ErrMessage(Translation.NoPresetFoldersFound);
                    GUIControl.DisableControl(GetID, folderButton.GetID);
                }
                else if (s != null)
                {
                    _setting.FolderId = s;
                    _setting.Save();
                    LoadLocalPresetStations();
                }
            }

            base.OnClicked(controlId, control, actionType);
        }
예제 #2
0
        private string GetSingleLabelFromControl(GUIControl control)
        {
            if (control.GetType() == typeof(GUILabelControl))
            {
                GUILabelControl label = (GUILabelControl)control;
                return label.Label;
            }
            else if (control.GetType() == typeof(GUIFadeLabel))
            {
                GUIFadeLabel label = (GUIFadeLabel)control;
                return label.Label;
            }

            return null;
        }
예제 #3
0
 /// <summary>
 /// Generates a single element based on the type of the GUIControl
 /// Supported Types:
 /// - GUIListControl
 /// - GUITextScrollUpControl
 /// - GUICheckMarkControl
 /// - GUISliderControl
 /// - GUICheckButton
 /// - GUIButtonControl
 /// - GUIFadeLabel
 /// - GUIProgressControl
 /// - GUITVProgressControl
 /// - GUIVolumeBar
 /// - GUILabelControl
 /// - GUIImage
 /// - GUIGroup are handled directly
 /// </summary>
 /// <param name="control">Control</param>
 /// <returns>Element based on the GUIControl</returns>
 public static BaseElement GenerateElement(GUIControl control)
 {
     if (control.GetType() == typeof(GUIImage))
       {
     return new ImageElement(control);
       }
       if (control.GetType() == typeof(GUILabelControl))
       {
     return new LabelElement(control);
       }
       if (control.GetType() == typeof(GUIVolumeBar))
       {
     return new VolumeBarElement(control);
       }
       if (control.GetType() == typeof(GUIProgressControl))
       {
     return new ProgressControlElement(control);
       }
       if (control.GetType() == typeof(GUITVProgressControl))
       {
     return new TVProgressControlElement(control);
       }
       if (control.GetType() == typeof(GUIFadeLabel))
       {
     return new FadeLabelElement(control);
       }
       if (control.GetType() == typeof(GUIButtonControl))
       {
     return new ButtonElement(control);
       }
       if (control.GetType() == typeof(GUICheckButton))
       {
     return new CheckButtonElement(control);
       }
       if (control.GetType() == typeof(GUISliderControl))
       {
     return new SliderElement(control);
       }
       if (control.GetType() == typeof(GUICheckMarkControl))
       {
     return new CheckMarkElement(control);
       }
       if (control.GetType() == typeof(GUITextScrollUpControl))
       {
     return new TextScrollUpElement(control);
       }
       if (control.GetType() == typeof(GUIListControl))
       {
     return new ListElement(control);
       }
       Log.Debug("VIDEOPLAYER_OSD FOUND UNEXPECTED TYPE: " + control.GetType());
       return null;
 }
예제 #4
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));
     }
       }
 }