コード例 #1
0
ファイル: TVSeriesPlugin.cs プロジェクト: barneh/mptvseries
        public TVSeriesPlugin()
        {
            m_stepSelections.Add(new string[] { null });
            // disable that dynamic skin adjustment....skinners should have the power to position the elements whereever with the plugin inerveining
            if (DBOption.GetOptions(DBOption.cViewAutoHeight)) DBOption.SetOptions(DBOption.cViewAutoHeight, false);

            int artworkDelay = DBOption.GetOptions(DBOption.cArtworkLoadingDelay);
            int backdropDelay = DBOption.GetOptions(DBOption.cBackdropLoadingDelay);

            backdrop = new ImageSwapper();
            backdrop.ImageResource.Delay = backdropDelay;
            backdrop.PropertyOne = "#TVSeries.Fanart.1";
            backdrop.PropertyTwo = "#TVSeries.Fanart.2";

            seriesbanner = new AsyncImageResource();
            seriesbanner.Property = "#TVSeries.SeriesBanner";
            seriesbanner.Delay = artworkDelay;

            seriesposter = new AsyncImageResource();
            seriesposter.Property = "#TVSeries.SeriesPoster";
            seriesposter.Delay = artworkDelay;

            seasonbanner = new AsyncImageResource();
            seasonbanner.Property = "#TVSeries.SeasonPoster";
            seasonbanner.Delay = artworkDelay;

            MPTVSeriesLog.Write(string.Format("MP-TVSeries Version: v{0}", Settings.Version.ToString()));
            MPTVSeriesLog.Write("MP-TVSeries Build Date: " + Settings.BuildDate);
        }
コード例 #2
0
        // Once image loading is complete this method is called and the visibility of the
        // two GUIImages is swapped.
        private void imageResource_ImageLoadingComplete(AsyncImageResource image)
        {
            lock (loadingLock)
            {
                if (_guiImageOne == null)
                {
                    return;
                }

                if (_filename == null)
                {
                    if (_guiImageOne != null)
                    {
                        _guiImageOne.Visible = false;
                    }
                    if (_guiImageTwo != null)
                    {
                        _guiImageTwo.Visible = false;
                    }
                    return;
                }

                _guiImageOne.ResetAnimations();
                if (_guiImageTwo != null)
                {
                    _guiImageTwo.ResetAnimations();
                }

                // if we have a second backdrop image object, alternate between the two
                if (_guiImageTwo != null)
                {
                    if (_imageResource.Property.Equals(_propertyOne))
                    {
                        _guiImageOne.Visible = _active;
                        _guiImageTwo.Visible = false;
                    }
                    else
                    {
                        _guiImageOne.Visible = false;
                        _guiImageTwo.Visible = _active;
                    }

                    imagesNeedSwapping = true;
                }


                // if no 2nd backdrop control, just update normally
                else
                {
                    _guiImageOne.Visible = _active;
                }

                if (_loadingImage != null)
                {
                    _loadingImage.Visible = false;
                }
            }
        }
コード例 #3
0
        // Once image loading is complete this method is called and the visibility of the
        // two GUIImages is swapped.
        private void imageResource_ImageLoadingComplete(AsyncImageResource image) {
            lock (loadingLock) {
                if (_guiImageOne == null)
                    return;

                if (_filename == null) {
                    if (_guiImageOne != null) _guiImageOne.Visible = false;
                    if (_guiImageTwo != null) _guiImageTwo.Visible = false;
                    return;
                }

                _guiImageOne.ResetAnimations();
                if (_guiImageTwo != null) _guiImageTwo.ResetAnimations();

                // if we have a second backdrop image object, alternate between the two
                if (_guiImageTwo != null) {
                    if (_imageResource.Property.Equals(_propertyOne)) {
                        _guiImageOne.Visible = _active;
                        _guiImageTwo.Visible = false;
                    }
                    else {
                        _guiImageOne.Visible = false;
                        _guiImageTwo.Visible = _active;
                    }

                    imagesNeedSwapping = true;
                }


                // if no 2nd backdrop control, just update normally
                else _guiImageOne.Visible = _active;

                if (_loadingImage != null) _loadingImage.Visible = false;
            }
        }
コード例 #4
0
 public ImageSwapper() {
     _imageResource = new AsyncImageResource();
     _imageResource.Property = _propertyOne;
     _imageResource.ImageLoadingComplete += new AsyncImageLoadComplete(imageResource_ImageLoadingComplete);
 }
コード例 #5
0
ファイル: ImageSwapper.cs プロジェクト: brownard/MyEmulators2
 public ImageSwapper()
 {
     _imageResource                       = new AsyncImageResource();
     _imageResource.Property              = _propertyOne;
     _imageResource.ImageLoadingComplete += new AsyncImageLoadComplete(imageResource_ImageLoadingComplete);
 }
コード例 #6
0
        private void onCoreInitializationProgress(string actionName, int percentDone)
        {
            // Update the progress variables
            if (percentDone == 100) {
                actionName = "Loading GUI ...";
            }
            initProgressLastAction = actionName;
            initProgressLastPercent = percentDone;

            // If the progress dialog exists, update it.
            if (initDialog != null) {
                initDialog.SetLine(2, initProgressLastAction);
                initDialog.SetPercentage(initProgressLastPercent);
                initDialog.Progress();
            }

            // When we are finished initializing
            if (percentDone == 100) {

                // Start the background importer
                if (MovingPicturesCore.Settings.EnableImporterInGUI) {
                    MovingPicturesCore.Importer.Start();
                    MovingPicturesCore.Importer.Progress += new MovieImporter.ImportProgressHandler(Importer_Progress);
                }

                // Load skin based settings from skin file
                skinSettings = new MovingPicturesSkinSettings(_windowXmlFileName);

                // Get Moving Pictures specific autoplay setting
                try {
                    diskInsertedAction = (DiskInsertedAction)Enum.Parse(typeof(DiskInsertedAction), MovingPicturesCore.Settings.DiskInsertionBehavior);
                }
                catch {
                    diskInsertedAction = DiskInsertedAction.DETAILS;
                }

                // setup the image resources for cover and backdrop display
                int artworkDelay = MovingPicturesCore.Settings.ArtworkLoadingDelay;

                // setup the time for the random category backdrop refresh
                activeMovieLookup.Timeout = new TimeSpan(0, 0, MovingPicturesCore.Settings.CategoryRandomArtworkRefreshInterval);

                // create backdrop image swapper
                backdrop = new ImageSwapper();
                backdrop.ImageResource.Delay = artworkDelay;
                backdrop.PropertyOne = "#MovingPictures.Backdrop";
                backdrop.PropertyTwo = "#MovingPictures.Backdrop2";

                // create cover image swapper
                cover = new AsyncImageResource();
                cover.Property = "#MovingPictures.Coverart";
                cover.Delay = artworkDelay;

                // instantiate player
                moviePlayer = new MoviePlayer(this);
                moviePlayer.MovieEnded += new MoviePlayerEvent(onMovieEnded);
                moviePlayer.MovieStopped += new MoviePlayerEvent(onMovieStopped);

                // Listen to the DeviceManager for external media activity (i.e. disks inserted)
                logger.Debug("Listening for device changes.");
                DeviceManager.OnVolumeInserted += new DeviceManager.DeviceManagerEvent(OnVolumeInserted);
                DeviceManager.OnVolumeRemoved += new DeviceManager.DeviceManagerEvent(OnVolumeRemoved);

                // Flag that the GUI is initialized
                initComplete = true;

                // If the initDialog is present close it
                if (initDialog != null) {
                    initDialog.Close();
                }

                // Report that we completed the init
                logger.Info("GUI Initialization Complete");
            }
        }
コード例 #7
0
ファイル: MainWindow.cs プロジェクト: dizzydezz/jmm
        public MainWindow()
        {
            // get ID of windowplugin belonging to this setup
            // enter your own unique code
            GetID = Constants.PlugInInfo.ID;

            try
            {
                settings = new AnimePluginSettings();

                imageHelper = new ImageDownloader();
                imageHelper.Init();

                listPoster = new AsyncImageResource();
                listPoster.Property = "#Anime3.GroupSeriesPoster";
                listPoster.Delay = artworkDelay;

                fanartTexture = new AsyncImageResource();
                fanartTexture.Property = "#Anime3.Fanart.1";
                fanartTexture.Delay = artworkDelay;

                GroupFilterQuickSorts = new Dictionary<int, QuickSort>();

                //searching
                searchTimer = new System.Timers.Timer();
                searchTimer.AutoReset = true;
                searchTimer.Interval = settings.FindTimeout_s * 1000;
                searchTimer.Elapsed += new System.Timers.ElapsedEventHandler(searchTimer_Elapsed);

                //set the search key sound to the same sound for the REMOTE_1 key
                Key key = new Key('1', (int)Keys.D1);
                MediaPortal.GUI.Library.Action action = new MediaPortal.GUI.Library.Action();
                ActionTranslator.GetAction(GetID, key, ref action);
                searchSound = action.SoundFileName;

                // timer for automatic updates
                autoUpdateTimer = new System.Timers.Timer();
                autoUpdateTimer.AutoReset = true;
                autoUpdateTimer.Interval = 5 * 60 * 1000; // 5 minutes * 60 seconds
                autoUpdateTimer.Elapsed += new System.Timers.ElapsedEventHandler(autoUpdateTimer_Elapsed);

                downloadImagesWorker.DoWork += new DoWorkEventHandler(downloadImagesWorker_DoWork);

                this.OnToggleWatched += new OnToggleWatchedHandler(MainWindow_OnToggleWatched);

                g_Player.PlayBackEnded += new g_Player.EndedHandler(g_Player_PlayBackEnded);
            }
            catch (Exception ex)
            {
                BaseConfig.MyAnimeLog.Write(ex.ToString());
                throw;
            }
        }