Exemple #1
0
        protected override void AddSubtitleFilter(bool isSourceFilterPresent)
        {
            VideoSettings settings = ServiceRegistration.Get <ISettingsManager>().Load <VideoSettings>() ?? new VideoSettings();
            int           preferredSubtitleLcid      = settings.PreferredSubtitleLanguage;
            var           fileSystemResourceAccessor = _resourceAccessor as IFileSystemResourceAccessor;

            if (fileSystemResourceAccessor != null)
            {
                ServiceRegistration.Get <ILogger>().Debug("{0}: Adding MPC-HC subtitle engine", PlayerTitle);
                SubtitleStyle defStyle = new SubtitleStyle();
                defStyle.Load();
                MpcSubtitles.SetDefaultStyle(ref defStyle, false);

                IntPtr upDevice = SkinContext.Device.NativePointer;
                string filename = fileSystemResourceAccessor.ResourcePathName;

                MpcSubtitles.LoadSubtitles(upDevice, _displaySize, filename, _graphBuilder, @".\", preferredSubtitleLcid);
                if (settings.EnableSubtitles)
                {
                    MpcSubtitles.SetEnable(true);
                }
            }

            AddClosedCaptionsFilter();
        }
    protected override void AddSubtitleFilter(bool isSourceFilterPresent)
    {
      VideoSettings settings = ServiceRegistration.Get<ISettingsManager>().Load<VideoSettings>() ?? new VideoSettings();
      int preferredSubtitleLcid = settings.PreferredSubtitleLanguage;

      ServiceRegistration.Get<ILogger>().Debug("{0}: Adding MPC-HC subtitle engine", PlayerTitle);
      SubtitleStyle defStyle = new SubtitleStyle();
      defStyle.Load();
      MpcSubtitles.SetDefaultStyle(ref defStyle, false);

      IntPtr upDevice = SkinContext.Device.NativePointer;
      string filename = string.Empty;

      string paths;
      if (GetSubtitlePath(out paths, out filename))
      {
        MpcSubtitles.LoadSubtitles(upDevice, _displaySize, filename, _graphBuilder, paths, preferredSubtitleLcid);
        MpcSubtitles.SetEnable(settings.EnableSubtitles);
      }
    }
Exemple #3
0
        protected override void AddSubtitleFilter(bool isSourceFilterPresent)
        {
            VideoSettings settings = ServiceRegistration.Get <ISettingsManager>().Load <VideoSettings>() ?? new VideoSettings();
            int           preferredSubtitleLcid = settings.PreferredSubtitleLanguage;

            ServiceRegistration.Get <ILogger>().Debug("{0}: Adding MPC-HC subtitle engine", PlayerTitle);
            SubtitleStyle defStyle = new SubtitleStyle();

            defStyle.Load();
            MpcSubtitles.SetDefaultStyle(ref defStyle, false);

            IntPtr upDevice = SkinContext.Device.NativePointer;
            string filename = string.Empty;

            string paths;

            if (GetSubtitlePath(out paths, out filename))
            {
                MpcSubtitles.LoadSubtitles(upDevice, _displaySize, filename, _graphBuilder, paths, preferredSubtitleLcid);
                MpcSubtitles.SetEnable(settings.EnableMpcSubtitlesEngine);
            }
        }