Ejemplo n.º 1
0
 private void MuxMsg(object sender, ExternalTool.MsgEventArgs e)
 {
     try
     {
         logWindow.MessageMux(e.Message.Replace("\b", "").Trim());
         string[] tmp = e.Message.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
         if (tmp.Length == 2 && tmp[1].Contains("%"))
         {
             int percent = 0;
             try
             {
                 percent = Convert.ToInt32(tmp[1].Replace("%", " "));
             }
             catch (Exception)
             {
             }
             if (percent > 0)
             {
                 UpdateStatusBar(percent);
             }
         }
     }
     catch (Exception)
     {
     }
     
 }
Ejemplo n.º 2
0
 private void SubtitleMsg(object sender, ExternalTool.MsgEventArgs e)
 {
     string tmp = e.Message.Replace("\b", "").Trim();
     if (!tmp.StartsWith("#>") && !tmp.StartsWith("Decoding frame") && !tmp.StartsWith("#<"))
     {
         logWindow.MessageSubtitle(tmp);
     }
 }
Ejemplo n.º 3
0
 private void DemuxMsg(object sender, ExternalTool.MsgEventArgs e)
 {
     logWindow.MessageDemux(e.Message.Replace("\b", "").Trim());
 }
Ejemplo n.º 4
0
        private void EncodeMsg(object sender, ExternalTool.MsgEventArgs e)
        {
            string text = e.Message;

            if (!settings.use64bit)
            {
                int start = text.IndexOf('[');
                int end = text.IndexOf(']');
                if (start == 0 && end > 0)
                {                    
                    int index = settings.lastProfile;
                    string substr = text.Substring(start + 1, end - start - 2);
                    if (substr != lastMsg)
                    {
                        lastMsg = substr;
                        
                        
                        double percent = 0.0;
                        double add = 0.0;
                        if (secondPass) add = 100.0;
                        try
                        {
                            percent = Convert.ToDouble(substr.Replace(".",","));
                        }
                        catch (Exception)
                        {
                        }
                        if (percent > 0.0)
                        {
                            UpdateStatusBar(percent + add);
                        }
                        if (percent % 1.0 == 0)
                        {
                            if (index > -1 && settings.encodingSettings[index].pass2)
                            {
                                if (!secondPass)
                                {
                                    UpdateStatus(Global.Res("StatusBar") + " " + Global.ResFormat("StatusBarEncodeFirstPass", text));
                                }
                                else
                                {
                                    UpdateStatus(Global.Res("StatusBar") + " " + Global.ResFormat("StatusBarEncodeSecondPass", text));
                                }
                            }
                            else
                            {
                                UpdateStatus(Global.Res("StatusBar") + " " + Global.ResFormat("StatusBarEncode", text));
                            }
                            logWindow.MessageEncode(text);
                        }
                    }
                }
                else
                {
                    logWindow.MessageEncode(text);
                }
            }
            else
            {                
                string[] tmp = text.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                if (tmp.Length > 2 && tmp[1].ToUpper() == "FRAMES:")
                {
                    int frame = 0;
                    int maxFrames = 0;
                    maxFrames = GetMaxFrames();
                    try
                    {
                        frame = Convert.ToInt32(tmp[0]);
                    }
                    catch (Exception)
                    {
                    }
                    if (frame > 0 && maxFrames > 0)
                    {
                        double add = 0;
                        if (secondPass) add = maxFrames;
                        UpdateStatusBar(frame + add);
                        if (frame % 100 == 0)
                        {
                            float f = (float)((double)frame / (double)maxFrames);
                            logWindow.MessageEncode(text);
                            int index = settings.lastProfile;
                            if (index > -1 && settings.encodingSettings[index].pass2)
                            {
                                if (!secondPass)
                                {
                                    UpdateStatus(Global.Res("StatusBar") + " " + Global.ResFormat("StatusBarEncodeFirstPass", f.ToString("p1")));
                                }
                                else
                                {
                                    UpdateStatus(Global.Res("StatusBar") + " " + Global.ResFormat("StatusBarEncodeSecondPass", f.ToString("p1")));
                                }
                            }
                            else
                            {
                                UpdateStatus(Global.Res("StatusBar") + " " + Global.ResFormat("StatusBarEncode", f.ToString("p1")));
                            }
                        }
                    }
                }
                else
                {
                    logWindow.MessageEncode(text);
                }
            }
        }