/// <summary>
        /// Init method
        /// </summary>
        /// <returns></returns>
        public override bool Init()
        {
            bool bResult = Load(GUIGraphicsContext.GetThemedSkinFile(@"\TVCropSettings.xml"));

            GetID = (int)Window.WINDOW_TV_CROP_SETTINGS;
            return(bResult);
        }
Ejemplo n.º 2
0
        public override bool Init()
        {
            bool bResult = Load(GUIGraphicsContext.GetThemedSkinFile(@"\tvZAPOSD.xml"));

            GetID = (int)Window.WINDOW_TVZAPOSD;
            return(bResult);
        }
Ejemplo n.º 3
0
        public override bool Init()
        {
            using (Profile.Settings xmlreader = new Profile.MPSettings())
            {
                _playlistFolder               = xmlreader.GetValueAsString("music", "playlists", string.Empty);
                _savePlaylistOnExit           = xmlreader.GetValueAsBool("musicfiles", "savePlaylistOnExit", false);
                _resumePlaylistOnEnter        = xmlreader.GetValueAsBool("musicfiles", "resumePlaylistOnMusicEnter", false);
                _savePlaylistAsUtf8           = xmlreader.GetValueAsBool("musicfiles", "savePlaylistUTF8", false);
                playlistPlayer.RepeatPlaylist = xmlreader.GetValueAsBool("musicfiles", "repeat", true);
            }

            if (_resumePlaylistOnEnter)
            {
                if (_savePlaylistAsUtf8)
                {
                    _defaultPlaylist = string.Format("{0}.m3u8", Path.GetFileNameWithoutExtension(_defaultPlaylist));
                }
                Log.Info("GUIMusicPlaylist: Loading default playlist {0}", _defaultPlaylist);
                bw = new BackgroundWorker();
                bw.WorkerSupportsCancellation = true;
                bw.WorkerReportsProgress      = false;
                bw.DoWork             += new DoWorkEventHandler(bw_DoWork);
                bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);
                bw.RunWorkerAsync();
            }
            else
            {
                defaultPlaylistLoaded = true;
            }

            GUIWindowManager.Receivers     += new SendMessageHandler(this.OnThreadMessage);
            GUIWindowManager.OnNewAction   += new OnActionHandler(this.OnNewAction);
            playlistPlayer.PlaylistChanged += playlistPlayer_Changed;
            return(Load(GUIGraphicsContext.GetThemedSkinFile(@"\myMusicplaylist.xml")));
        }
Ejemplo n.º 4
0
        public override bool Init()
        {
            bool bResult = Load(GUIGraphicsContext.GetThemedSkinFile(@"\mytvschedulerserver.xml"));

            LoadSettings();
            return(bResult);
        }
        private void InitSkinSizeFromReferenceXML()
        {
            string skinReferenceFilePath = GUIGraphicsContext.GetThemedSkinFile("\\references.xml");

            Log.Debug("FullScreenSplash: Try to init Skin size from reference.xml: {0}", skinReferenceFilePath);

            var doc = new XmlDocument();

            doc.Load(skinReferenceFilePath);
            if (doc.DocumentElement != null)
            {
                XmlNode nodeSkinWidth  = doc.DocumentElement.SelectSingleNodeFast("/controls/skin/width/text()");
                XmlNode nodeSkinHeight = doc.DocumentElement.SelectSingleNodeFast("/controls/skin/height/text()");
                if (nodeSkinWidth != null && nodeSkinHeight != null)
                {
                    try
                    {
                        int iWidth  = Convert.ToInt16(nodeSkinWidth.Value);
                        int iHeight = Convert.ToInt16(nodeSkinHeight.Value);
                        Log.Debug("FullScreenSplash: Original skin size: {0}x{1}", iWidth, iHeight);
                        GUIGraphicsContext.SkinSize = new Size(iWidth, iHeight);
                        return;
                    }
                    catch (FormatException) // Size values were invalid.
                    {  }
                }
            }
            Log.Debug("FullScreenSplash: Fallback to Default skin size: 1920x1080");
            GUIGraphicsContext.SkinSize = new Size(1920, 1080);
        }
Ejemplo n.º 6
0
        private void OnSkinChanged()
        {
            // Backup the buttons, needed later
            BackupButtons();

            // Set the skin to the selected skin and reload GUI
            GUIGraphicsContext.Skin = _btnSkin.Label;
            SaveSettings();
            GUITextureManager.Clear();
            GUITextureManager.Init();
            SkinSettings.Load();
            GUIFontManager.LoadFonts(GUIGraphicsContext.GetThemedSkinFile(@"\fonts.xml"));
            GUIFontManager.InitializeDeviceObjects();
            GUIExpressionManager.ClearExpressionCache();
            GUIControlFactory.ClearReferences();
            GUIControlFactory.LoadReferences(GUIGraphicsContext.GetThemedSkinFile(@"\references.xml"));
            GUIWindowManager.OnResize();
            GUIWindowManager.ActivateWindow(GetID);
            GUIControl.FocusControl(GetID, _btnSkin.GetID);

            // Apply the selected buttons again, since they are cleared when we reload
            RestoreButtons();
            using (Settings xmlreader = new MPSettings())
            {
                xmlreader.SetValue("general", "skinobsoletecount", 0);
                if (!GUIGraphicsContext.Fullscreen)
                {
                    try
                    {
                        var border = new Size(GUIGraphicsContext.form.Width - GUIGraphicsContext.form.ClientSize.Width,
                                              GUIGraphicsContext.form.Height - GUIGraphicsContext.form.ClientSize.Height);
                        if (GUIGraphicsContext.SkinSize.Width + border.Width <= GUIGraphicsContext.currentScreen.WorkingArea.Width &&
                            GUIGraphicsContext.SkinSize.Height + border.Height <= GUIGraphicsContext.currentScreen.WorkingArea.Height)
                        {
                            GUIGraphicsContext.form.ClientSize = new Size(GUIGraphicsContext.SkinSize.Width, GUIGraphicsContext.SkinSize.Height);
                        }
                        else
                        {
                            double ratio = Math.Min((double)(GUIGraphicsContext.currentScreen.WorkingArea.Width - border.Width) / GUIGraphicsContext.SkinSize.Width,
                                                    (double)(GUIGraphicsContext.currentScreen.WorkingArea.Height - border.Height) / GUIGraphicsContext.SkinSize.Height);
                            GUIGraphicsContext.form.ClientSize = new Size((int)(GUIGraphicsContext.SkinSize.Width * ratio), (int)(GUIGraphicsContext.SkinSize.Height * ratio));
                        }
                    }
                    catch (Exception ex)
                    {
                        Log.Error("OnSkinChanged exception:{0}", ex.ToString());
                        Log.Error(ex);
                    }
                }
            }
            if (BassMusicPlayer.Player != null && BassMusicPlayer.Player.VisualizationWindow != null)
            {
                BassMusicPlayer.Player.VisualizationWindow.Reinit();
            }

            // Send a message that the skin has changed.
            var msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_SKIN_CHANGED, 0, 0, 0, 0, 0, null);

            GUIGraphicsContext.SendMessage(msg);
        }
Ejemplo n.º 7
0
        public override bool Init()
        {
            bool success = false;

            GUIWindowManager.Receivers += new SendMessageHandler(this.OnThreadMessage);

            // Load the various Music NowPlaying files
            // we might have:
            // 1. A standard Now Playing to which we fall back
            // 2. a Now Playing with Analog VUMeter
            // 3. a Now Playing with Led VUMeter
            if (_vuMeter.ToLowerInvariant() == "analog")
            {
                success = Load(GUIGraphicsContext.GetThemedSkinFile(@"\MyMusicPlayingNowAnVu.xml"));
            }
            else if (_vuMeter.ToLowerInvariant() == "led")
            {
                success = Load(GUIGraphicsContext.GetThemedSkinFile(@"\MyMusicPlayingNowLedVu.xml"));
            }

            if (!success)
            {
                _vuMeter = "none";
                success  = Load(GUIGraphicsContext.GetThemedSkinFile(@"\MyMusicPlayingNow.xml"));
            }

            return(success);
        }
Ejemplo n.º 8
0
        public override bool Init()
        {
            // pre-register the control class so that the factory knows how to create it
            GUIControlFactory.RegisterControl("tetris", typeof(MyTetrisControl));

            return(Load(GUIGraphicsContext.GetThemedSkinFile(@"\mytetris.xml")));
        }
Ejemplo n.º 9
0
        private void UpdateImagePathContainer()
        {
            if (ImagePathContainer.Count <= 0)
            {
                try
                {
                    if (!g_Player.ExternalController) // UPnPRenderer sets the image through a property
                    {
                        ImgCoverArt.SetFileName(GUIGraphicsContext.GetThemedSkinFile(@"\media\missing_coverart.png"));
                    }
                }
                catch (Exception ex)
                {
                    Log.Debug("GUIMusicPlayingNow: could not set default image - {0}", ex.Message);
                }
            }

            if (g_Player.Duration > 0 && ImagePathContainer.Count > 1)
            {
                ImageChangeTimer.Interval = 15 * 1000; // change covers every 15 seconds
            }
            else
            {
                ImageChangeTimer.Interval = 3600 * 1000;
            }

            ImageChangeTimer.Stop();
            ImageChangeTimer.Start();
        }
        /// <summary>
        /// Tries to find the background of the current skin by analysing the reference.xml
        /// </summary>
        private void ReadReferenceXML()
        {
            string SkinReferenceFilePath = string.Empty;

            SkinReferenceFilePath = GUIGraphicsContext.GetThemedSkinFile("\\references.xml");

            Log.Debug("FullScreenSplash: Try to use the reference.xml: {0}", SkinReferenceFilePath);

            XmlDocument doc = new XmlDocument();

            doc.Load(SkinReferenceFilePath);
            XmlNodeList ControlsList = doc.DocumentElement.SelectNodes("/controls/control");

            foreach (XmlNode Control in ControlsList)
            {
                if (Control.SelectSingleNode("type/text()").Value.ToLower() == "image")
                {
                    string BackgoundImageName  = Control.SelectSingleNode("texture/text()").Value;
                    string BackgroundImagePath = GUIGraphicsContext.GetThemedSkinFile("\\media\\" + BackgoundImageName);
                    if (File.Exists(BackgroundImagePath))
                    {
                        pbBackground.Image = new Bitmap(BackgroundImagePath); // load the image as background
                        Log.Debug("FullScreenSplash: Background image value found: {0}", BackgroundImagePath);
                    }
                }
            }
        }
        public void RevertSkin()
        {
            //int ActiveWindowID = GUIWindowManager.ActiveWindow;
            // Change skin back to OutdatedSkinName
            GUIGraphicsContext.Skin = _userSkin;
            GUITextureManager.Clear();
            GUITextureManager.Init();
            SkinSettings.Load();
            GUIFontManager.LoadFonts(GUIGraphicsContext.GetThemedSkinFile(@"\fonts.xml"));
            GUIFontManager.InitializeDeviceObjects();
            GUIExpressionManager.ClearExpressionCache();
            GUIControlFactory.ClearReferences();
            GUIControlFactory.LoadReferences(GUIGraphicsContext.GetThemedSkinFile(@"\references.xml"));
            GUIWindowManager.OnResize();
            //GUIWindowManager.ActivateWindow(ActiveWindowID);

            using (Settings xmlreader = new MPSettings())
            {
                xmlreader.SetValue("general", "skinobsoletecount", 0);
                if (!GUIGraphicsContext.Fullscreen)
                {
                    try
                    {
                        GUIGraphicsContext.form.ClientSize = new Size(GUIGraphicsContext.SkinSize.Width, GUIGraphicsContext.SkinSize.Height);
                    }
                    catch (Exception ex)
                    {
                        Log.Error("OnSkinChanged exception:{0}", ex.ToString());
                        Log.Error(ex);
                    }
                }
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Init method
        /// </summary>
        /// <returns></returns>
        public override bool Init()
        {
            bool bResult = Load(GUIGraphicsContext.GetThemedSkinFile(@"\TVCropSettings.xml"));

            GetID = (int)Window.WINDOW_TV_CROP_SETTINGS;
            GUILayerManager.RegisterLayer(this, GUILayerManager.LayerType.Dialog);
            return(bResult);
        }
 public StandardKeyboard() : base()
 {
     if (Load(GUIGraphicsContext.GetThemedSkinFile(@"\stdKeyboard.xml")))
     {
         GetID = (int)Window.WINDOW_VIRTUAL_KEYBOARD;
         _keyboard.InitializeInstance();
     }
 }
        public override bool Init()
        {
            Log.Info("newsearch init");
            bool bResult = Load(GUIGraphicsContext.GetThemedSkinFile(@"\mytvschedulerserverSearch.xml"));

            Log.Info("newsearch init result:{0}", bResult);
            return(bResult);
        }
Ejemplo n.º 15
0
 public override bool Init()
 {
     if (Load(GUIGraphicsContext.GetThemedSkinFile(@"\stdKeyboard.xml")))
     {
         _keyboard.InitializeInstance();
     }
     return(base.Init());
 }
Ejemplo n.º 16
0
        public override bool Init()
        {
            bool result = Load(GUIGraphicsContext.GetThemedSkinFile(@"\myradioguide.xml"));

            Initialize();
            GetID = (int)Window.WINDOW_RADIO_GUIDE;
            return(result);
        }
Ejemplo n.º 17
0
        public override bool Init()
        {
            bool bResult = Load(Path.Combine(Application.StartupPath,
                                             GUIGraphicsContext.GetThemedSkinFile(@"\musicFullScreen.xml")));

            GetID = (int)Window.WINDOW_FULLSCREEN_MUSIC;
            return(bResult);
        }
 public override bool Init()
 {
     /* Attention: to get this code working, be sure the skinfile uses an "updownlistcontrol" !
      * <type>updownlistcontrol</type>
      * <!-- type>playlistcontrol</type-->
      */
     return(Load(GUIGraphicsContext.GetThemedSkinFile(@"\settings_tvSort.xml")));
 }
        public override bool Init()
        {
            bool result = Load(GUIGraphicsContext.GetThemedSkinFile(@"\dialogYesNo.xml"));

            SaveDefaultBtnLabels();

            return(result);
        }
Ejemplo n.º 20
0
        public override bool Init()
        {
            bool bResult = Load(GUIGraphicsContext.GetThemedSkinFile(@"\tvOverlay.xml"));

            GetID = (int)Window.WINDOW_TV_OVERLAY;
            GUILayerManager.RegisterLayer(this, GUILayerManager.LayerType.TvOverlay);
            return(bResult);
        }
Ejemplo n.º 21
0
        public override bool Init()
        {
            Start();

            bool load = Load(GUIGraphicsContext.GetThemedSkinFile(@"\MyVideoImporter.xml"));

            return(load);
        }
Ejemplo n.º 22
0
        public override bool Init()
        {
            using (Profile.Settings xmlreader = new MPSettings())
            {
                _movieInfoBeforePlay = xmlreader.GetValueAsBool("moviedatabase", "movieinfobeforeplay", false);
            }

            return(Load(GUIGraphicsContext.GetThemedSkinFile(@"\DialogVideoArtistInfo.xml")));
        }
        /// <summary>
        /// Tries to read the splashscreen.xml file of the currentskin
        /// </summary>
        private void ReadSplashScreenXML()
        {
            string SkinFilePath = string.Empty;

            SkinFilePath = GUIGraphicsContext.GetThemedSkinFile("\\splashscreen.xml");

            if (!File.Exists(SkinFilePath))
            {
                Log.Debug("FullScreenSplash: Splashscreen.xml not found!: {0}", SkinFilePath);
                return; // if not found... leave
            }

            Log.Debug("FullScreenSplash: Splashscreen.xml found: {0}", SkinFilePath);

            XmlDocument doc = new XmlDocument();

            doc.Load(SkinFilePath);
            XmlNodeList ControlsList = doc.DocumentElement.SelectNodes("/window/controls/control");

            foreach (XmlNode Control in ControlsList)
            {
                if (Control.SelectSingleNode("type/text()").Value.ToLower() == "image" &&
                    Control.SelectSingleNode("id/text()").Value == "1") // if the background image control is found
                {
                    string BackgoundImageName  = Control.SelectSingleNode("texture/text()").Value;
                    string BackgroundImagePath = GUIGraphicsContext.GetThemedSkinFile("\\media\\" + BackgoundImageName);
                    if (File.Exists(BackgroundImagePath))
                    {
                        Log.Debug("FullScreenSplash: Try to load background image value found: {0}", BackgroundImagePath);
                        pbBackground.Image = new Bitmap(BackgroundImagePath); // load the image as background
                        Log.Debug("FullScreenSplash: background image successfully loaded: {0}", BackgroundImagePath);
                    }
                    continue;
                }
                if (Control.SelectSingleNode("type/text()").Value.ToLower() == "label" &&
                    Control.SelectSingleNode("id/text()").Value == "2") // if the center label control is found
                {
                    if (Control.SelectSingleNode("textsize") != null)   // textsize info found?
                    {
                        float TextSize = float.Parse(Control.SelectSingleNode("textsize/text()").Value);
                        Log.Debug("FullScreenSplash: Textsize value found: {0}", TextSize);
                        lblMain.Font = new Font(lblMain.Font.FontFamily, TextSize, lblMain.Font.Style);
                        Log.Debug("FullScreenSplash: Textsize successfully set: {0}", TextSize);
                    }
                    if (Control.SelectSingleNode("textcolor") != null) // textcolor info found?
                    {
                        Color TextColor = ColorTranslator.FromHtml(Control.SelectSingleNode("textcolor/text()").Value);
                        Log.Debug("FullScreenSplash: TextColor value found: {0}", TextColor);
                        lblMain.ForeColor    = TextColor;
                        lblVersion.ForeColor = TextColor;
                        lblCVS.ForeColor     = TextColor;
                        Log.Debug("FullScreenSplash: TextColor successfully set: {0}", TextColor);
                    }
                }
            }
        }
Ejemplo n.º 24
0
        public override bool Init()
        {
            GUIPropertyManager.SetProperty("#Actor.Movies.Progress", string.Empty);
            using (Profile.Settings xmlreader = new MPSettings())
            {
                _movieInfoBeforePlay = xmlreader.GetValueAsBool("moviedatabase", "movieinfobeforeplay", false);
            }

            return(Load(GUIGraphicsContext.GetThemedSkinFile(@"\DialogVideoArtistInfo.xml")));
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Init method
        /// </summary>
        /// <returns></returns>
        public override bool Init()
        {
            bool bResult = Load(GUIGraphicsContext.GetThemedSkinFile(@"\TVMiniGuide.xml"));

            GetID = (int)Window.WINDOW_MINI_GUIDE;
            //GUILayerManager.RegisterLayer(this, GUILayerManager.LayerType.MiniEPG);
            _canceled = true;
            LoadSettings();
            return(bResult);
        }
Ejemplo n.º 26
0
        private static void ThreadActivateTheme(object param)
        {
            if (!(param is ThreadParams))
            {
                Log.Error("param at ThreadActivateTheme has wrong type");
                return;
            }
            ThreadParams threadParams = (ThreadParams)param;

            GUIWaitCursor.Show();

            // Need to initialize fonts and references if they change based on the theme.
            // Check current theme.
            bool initFonts      = (GUIGraphicsContext.HasThemeSpecificSkinFile(@"\fonts.xml"));
            bool initReferences = (GUIGraphicsContext.HasThemeSpecificSkinFile(@"\references.xml"));

            // Change the theme and save this new setting.
            SetTheme(threadParams._themeName);
            SkinSettings.Save();

            // Check new theme.
            initFonts      = initFonts || GUIGraphicsContext.HasThemeSpecificSkinFile(@"\fonts.xml");
            initReferences = initReferences || GUIGraphicsContext.HasThemeSpecificSkinFile(@"\references.xml");

            // Reset fonts if needed.
            if (initFonts)
            {
                // Reinitializing the device while changing fonts freezes the UI.
                // Add some sleep() to present the wait cursor animation for at least some user feedback.
                Thread.Sleep(500);
                GUIFontManager.ClearFontCache();
                GUIFontManager.LoadFonts(GUIGraphicsContext.GetThemedSkinFile(@"\fonts.xml"));
                GUIFontManager.InitializeDeviceObjects();
                Thread.Sleep(500);
            }

            // Force a reload of the control references if needed.
            if (initReferences)
            {
                GUIControlFactory.ClearReferences();
            }

            // Reactivate the current window and refocus on the control used to change the theme.
            // This applies the new theme to the current window immediately.
            GUIWindowManager.ResetAllControls();
            GUIWindowManager.SendThreadCallbackAndWait((p1, p2, p3) =>
            {
                GUIWindowManager.ActivateWindow(p1, true, true, (int)p3);
                return(0);
            }, GUIWindowManager.ActiveWindow, 0, threadParams._focusControlId);

            GUIWaitCursor.Hide();
        }
Ejemplo n.º 27
0
        public override bool Init()
        {
            // pre-register the control class so that the factory knows how to create it
            GUIControlFactory.RegisterControl("cell", typeof(CellControl));

            // Create our skin xml file
            CreateSkinXML(GetWindowId(), GUIGraphicsContext.Theme);

            this.timer.Elapsed += new ElapsedEventHandler(OnTimer_Tick);

            // Load the skin xml file
            return(Load(GUIGraphicsContext.GetThemedSkinFile(@"\" + pluginConfigFileName + ".xml")));
        }
Ejemplo n.º 28
0
 public static void InitVUMeterImages()
 {
     if (vumeterImage == null && Utils.SpectrumVUMeterEnabled && Utils.VUMeterImageFound)
     {
         string vumeterImageFile = GUIGraphicsContext.GetThemedSkinFile(Utils.VUMeterImage);
         vumeterImage     = Utils.LoadImageFastFromFile(vumeterImageFile);
         bVUMeterVertical = vumeterImage.Height > vumeterImage.Width;
     }
     if (vumeterPeak == null && Utils.SpectrumVUMeterEnabled && Utils.VUMeterPeakImageFound)
     {
         string vumeterPeakImageFile = GUIGraphicsContext.GetThemedSkinFile(Utils.VUMeterPeakImage);
         vumeterPeak = Utils.LoadImageFastFromFile(vumeterPeakImageFile);
     }
 }
Ejemplo n.º 29
0
        //    bool simMode = false;
        //    int offset = 0;

        public Geochron()
        {
            // Set up the image URLs
            Bitmap dayImage   = new Bitmap(GUIGraphicsContext.GetThemedSkinFile(@"\Media\animations\day.png"));
            Bitmap nightImage = new Bitmap(GUIGraphicsContext.GetThemedSkinFile(@"\Media\animations\night.png"));


            this.n_x = dayImage.Width;
            this.n_y = dayImage.Height;

            // Store the images
            day   = new ImageHandler(dayImage);
            night = new ImageHandler(nightImage);
        }
Ejemplo n.º 30
0
 private void OnLanguageChanged()
 {
     // Backup the buttons, needed later
     BackupButtons();
     SaveSettings();
     GUILocalizeStrings.ChangeLanguage(_btnLanguage.Label);
     GUIFontManager.LoadFonts(GUIGraphicsContext.GetThemedSkinFile(@"\fonts.xml"));
     GUIFontManager.InitializeDeviceObjects();
     GUIWindowManager.OnResize();
     GUIWindowManager.ActivateWindow(GetID); // without this you cannot change skins / lang any more..
     GUIControl.FocusControl(GetID, _btnLanguage.GetID);
     // Apply the selected buttons again, since they are cleared when we reload
     RestoreButtons();
 }