Page 1 of 1

Working with gtags

Posted: Mon Jul 29, 2013 12:47 pm
by Benji99
Hi Dimitri,

I'm trying to get my script to work and I need to use gtags...
Looking at my old scripts, I was using a function called on_getGrdRowCount to get the number of audio tracks in the folder.
I would then use a for loop to cycle through the files and tag appropriately. It seems that on_getGrdRowCount is no longer a valid function, has it been replaced by something else? In the documentation, I found this function: on_getGrdAlbumRowCount, but it only returns 0...

Also while I'm at it, the functions on_setGrdRow and on_loadFile still work?

Thanks in advance!
Sebastien

Re: Working with gtags

Posted: Mon Jul 29, 2013 4:20 pm
by jtclipper
Since the Online panel merged with the tag and other panels those functions are replaced with the equivalent tg_ ones

so in order to get through the files you need the standard

Code: Select all

  tg_Init;
  repeat
    tg_LoadFile; 
    // do something here
   
  until not tg_Skip;
(The on_getGrdAlbumRowCount returns the rowcount of the Online mini panel's track grid)

Re: Working with gtags

Posted: Mon Jul 29, 2013 5:28 pm
by Benji99
Hi Dimitris,

Sorry to bother you again, need a small clarification...

I used to use gTag.ExtraFieldsAdd( 'string', 'string' ); but it seems you added another attribute bComment: boolean = false. what is it for? I tried it would be True and False and don't see any difference with the results.

Thanks!

Re: Working with gtags

Posted: Mon Jul 29, 2013 6:00 pm
by jtclipper
This is of minor importance, it is used to store 'user comments' an ID3 specific structure that allows multiple comments with a description.

Code: Select all

//This will add an ID3v2 user comment with 'My rating' as it's description
gTag.ExtraFieldsAdd( 'COMMENT/My rating', 'abc abc', true );

//This will add a User field as usual
gTag.ExtraFieldsAdd( 'My rating', 'abc abc', false );