Scripting

Use this forum for everything concerning script usage
Post Reply
viply1
Newbie
Newbie
Posts: 4
Joined: Fri Feb 21, 2014 6:56 am

Scripting

Post by viply1 »

Hi,

Just need a small help in scripting

When i load the cover from an album the description says 'album cover' in description of the artwork

I however want it to be blank. any solution how i can go about changing it?

User avatar
jtclipper
Administrator
Administrator
Posts: 768
Joined: Tue Aug 10, 2010 12:04 pm

Re: Scripting

Post by jtclipper »

There is a default script '#load_coverex.sct' that displays how more complex tasks can be accomplished.
The following is a modification that loads 'folder.jpg' but does not add any description for the added picture:

Code: Select all

Program PictureFromFileEX2;
var
  i: integer;
  sCoverFile: string;
  ms: TmemoryStream;
begin
  if not tg_init then exit;
  i := 1;
  ms := TMemoryStream.Create;
  sys_SetStatusText( 2, IntToStr( tg_GetRowCount ) );
  repeat
    tg_loadFile;
    sys_SetStatusText( 1, IntToStr( i ) );
    sys_SetStatusText( 3, gTag.Filename );
    sCoverFile := ExtractFilePath( gTag.Filename ) + 'folder.jpg' ;
    if FileExists( sCoverFile ) then begin
       ms.Clear;
       ms.LoadFromFile( sCoverFile )
       gTag.ClearPictures; // remove any existing !!
       gTag.AddPicture( ms, '', 'jpg', 3 );
       gTag.SaveToFile( 0, false, false );
       tg_RefreshRow;
       tg_setResult( 'OK' );
    end;
    i := i + 1;
  until not tg_skip;
  ms.Free;
end.
The Paramaters for gTag.AddPicture
1=memory stream containing the actual data
2=Descriprion
3=mime type
4=Cover type
Cover type Constants:

Code: Select all

0  Other
1  32x32 pixels file icon (PNG only)
2  Other file icon
3  Cover (front)
4  Cover (back)
5  Leaflet page
6  Media (e.g. lable side of CD)
7  Lead artist/lead performer/soloist
8  Artist/performer
9  Conductor
10 Band/Orchestra
11 Composer
12 Lyricist/text writer
13 Recording Location
14 During recording
15 During performance
16 Movie/video screen capture
17 A bright coloured fish
18 Illustration
19 Band/artist logotype
20 Publisher/Studio logotype

viply1
Newbie
Newbie
Posts: 4
Joined: Fri Feb 21, 2014 6:56 am

Re: Scripting

Post by viply1 »

Im sorry :( But im not that great a coder and i dont know much on gtag. Could you please let me know how to add a parameter for the 'Description' in the above code

EDIT - Ok No problem. Got it working. Thank you ! :)

aron123
Newbie
Newbie
Posts: 2
Joined: Wed Oct 01, 2014 8:45 am

Re: Scripting

Post by aron123 »

Thanks for share...
We provide fast success in free-braindumps.net dumps exam by using our high quality IBQH prep resources.

Post Reply