public override string ToString() { string result = "[#0000]"; if (NoteType == NoteTypeInTmpUST.Next) { result = "[#NEXT]"; } else if (NoteType == NoteTypeInTmpUST.Prev) { result = "[#PREV]"; } else if (NoteType == NoteTypeInTmpUST.Delete) { result = "[#DELETE]"; } else if (NoteType == NoteTypeInTmpUST.Insert) { result = "[#INSERT]"; } int i, end = Datas.NoteProperty.Length; for (i = 0; i < end; ++i) { if (HasValue(Datas.NoteProperty[i])) { result += Functs.NextLine(Datas.NoteProperty[i] + "=" + GetValue(Datas.NoteProperty[i]).ToString()); } } return(result); }
private void Converter() { string output = TB_OLyric.Text; if (output != "") { TB_CLyric.Text = Functs.Han2Pin(output, PList); } }
private void ReadLang() { string langfile = "lang"; if (File.Exists(langfile)) { string readtoend = File.ReadAllText(langfile, Functs.GetEncoding(langfile)); CB_Lang.SelectedItem = readtoend; File.Delete(langfile); } }
private string ParseStr(string lyric) { string tmpclearlyric = lyric; string prefix = Functs.GetLyricPrefix(tmpclearlyric); string postfix = Functs.GetLyricPostfix(tmpclearlyric); if (prefix != "") { tmpclearlyric = tmpclearlyric.Replace(prefix, ""); } if (postfix != "") { tmpclearlyric = tmpclearlyric.Replace(postfix, ""); } return(tmpclearlyric); }
private void Parse(string lyric) { _ClearlyLyric = lyric; string prefix = Functs.GetLyricPrefix(_ClearlyLyric); string postfix = Functs.GetLyricPostfix(_ClearlyLyric); if (prefix != "") { _ClearlyLyric = _ClearlyLyric.Replace(prefix, ""); } if (postfix != "") { _ClearlyLyric = _ClearlyLyric.Replace(postfix, ""); } _FixName = Functs.GetLyricPPFixName(prefix, postfix); }
private void BTN_Import_Click(object sender, EventArgs e) { if (OFD.ShowDialog() == DialogResult.OK) { if (CB_ClearLyric.Checked) { TB_OLyric.Text = ""; } foreach (string file in OFD.FileNames) { if (TB_OLyric.Text.Length >= 2 && TB_OLyric.Text.Substring(TB_OLyric.Text.Length - 2, 2) != "\r\n") { TB_OLyric.Text += "\r\n"; } TB_OLyric.Text += File.ReadAllText(file, Functs.GetEncoding(file)); } } }
public TmpUst(string ustfile, bool ispath = false) { string readtoend = ustfile; _FilePath = ustfile; if (ispath) { if (File.Exists(ustfile)) { readtoend = File.ReadAllText(ustfile, Functs.GetEncoding(ustfile)); } else { readtoend = ""; } } Parse(readtoend); }
private void Parse(string envelope) { try { envelope = Functs.RemoveAllSpaces(envelope); string[] senvelope = envelope.Split(new char[] { ',' }); double[] senveloped = new double[senvelope.Length]; if (senvelope.Length >= 7) { int i; for (i = 0; i < senvelope.Length; ++i) { if (senvelope[i] != "%" && senvelope[i] != "") { senveloped[i] = Convert.ToDouble(senvelope[i]); } else { senveloped[i] = 0; } } P1.X = senveloped[0]; P2.X = senveloped[1]; P3.X = senveloped[2]; P1.Y = senveloped[3]; P2.Y = senveloped[4]; P3.Y = senveloped[5]; P4.Y = senveloped[6]; } if (senvelope.Length >= 9) { P4.X = senveloped[8]; } if (senvelope.Length >= 10) { P5.X = senveloped[9]; } if (senvelope.Length >= 11) { P5.Y = senveloped[10]; } } catch (Exception ex) { throw new Exception("Parse envelope error.\n" + ex.ToString()); } }
private void Parse(string vbr) { try { if (vbr == "") { return; } vbr = Functs.RemoveAllSpaces(vbr); string[] svbr = vbr.Split(new char[] { ',' }); Length = Convert.ToDouble(svbr[0]); Period = Convert.ToDouble(svbr[1]); Depth = Convert.ToDouble(svbr[2]); FadeIn = Convert.ToDouble(svbr[3]); FadeOut = Convert.ToDouble(svbr[4]); Phase = Convert.ToDouble(svbr[5]); Offset = Convert.ToDouble(svbr[6]); } catch (Exception ex) { throw new Exception("Parse VBR error.\n" + ex.ToString()); } }
private void Parse(string pbs) { try { if (pbs == "") { return; } pbs = Functs.RemoveAllSpaces(pbs); string[] spbs = pbs.Split(new char[] { ';' }); if (spbs.Length >= 1) { P.X = Convert.ToDouble(spbs[0]); } if (spbs.Length >= 2) { P.Y = Convert.ToDouble(spbs[1]); } } catch (Exception ex) { throw new Exception("Parse PBS error.\n" + ex.ToString()); } }
private void Parse(string pby) { try { if (pby == "") { return; } pby = Functs.RemoveAllSpaces(pby); string[] spby = pby.Split(new char[] { ',' }); int i; for (i = 0; i < spby.Length; ++i) { try { Ps.Add(Convert.ToDouble(spby[i])); } catch { Ps.Add(0); } } } catch (Exception ex) { throw new Exception("Parse PBY error.\n" + ex.ToString()); } }
private void Parse(string pbm) { try { if (pbm == "") { return; } pbm = Functs.RemoveAllSpaces(pbm); string[] spbm = pbm.Split(new char[] { ',' }); int i; for (i = 0; i < spbm.Length; ++i) { try { Ps.Add(spbm[i][0]); } catch { Ps.Add(' '); } } } catch (Exception ex) { throw new Exception("Parse PBM error.\n" + ex.ToString()); } }
public override string ToString() { string result = "[#VERSION]"; result += Functs.NextLine(Version); int i, end = Datas.USTVersionProperty.Length; result += Functs.NextLine("[#SETTING]"); end = Datas.USTSettingProperty.Length; for (i = 0; i < end; ++i) { if (HasValue(Datas.USTSettingProperty[i])) { result += Functs.NextLine(Datas.USTSettingProperty[i] + "=" + GetValue(Datas.USTSettingProperty[i]).ToString()); } } end = _Notes.Count; for (i = 0; i < end; ++i) { result += Functs.NextLine(_Notes[i].ToString()); } return(result); }
public Bitmap To1D(UstColor ustcolor, int width, int height, double times, int xscroll) { return(Functs.UstTo1D(this, ustcolor, width, height, times, xscroll)); }