Exemplo n.º 1
0
        private int CalcularLineas(AviSynthClip avs, string PreviewFile, lineaASS actual)
        {
            int nLineas;

            //lineaASS actual = (lineaASS)lass.Clone();

            TextWriter o = new StreamWriter(PreviewFile, false, System.Text.Encoding.UTF8);
            o.WriteLine(headerMark);
            o.WriteLine(script.GetHeader().ToString());

            o.WriteLine(stylesMark);
            foreach (estiloV4 e2 in script.GetStyles())
            {
                if (e2.Name.Equals(actual.estilo))
                {
                    estiloV4 new_est = new estiloV4(e2.ToString());
                    new_est.PrimaryColor = "&H00FFFFFF";
                    new_est.SecondaryColor = "&H00FFFFFF";
                    new_est.OutlineColor = "&H00FFFFFF";
                    new_est.ShadowColor = "&H00FFFFFF";
                    o.WriteLine(new_est.ToString().Replace("\n", string.Empty));
                }
            }

            o.WriteLine(); // ---

            o.WriteLine(dialoguesMark);

            actual.t_inicial.setTiempo(0);
            actual.t_final.setTiempo(50);
            o.WriteLine(actual.ToString());

            o.Close();

            avs.AviSynthInvoke(avs.GetAVS(), 0, "Eval", false, "blankclip(color=$000000,width=" + width + ",height=" + height + ")");
            avs.AviSynthInvoke(avs.GetAVS(), 0, "TextSub", true, PreviewFile);

            Image iimg = (Image)AviSynthFunctions.getBitmapFromFrame(avs, 0, 0);

            int x,y,x2,y2;

            nLineas = ContarLineas(iimg, out x, out y, out x2, out y2);

            iimg.Dispose();

            File.Delete(PreviewFile);
            return nLineas;
        }
Exemplo n.º 2
0
        private void makeTempFile()
        {
            TextWriter o = new StreamWriter(PreviewFile, false, System.Text.Encoding.UTF8);
            o.WriteLine(mW.headerMark);
            o.WriteLine("PlayResY: " + textPlayResY.Text);
            o.WriteLine();
            o.WriteLine(mW.stylesMark);
            estiloV4 e = (estiloV4)mW.v4[listBox1.SelectedIndex];
            estiloV4 e2 = new estiloV4(e.ToString());

            switch (e.Alignment)
            {
                case 4:
                case 7:
                    e2.Alignment = 1;
                    break;
                case 5:
                case 8:
                    e2.Alignment = 2;
                    break;
                case 6:
                case 9:
                    e2.Alignment = 3;
                    break;
                default:
                    e2.Alignment = e.Alignment;
                    break;
            }

            o.WriteLine(e2.ToString());
            o.WriteLine();
            o.WriteLine(mW.dialoguesMark);
            lineaASS l = new lineaASS();
            if (checkBox2.Checked)
                l.texto = "{\\be1}"+previewText.Text;
            else l.texto = previewText.Text;
            l.estilo = e.Name;
            l.t_final.setTiempo(50);
            o.WriteLine(l.ToString());
            o.Close();
        }
Exemplo n.º 3
0
 internal SpellCheckError(string badWordFound, lineaASS line, int lineNumber, int pos)
 {
     linea = new lineaASSidx(line.ToString(), lineNumber);
     posicion = pos;
     badWord = badWordFound;
 }