Exemple #1
0
        protected override bool EnumerateStreams(bool forceRefresh)
        {
            //FIXME: TSReader only offers Audio in IAMStreamSelect, it would be cleaner to expose subs as well.
            bool refreshed = base.EnumerateStreams(forceRefresh);

            if (refreshed)
            {
                // If base class has refreshed the stream infos, then update the subtitle streams.
                ISubtitleStream subtitleStream = _tsReader as ISubtitleStream;
                if (subtitleStream != null)
                {
                    _streamInfoSubtitles = new TsReaderStreamInfoHandler(subtitleStream);
                }
            }
            return(refreshed);
        }
Exemple #2
0
        public override void SetSubtitle(string subtitle)
        {
            EnumerateStreams();
            TsReaderStreamInfoHandler tsStreamInfoHandler = _streamInfoSubtitles as TsReaderStreamInfoHandler;

            if (tsStreamInfoHandler == null)
            {
                return;
            }

            if (tsStreamInfoHandler.EnableStream(subtitle))
            {
                _subtitleRenderer.RenderSubtitles = !tsStreamInfoHandler.DisableSubs;
                SaveSubtitlePreference();
            }
        }