public void AddTofnTag() { EditTextFrame artistFrame = GetTextFrame(FrameFactory.TitleFrameId); EditTextFrame titleFrame = GetTextFrame(FrameFactory.LeadArtistFrameId); if (artistFrame == null && titleFrame == null) { return; } string fileName; if (artistFrame == null) { fileName = titleFrame.Text; } else if (titleFrame == null) { fileName = artistFrame.Text; } else { fileName = GetFileName(artistFrame.Text, titleFrame.Text); } ChangeOrCreateTextFrame(FrameFactory.OriginalFilenameFrameId, fileName); }
public void Reload() { parent = new ID3File(source); if (parent.ID3v1Tag == null) { parent.ID3v1Tag = new ID3v1Tag(); } if (parent.ID3v2Tag == null) { parent.ID3v2Tag = new ID3v2Tag(); } V1Tag = new EditID3v1Tag(parent.ID3v1Tag); V2Tag = new EditID3v2Tag(parent.ID3v2Tag); Title = new PropertySynchronizer(V1Tag, V2Tag, nameof(V1Tag.Title), FrameFactory.TitleFrameId); Artist = new PropertySynchronizer(V1Tag, V2Tag, nameof(V1Tag.Artist), FrameFactory.LeadArtistFrameId, FrameFactory.BandFrameId); Album = new PropertySynchronizer(V1Tag, V2Tag, nameof(V1Tag.Album), FrameFactory.AlbumFrameId); TrackNumber = new PropertySynchronizer(V1Tag, V2Tag, nameof(V1Tag.TrackNumber), FrameFactory.TrackNumberFrameId); Year = new PropertySynchronizer(V1Tag, V2Tag, nameof(V1Tag.Year), FrameFactory.YearFrameId); FileName = new FileNameSynchronizer(this); }