示例#1
0
        private void updateinfo()
        {
            txtInfo.Text = "";
            step         = VbX.CInt(txtScale.Text);
            if (step == 0)
            {
                step = 1;
            }


            txtInfo.Text += "Input  Frequency   :" + Frequency.ToString() + nl;
            txtInfo.Text += "Filelength         :" + FileLength.ToString() + nl;

            Bitdepth = VbX.CInt(VbX.Left(cboBitDepth.Text, 1));


            if (cboBitDepth.Text == "CPC+ DMA")
            {
                Bitdepth = 16;
            }
            Single dividor = 8 / Bitdepth;

            if (dividor <= 0)
            {
                dividor = 1;
            }
            //if (cboBitDepth.Text == "CPC+ DMA") { dividor = 0.5F; }
            txtInfo.Text += "Output Frequency   :" + (Frequency / step).ToString() + nl;
            txtInfo.Text += "Output Size (bytes):" + ((FileLength / step) / dividor).ToString() + nl;
            DestFile      = txtSrc.Text.ToLower().Replace(".wav", Bitdepth.ToString() + "-" + step.ToString() + ".raw");
        }
示例#2
0
    public static string GetItem(string lin, string ch, int pos, string brackets)
    {
        if (lin.Length == 0 || ch.Length == 0)
        {
            return("");
        }
        string bracketarray = "";
        string part         = "";
        int    foundnum     = 0;

        for (int i = 1; i <= lin.Length; i++)
        {
            string c = VbX.Mid(lin, i, 1);
            if (c == ch & string.IsNullOrEmpty(bracketarray))
            {
                if (foundnum == pos)
                {
                    return(part);
                }
                else
                {
                    part = ""; foundnum = foundnum + 1;
                }
            }
            else
            {
                part = part + c;
            }

            //    MsgBox(c)
            if (c == VbX.Chr(34) & VbX.InStr(brackets, VbX.Chr(34)) > 0)
            {
                if (VbX.Right(bracketarray, 1) == VbX.Chr(34) & !string.IsNullOrEmpty(bracketarray))
                {
                    bracketarray = VbX.Left(bracketarray, VbX.Len(bracketarray) - 1);
                }
                else
                {
                    bracketarray = bracketarray + VbX.Chr(34);
                }
                //part = part + c
            }
            else if ((c == "(" | c == ")") & VbX.InStr(brackets, "(") > 0)
            {
                if (VbX.Right(bracketarray, 1) == "(" & c == ")" & !string.IsNullOrEmpty(bracketarray))
                {
                    bracketarray = VbX.Left(bracketarray, VbX.Len(bracketarray) - 1);
                }
                else
                {
                    bracketarray = bracketarray + "(";
                }
                //part = part + c
            }
            else if ((c == "{" | c == "}") & VbX.InStr(brackets, "{") > 0)
            {
                if (VbX.Right(bracketarray, 1) == "{" & c == "}" & !string.IsNullOrEmpty(bracketarray))
                {
                    bracketarray = VbX.Left(bracketarray, VbX.Len(bracketarray) - 1);
                }
                else
                {
                    bracketarray = bracketarray + "{";
                }
                //part = part + c
            }
        }
        if (foundnum == pos)
        {
            return(part);
        }
        if (pos == -1)
        {
            return(foundnum.ToString());
        }
        return("");
    }