private void LoadSubtitleFile(string file)
        {
            if (Player.State == PlayerState.Closed)
            {
                m_SubtitleFile = file;
                //Player.OsdText.Show("Subtitle will be loaded with media", 3000); //Doesn't seem to work
                return;
            }

            Media.Pause(false);
            var subtitleLoaded = string.Format("Subtitle Loaded: {0}", Path.GetFileName(file));

            Player.OsdText.Show(SubtitleManager.LoadFile(file)
                ? subtitleLoaded
                : "Impossible to load Subtitle file.");
            Media.Play(false);
        }
Esempio n. 2
0
        private void PlayerStateChanged(object sender, PlayerStateEventArgs e)
        {
            if (e.OldState == PlayerState.Closed)
            {
                starTiming = SubtitleManager.GetTiming();
                if (starTiming == null)
                {
                    return;
                }

                SetDefaultCurrentTiming();

                m_AddDelayMenu.Enabled   = true;
                m_MinusDelayMenu.Enabled = true;
                m_ResetDelayMenu.Enabled = true;
            }
            else if (e.NewState == PlayerState.Closed)
            {
                m_AddDelayMenu.Enabled   = false;
                m_MinusDelayMenu.Enabled = false;
                m_ResetDelayMenu.Enabled = false;
            }
        }