Logo Search packages:      
Sourcecode: f-spot version File versions  Download package

override void TagLib::Asf::File::Save (  )  [inline, virtual]

Saves the changes made in the current instance to the file it represents.

Implements TagLib::File.

Definition at line 180 of file File.cs.

References TagLib::Asf::HeaderExtensionObject::AddUniqueObject(), TagLib::Asf::HeaderObject::AddUniqueObject(), TagLib::ByteVector::Count, TagLib::Asf::HeaderObject::Extension, TagLib::File::Insert(), TagLib::File::InvariantEndPosition, TagLib::File::InvariantStartPosition, TagLib::File::Mode, TagLib::Asf::Object::OriginalSize, TagLib::Asf::HeaderObject::RemoveContentDescriptors(), TagLib::Asf::HeaderObject::Render(), TagLib::File::TagTypes, and TagLib::File::TagTypesOnDisk.

            {
                  Mode = AccessMode.Write;
                  try {
                        HeaderObject header = new HeaderObject (this, 0);
                        
                        if (asf_tag == null) {
                              header.RemoveContentDescriptors ();
                              TagTypesOnDisk &= ~ TagTypes.Asf;
                        } else {
                              TagTypesOnDisk |= TagTypes.Asf;
                              header.AddUniqueObject (
                                    asf_tag.ContentDescriptionObject);
                              header.AddUniqueObject (
                                    asf_tag.ExtendedContentDescriptionObject);
                              header.Extension.AddUniqueObject (
                                    asf_tag.MetadataLibraryObject);
                        }
                        
                        ByteVector output = header.Render ();
                        long diff = output.Count - (long) header.OriginalSize;
                        Insert (output, 0, (long) header.OriginalSize);
                        
                        InvariantStartPosition += diff;
                        InvariantEndPosition += diff;
                  } finally {
                        Mode = AccessMode.Closed;
                  }
            }


Generated by  Doxygen 1.6.0   Back to index