상속: IEnumerable, ICollection
예제 #1
0
        /// <summary>
        /// Constructor used in the MyLyrics configuration
        /// </summary>
        /// <param name="file"></param>
        public SimpleLRC(string file)
        {
            var textReader = new StreamReader(file);

            string line;

            _lyricLines = new ArrayList();
            _simpleLRCTimeAndLineArray = new ArrayList();

            while ((line = textReader.ReadLine()) != null)
            {
                var done         = false;
                var originalLine = true;
                while (done == false)
                {
                    done         = GetLRCinfoFromFile(ref line, originalLine);
                    originalLine = false;
                }
            }

            if (_simpleLRCTimeAndLineArray.Count > 0)
            {
                _simpleLRCTimeAndLineCollection =
                    new SimpleLRCTimeAndLineCollection(
                        (SimpleLRCTimeAndLine[])_simpleLRCTimeAndLineArray.ToArray(typeof(SimpleLRCTimeAndLine)));
                _isValid = true;
            }

            if (!string.IsNullOrEmpty(_lyricAsLRC))
            {
                _lyricAsPlainLyric = SimpleLRCFormat.LineLineRegex.Replace(_lyricAsLRC, string.Empty);
            }

            textReader.Close();
        }
        /// <summary>
        /// Constructor used in the MyLyrics configuration
        /// </summary>
        /// <param name="file"></param>
        public SimpleLRC(string file)
        {
            FileInfo fileInfo = new FileInfo(file);
            TextReader textReader = new StreamReader(file);

            string line = "";
            lyricLines = new ArrayList();
            simpleLRCTimeAndLineArray = new ArrayList();

            while ((line = textReader.ReadLine()) != null)
            {
                bool done = false;
                bool originalLine = true;
                while (done == false)
                {
                    done = getLRCinfoFromFile(ref line, originalLine);
                    originalLine = false;
                }
            }

            if (simpleLRCTimeAndLineArray.Count > 0)
            {
                simpleLRCTimeAndLineCollection =
                    new SimpleLRCTimeAndLineCollection(
                        (SimpleLRCTimeAndLine[]) simpleLRCTimeAndLineArray.ToArray(typeof (SimpleLRCTimeAndLine)));
                isValid = true;
            }

            if (!string.IsNullOrEmpty(lyricAsLRC))
            {
                lyricAsPlainLyric = SimpleLRCFormat.LineLineRegex.Replace(lyricAsLRC, string.Empty);
            }

            textReader.Close();
        }
예제 #3
0
        /// <summary>
        /// Constructor used in the MyLyrics configuration
        /// </summary>
        /// <param name="file"></param>
        public SimpleLRC(string file)
        {
            var textReader = new StreamReader(file);

            string line;
            _lyricLines = new ArrayList();
            _simpleLRCTimeAndLineArray = new ArrayList();

            while ((line = textReader.ReadLine()) != null)
            {
                var done = false;
                var originalLine = true;
                while (done == false)
                {
                    done = GetLRCinfoFromFile(ref line, originalLine);
                    originalLine = false;
                }
            }

            if (_simpleLRCTimeAndLineArray.Count > 0)
            {
                _simpleLRCTimeAndLineCollection =
                    new SimpleLRCTimeAndLineCollection(
                        (SimpleLRCTimeAndLine[]) _simpleLRCTimeAndLineArray.ToArray(typeof (SimpleLRCTimeAndLine)));
                _isValid = true;
            }

            if (!string.IsNullOrEmpty(_lyricAsLRC))
            {
                _lyricAsPlainLyric = SimpleLRCFormat.LineLineRegex.Replace(_lyricAsLRC, string.Empty);
            }

            textReader.Close();
        }
예제 #4
0
        public SimpleLRC(string artist, string title, string lyric)
        {
            _artist = artist;
            _title  = title;

            var separators = new[] { "\n" };
            var lines      = lyric.Split(separators, StringSplitOptions.None);

            _lyricLines = new ArrayList();
            _simpleLRCTimeAndLineArray = new ArrayList();

            for (var i = 0; i < lines.Length; i++)
            {
                var done         = false;
                var originalLine = true;
                var line         = lines[i];
                while (done == false)
                {
                    done         = GetLRCinfoFromFile(ref line, originalLine);
                    originalLine = false;
                }
            }

            if (_simpleLRCTimeAndLineArray.Count > 0)
            {
                _simpleLRCTimeAndLineCollection =
                    new SimpleLRCTimeAndLineCollection(
                        (SimpleLRCTimeAndLine[])_simpleLRCTimeAndLineArray.ToArray(typeof(SimpleLRCTimeAndLine)));
                _isValid = true;
            }

            var simpleLRCTimeAndLineArrayWithOffset = new ArrayList();

            int offsetInt;

            if (int.TryParse(_offset, out offsetInt))
            {
                for (var i = 0; i < _simpleLRCTimeAndLineArray.Count; i++)
                {
                    simpleLRCTimeAndLineArrayWithOffset.Add(
                        ((SimpleLRCTimeAndLine)_simpleLRCTimeAndLineArray[i]).IncludeOffset(offsetInt));
                }

                _simpleLRCTimeAndLineCollectionWithOffset =
                    new SimpleLRCTimeAndLineCollection(
                        (SimpleLRCTimeAndLine[])
                        simpleLRCTimeAndLineArrayWithOffset.ToArray(typeof(SimpleLRCTimeAndLine)));
            }
            else
            {
                _simpleLRCTimeAndLineCollectionWithOffset = _simpleLRCTimeAndLineCollection;
            }

            if (!string.IsNullOrEmpty(_lyricAsLRC))
            {
                _lyricAsPlainLyric = SimpleLRCFormat.LineLineRegex.Replace(_lyricAsLRC, string.Empty);
            }
        }
예제 #5
0
        /// <summary>
        /// Constructor used in the MyLyrics configuration
        /// </summary>
        /// <param name="file"></param>
        public SimpleLRC(string file)
        {
            FileInfo   fileInfo   = new FileInfo(file);
            TextReader textReader = new StreamReader(file);

            string line = "";

            lyricLines = new ArrayList();
            simpleLRCTimeAndLineArray = new ArrayList();

            while ((line = textReader.ReadLine()) != null)
            {
                bool done         = false;
                bool originalLine = true;
                while (done == false)
                {
                    done         = getLRCinfoFromFile(ref line, originalLine);
                    originalLine = false;
                }
            }

            if (simpleLRCTimeAndLineArray.Count > 0)
            {
                simpleLRCTimeAndLineCollection =
                    new SimpleLRCTimeAndLineCollection(
                        (SimpleLRCTimeAndLine[])simpleLRCTimeAndLineArray.ToArray(typeof(SimpleLRCTimeAndLine)));
                isValid = true;
            }

            if (!string.IsNullOrEmpty(lyricAsLRC))
            {
                lyricAsPlainLyric = SimpleLRCFormat.LineLineRegex.Replace(lyricAsLRC, string.Empty);
            }

            textReader.Close();
        }
        public SimpleLRC(string artist, string title, string lyric)
        {
            this.artist = artist;
            this.title = title;

            string[] separators = new string[1] {"\n"};
            string[] lines = lyric.Split(separators, StringSplitOptions.None);
            string line = "";
            lyricLines = new ArrayList();
            simpleLRCTimeAndLineArray = new ArrayList();

            for (int i = 0; i < lines.Length; i++)
            {
                bool done = false;
                bool originalLine = true;
                line = lines[i];
                while (done == false)
                {
                    done = getLRCinfoFromFile(ref line, originalLine);
                    originalLine = false;
                }
            }

            if (simpleLRCTimeAndLineArray.Count > 0)
            {
                simpleLRCTimeAndLineCollection =
                    new SimpleLRCTimeAndLineCollection(
                        (SimpleLRCTimeAndLine[]) simpleLRCTimeAndLineArray.ToArray(typeof (SimpleLRCTimeAndLine)));
                isValid = true;
            }

            simpleLRCTimeAndLineArrayWithOffset = new ArrayList();

            int offsetInt = 0;

            if (int.TryParse(offset, out offsetInt))
            {
                for (int i = 0; i < simpleLRCTimeAndLineArray.Count; i++)
                {
                    simpleLRCTimeAndLineArrayWithOffset.Add(
                        ((SimpleLRCTimeAndLine) simpleLRCTimeAndLineArray[i]).IncludeOffset(offsetInt));
                }

                simpleLRCTimeAndLineCollectionWithOffset =
                    new SimpleLRCTimeAndLineCollection(
                        (SimpleLRCTimeAndLine[])
                        simpleLRCTimeAndLineArrayWithOffset.ToArray(typeof (SimpleLRCTimeAndLine)));
            }
            else
            {
                simpleLRCTimeAndLineCollectionWithOffset = simpleLRCTimeAndLineCollection;
            }

            if (!string.IsNullOrEmpty(lyricAsLRC))
            {
                lyricAsPlainLyric = SimpleLRCFormat.LineLineRegex.Replace(lyricAsLRC, string.Empty);
            }
        }
예제 #7
0
        public SimpleLRC(string artist, string title, string lyric)
        {
            this.artist = artist;
            this.title  = title;

            string[] separators = new string[1] {
                "\n"
            };
            string[] lines = lyric.Split(separators, StringSplitOptions.None);
            string   line  = "";

            lyricLines = new ArrayList();
            simpleLRCTimeAndLineArray = new ArrayList();

            for (int i = 0; i < lines.Length; i++)
            {
                bool done         = false;
                bool originalLine = true;
                line = lines[i];
                while (done == false)
                {
                    done         = getLRCinfoFromFile(ref line, originalLine);
                    originalLine = false;
                }
            }

            if (simpleLRCTimeAndLineArray.Count > 0)
            {
                simpleLRCTimeAndLineCollection =
                    new SimpleLRCTimeAndLineCollection(
                        (SimpleLRCTimeAndLine[])simpleLRCTimeAndLineArray.ToArray(typeof(SimpleLRCTimeAndLine)));
                isValid = true;
            }

            simpleLRCTimeAndLineArrayWithOffset = new ArrayList();

            int offsetInt = 0;

            if (int.TryParse(offset, out offsetInt))
            {
                for (int i = 0; i < simpleLRCTimeAndLineArray.Count; i++)
                {
                    simpleLRCTimeAndLineArrayWithOffset.Add(
                        ((SimpleLRCTimeAndLine)simpleLRCTimeAndLineArray[i]).IncludeOffset(offsetInt));
                }

                simpleLRCTimeAndLineCollectionWithOffset =
                    new SimpleLRCTimeAndLineCollection(
                        (SimpleLRCTimeAndLine[])
                        simpleLRCTimeAndLineArrayWithOffset.ToArray(typeof(SimpleLRCTimeAndLine)));
            }
            else
            {
                simpleLRCTimeAndLineCollectionWithOffset = simpleLRCTimeAndLineCollection;
            }

            if (!string.IsNullOrEmpty(lyricAsLRC))
            {
                lyricAsPlainLyric = SimpleLRCFormat.LineLineRegex.Replace(lyricAsLRC, string.Empty);
            }
        }
예제 #8
0
        public SimpleLRC(string artist, string title, string lyric)
        {
            _artist = artist;
            _title = title;

            var separators = new[] {"\n"};
            var lines = lyric.Split(separators, StringSplitOptions.None);
            _lyricLines = new ArrayList();
            _simpleLRCTimeAndLineArray = new ArrayList();

            for (var i = 0; i < lines.Length; i++)
            {
                var done = false;
                var originalLine = true;
                var line = lines[i];
                while (done == false)
                {
                    done = GetLRCinfoFromFile(ref line, originalLine);
                    originalLine = false;
                }
            }

            if (_simpleLRCTimeAndLineArray.Count > 0)
            {
                _simpleLRCTimeAndLineCollection =
                    new SimpleLRCTimeAndLineCollection(
                        (SimpleLRCTimeAndLine[]) _simpleLRCTimeAndLineArray.ToArray(typeof (SimpleLRCTimeAndLine)));
                _isValid = true;
            }

            var simpleLRCTimeAndLineArrayWithOffset = new ArrayList();

            int offsetInt;

            if (int.TryParse(_offset, out offsetInt))
            {
                for (var i = 0; i < _simpleLRCTimeAndLineArray.Count; i++)
                {
                    simpleLRCTimeAndLineArrayWithOffset.Add(
                        ((SimpleLRCTimeAndLine) _simpleLRCTimeAndLineArray[i]).IncludeOffset(offsetInt));
                }

                _simpleLRCTimeAndLineCollectionWithOffset =
                    new SimpleLRCTimeAndLineCollection(
                        (SimpleLRCTimeAndLine[])
                            simpleLRCTimeAndLineArrayWithOffset.ToArray(typeof (SimpleLRCTimeAndLine)));
            }
            else
            {
                _simpleLRCTimeAndLineCollectionWithOffset = _simpleLRCTimeAndLineCollection;
            }

            if (!string.IsNullOrEmpty(_lyricAsLRC))
            {
                _lyricAsPlainLyric = SimpleLRCFormat.LineLineRegex.Replace(_lyricAsLRC, string.Empty);
            }
        }