Esempio n. 1
0
        private void MenuItem_Subtitle_Click(object sender, RoutedEventArgs e)
        {
            loadFileClass = new LoadFileClass();

            //取得對話框訊息
            OpenFileDialog fileDialog = loadFileClass.openFileDialog();

            if (string.IsNullOrEmpty(fileDialog.FileName))
            {
                return;
            }

            //取得完整路徑
            sub_path = fileDialog.FileName;
            //取得檔名
            sub_name = fileDialog.SafeFileName;

            srtModel = SrtHelper.ParseSrt(sub_path);

            int timeMiles = (int)main_Command.mediaTimePosition * 1000;

            string timeString = SrtHelper.GetTimeString(timeMiles);

            Subtitle_TextBlock.Text = timeString;
        }
Esempio n. 2
0
        private void subtitle_calculator()
        {
            if (srtModel != null)
            {
                int timeMiles = (int)main_Command.mediaTimePosition * 1000 + 800;

                string timeString = SrtHelper.GetTimeString(timeMiles);

                Subtitle_TextBlock.Text = timeString;
            }
        }