Beispiel #1
0
        /// <summary>
        /// Write all frames to specific TagStream
        /// </summary>
        /// <param name="writer">TagStream to write data to</param>
        /// <param name="Ver">Minor Version of ID3</param>
        private void WriteFrames(int Ver)
        {
            foreach (FrameCollectionBase Coll in _CollectionFrames.Values)
            {
                if (Coll.Name != CollectionIndex.Unknown.ToString() ||
                    (Coll.Name == CollectionIndex.Unknown.ToString() && !_DropUnknown))
                {
                    foreach (Frame Fr in Coll)
                    {
                        // If Frame is not valid and is not UserTextFrame we ignore it
                        if (!FramesInfo.IsCompatible(Fr.FrameID, Ver) && FramesInfo.IsTextFrame(Fr.FrameID, Ver) != 2)
                        {
                            AddError(new ID3Exception("nonCompatible Frame found on Frames and will not save with file", Fr.FrameID, ExceptionLevels.Warning));
                            continue;
                        }

                        if (Fr.IsValid)
                        {
                            Fr.WriteData(Ver);
                        }
                    }
                }
            }

            foreach (Frame Fr in _SingleFrames.Values)
            {
                if (FramesInfo.IsCompatible(Fr.FrameID, Ver) && Fr.IsValid)
                {
                    Fr.WriteData(Ver);
                }
            }
        }