/// <summary> /// Set the frame full text /// </summary> /// <param name="frameId">Frame type</param> /// <param name="message">Value set in frame</param> private void SetFullTextFrame(string frameId, string message) { var frame = FindFrame(frameId); if (frame != null) { if (!String.IsNullOrEmpty(message)) { FrameFullText framefulltext = (FrameFullText)frame; framefulltext.Text = message; framefulltext.TextCode = _textCode; framefulltext.Description = string.Empty; framefulltext.Language = _language; } else { _frameModel.Remove(frame); } } else { if (!String.IsNullOrEmpty(message)) { FrameFullText frameLCText = (FrameFullText)FrameFactory.Build(frameId); frameLCText.TextCode = this._textCode; frameLCText.Language = "eng"; frameLCText.Description = string.Empty; frameLCText.Text = message; _frameModel.Add(frameLCText); } } }
private TagModel GetFrameModel() { var frameModel = new TagModel(); var frameText = new FrameText("TIT2"); frameText.TextCode = TextCode.Ascii; frameText.Text = _song; frameModel.Add(frameText); frameText = new FrameText("TPE1"); frameText.TextCode = TextCode.Ascii; frameText.Text = _artist; frameModel.Add(frameText); frameText = new FrameText("TALB"); frameText.TextCode = TextCode.Ascii; frameText.Text = _album; frameModel.Add(frameText); frameText = new FrameText("TYER"); frameText.TextCode = TextCode.Ascii; frameText.Text = _year; frameModel.Add(frameText); frameText = new FrameText("TRCK"); frameText.TextCode = TextCode.Ascii; frameText.Text = _track.ToString(CultureInfo.InvariantCulture); frameModel.Add(frameText); var frameFullText = new FrameFullText("COMM"); frameFullText.TextCode = TextCode.Ascii; frameFullText.Language = "eng"; frameFullText.Description = ""; frameFullText.Text = _comment; frameModel.Add(frameFullText); if (_genre >= 0 && _genre < _genres.Length) { // from suggestion in http://sourceforge.net/tracker2/?func=detail&aid=920249&group_id=89188&atid=589317 frameText = new FrameText("TCON"); frameText.TextCode = TextCode.Ascii; frameText.Text = _genres[_genre]; frameModel.Add(frameText); } //TODO: Fix this code!!!!!!!! frameModel.Header.TagSize = 0; //TODO: Invalid size, not filled in until write frameModel.Header.Version = 3; // ID3v2.[3].[0] frameModel.Header.Revision = 0; frameModel.Header.Unsync = false; frameModel.Header.Experimental = false; frameModel.Header.Footer = false; frameModel.Header.ExtendedHeader = false; return(frameModel); }