public void Add(SoundLine l) { if (!Exists(l)) { this.lines.Insert(this.lines.Count - 1, l); } }
private List <byte> representation; //fileBody + ",*****\n" public SoundLine Clone() //creates and returns a clone of itself { if (this.path == null && this.fileBody == null) { return(new SoundLine()); } else { SoundLine clonedLine = new SoundLine(this.path, this.fileBody + ".WAV"); return(clonedLine); } }
public bool Exists(SoundLine l) { bool isPreExisting = false; foreach (SoundLine line in this.lines) { if (line.Equals(l)) { isPreExisting = true; } } return(isPreExisting); }
public string GetPathFromBody(string bodyParam) { string pathRet = null; string body = bodyParam; if (body.EndsWith(".WAV")) { body = body.TrimEnd('.', 'W', 'A', 'V'); } for (int ii = 0; ii < this.lines.Count; ii++) { SoundLine sL = lines[ii]; if (sL.fileBody == body) { pathRet = sL.path; break; } } return(pathRet); }
public bool Equals(SoundLine line) { bool isEqual = true; if (this.fileBody != line.fileBody) { isEqual = false; } if (this.path != line.path) { isEqual = false; } if (this.representation != line.representation) { isEqual = false; } return(isEqual); }