Пример #1
0
        private bool playCustomIntro()
        {
            // Check if we have already played a custom intro
            if (!donePlayingCustomIntros && MovingPicturesCore.Settings.CustomIntroCount > 0)
            {
                DBMovieInfo queuedMovie = queuedMedia.AttachedMovies[0];
                // Only play custom intro for we are not resuming
                if (queuedMovie.UserSettings == null || queuedMovie.UserSettings.Count == 0 || queuedMovie.ActiveUserSettings.ResumeTime < 30)
                {
                    string custom_intro = MovingPicturesCore.Settings.CustomIntroLocation;
                    custom_intro = queuedMovie.ParseWildcards(custom_intro);
                    custom_intro = getCustomIntroFile(custom_intro);
                    if (custom_intro == null)
                    {
                        return(false);
                    }

                    // Check if the custom intro is specified by user and exists
                    if (custom_intro.Length > 0 && File.Exists(custom_intro))
                    {
                        logger.Debug("Playing Custom Intro: {0}", custom_intro);

                        // we set this variable before we start the actual playback
                        // because playFile to account for the blocking nature of the
                        // mediaportal external player logic
                        customIntrosPlayed++;
                        if (customIntrosPlayed >= MovingPicturesCore.Settings.CustomIntroCount)
                        {
                            donePlayingCustomIntros = true;
                        }

                        // start playback
                        playFile(custom_intro);
                        return(true);
                    }
                    else if (custom_intro.Length > 0)
                    {
                        logger.Warn("Unable to find custom intro file: " + custom_intro);
                    }
                }
            }

            return(false);
        }