Page 1 of 1

Alternative to gTag.ResetData

Posted: Wed Feb 19, 2014 12:59 am
by Benji99
Hi Dimitri,

I've been reworking one of my scripts and noticed that I'm not able to use the command gTag.ResetData anymore to wipe all tags before making any changes.

Is there an alternative that I can use?

Thanks in advance

Sebastien

Re: Alternative to gTag.ResetData

Posted: Wed Feb 19, 2014 2:48 pm
by jtclipper
I am afraid this method has changed and is not public anymore, you have to clear the fields you want manually

For example:

Code: Select all

with gTag do begin
   //standard    
   Track := '';
   Artist := '';
   Title := '';
   Album := '';
   Genre := '';
   Year := '';
   Comment := '';
   Language := '';
   Composer := '';
   Copyright := '';
   URL := '';
   EncodedBy := '';
   AlbumArtist := '';
   OrigArtist := '';
   Publisher := '';
   BPM := '';
   DiscNumber := '';
   Tones := '';
   Styles := '';
   Mood := '';
   Situation := '';
   Rating := '';
   Quality := '';
   Tempo := '';
   Type_ := '';
   OrigAlbum := '';
   OrigYear := '';
   MixArtist := '';
   // extended fields
   OriginalFilename := '';
   FileOwner := '';
   InternetRadioStationName := '';
   InternetRadioStationOwner := '';
   Subtitle := '';
   ContentGroup := '';
   Conductor := '';
   MediaType := '';
   EncoderSettings := '';
   ISRC := '';
   Compilation := false;
   //sorting
   sortArtist := '';
   sortAlbum := '';
   sortAlbumArtist  := '';
   sortTitle := '';
   sortComposer := '';
   // iPLS URL's
   InvolvedPeople := '';
   WWWCommercialInfo := '';
   WWWCopyright := '';
   WWWAudioFile := '';
   WWWArtist := '';
   WWWAudioSource := '';
   WWWRadioPage := '';
   WWWPayment := '';
   WWWPublisher := '';
   //lyrics
   Lyrics := '';
   Lyricist := '';
   OrigLyricist := '';
   //pictures
   ClearPictures;
   //user fields
   ExtraFieldsRemove;
end;
If you think it's usefull to have something like that I could add it in the next beta builds

Re: Alternative to gTag.ResetData

Posted: Wed Feb 19, 2014 3:27 pm
by Benji99
Thanks for the information, although I have used some other custom tags in the past and I'd have to add all of the possibilities.
Because I was designing my scripts to be scrape and tag perfectly, and always strove to keep my tags clean of unneeded or unnused information, I was using the resetdata function to make sure the result after running the script was exactly what I wanted.

It would be really nice if you could re-implement it, in the meantime, I'll probably just remove all tags in Foobar before proceeding with running my script in TGF.

Thanks big time for the continued development!

Sebastien

Re: Alternative to gTag.ResetData

Posted: Wed Feb 19, 2014 4:15 pm
by jtclipper
I'll bring back ResetData in this or the next beta build.

Also keep in mind that

Code: Select all

gTag.ExtraFieldsRemove;
Resets all user tag fields, (those that appear in the full edit dialog under the User field page)

If you want to remove tags you could use Tools/Delete/All tags or use this in your script

Code: Select all

gTag.RemoveFromFile( 0, false, true );

Re: Alternative to gTag.ResetData

Posted: Wed Feb 19, 2014 6:13 pm
by Benji99
jtclipper wrote:I'll bring back ResetData in this or the next beta build.

Also keep in mind that

Code: Select all

gTag.ExtraFieldsRemove;
Resets all user tag fields, (those that appear in the full edit dialog under the User field page)

If you want to remove tags you could use Tools/Delete/All tags or use this in your script

Code: Select all

gTag.RemoveFromFile( 0, false, true );

Code: Select all

gTag.RemoveFromFile( 0, false, true );
Sounds like it does exactly what I want, maybe you don't need to add back ResetData? Is there a difference?

Re: Alternative to gTag.ResetData

Posted: Wed Feb 19, 2014 7:02 pm
by jtclipper
ResetData will make things a bit faster it will basically 'remove' the tag without saving the file back to disk until the rest of the script take care of that