コード例 #1
0
 public void Add(SoundLine l)
 {
     if (!Exists(l))
     {
         this.lines.Insert(this.lines.Count - 1, l);
     }
 }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        public bool Exists(SoundLine l)
        {
            bool isPreExisting = false;

            foreach (SoundLine line in this.lines)
            {
                if (line.Equals(l))
                {
                    isPreExisting = true;
                }
            }



            return(isPreExisting);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }