Author Topic: NEW: Tags Library  (Read 51679 times)

3delite

  • Posts: 869
NEW: Tags Library
« on: 8 May '14 - 10:26 »
Hi!

First alpha release of my new component is available!

Tags Library is a component for Delphi (Win32, Win64, OSX, iOS and Android) and a .dll for developer environments supporting usage of Win32, Win64 or OSX32 .dlls (C++, VB, etc.).

Features:

  • Loading of ID3v1, ID3v2, Lyrics3, APEv1, APEv2, Flac (including Ogg Flac), Ogg Vorbis, Opus, MP4 (including video files and 64bit atom size files), WAV LIST INFO, BEXT and CART (including RF64 WAV files) and WMA tags
  • Saving of ID3v1, ID3v2, Lyrics3, APEv2, Flac (including Ogg Flac), Ogg Vorbis, Opus, MP4 (including video files and 64bit atom size files), WAV LIST INFO, BEXT and CART (including RF64 WAV files) and WMA tags
  • Removing of all the supported tags
  • Bulit in support for extracting and inserting album cover pictures for all the supported tag formats
  • Handle the tags transparently or call direct functions for particular tags
  • Integration with BASS, load tags from BASS channel handles (local or URL streams)
  • Fully unicode
  • Pure Delphi code, no external dependencies, Delphi XE2 64bit and OSX, Delphi XE5 iOS and Android compatible
  • .dll version provided for Win32, Win64 and OSX32

Home page and download for Tags Library

NOTE: .dll version not yet provided, this is an alpha release with only Delphi units, I will be working on a .dll version in the following days. But there are tutorial example binaries in the package, so everyone can test them.

The whole project is very little tested, especially the saving part, please let me know your findings, suggestions, pointers, etc... I'd like to make this component the official BASS tag reading/writing component so please elaborate. :)

Thank you!
« Last Edit: 26 May '14 - 23:55 by 3delite »

devid1988

  • Posts: 47
Re: New: Tags Library
« Reply #1 on: 10 May '14 - 10:58 »
Hi!

First alpha release of my new component is available!

Tags Library is a component for Delphi (Win32, Win64, OSX, iOS and Android) and a .dll for developer environments supporting usage of Win32, Win64 or OSX .dlls (C++, VB, etc.).

Features:

  • Loading of ID3v1, ID3v2, Lyrics3, APEv1, APEv2, Flac (including Ogg Flac), Ogg Vorbis, Opus, MP4 (including video files and 64bit atom size files), WAV LIST INFO (including RF64 WAV files) and WMA tags
  • Saving of ID3v1, ID3v2, Lyrics3, APEv2, Flac (including Ogg Flac), Ogg Vorbis, Opus, MP4 (including video files and 64bit atom size files), WAV LIST INFO (including RF64 WAV files) and WMA tags
  • Removing of all the supported tags
  • Bulit in support for extracting and inserting album cover pictures for all the supported tag formats
  • Handle the tags transparently or call direct functions for particular tags
  • Integration with BASS, load tags from BASS channel handles (local or URL streams)
  • Fully unicode
  • Pure Delphi code, no external dependencies, Delphi XE2 64bit and OSX, Delphi XE5 iOS and Android compatible
  • .dll version provided for Win32, Win64 and OSX (in progress)

Download Tags Library 0.1.3.4 alpha.zip 3.37MB

NOTE: .dll version not yet provided, this is an alpha release with only Delphi units, I will be working on a .dll version in the following days. But there are tutorial example binaries in the package, so everyone can test them.

The whole project is very little tested, especially the saving part, please let me know your findings, suggestions, pointers, etc... I'd like to make this component the official BASS tag reading/writing component so please elaborate. :)

Thank you!



Works well and thank you very much

3delite

  • Posts: 869
Re: New: Tags Library
« Reply #2 on: 11 May '14 - 14:17 »
Thank you for testing the library!

An update is available, still alpha version, but now there's a compiled Win32, Win64 and OSX32 .dll in the package with a Delphi and a C++ API for the .dll version. Please check the C++ API, I'm not a C++ coder, particularly I couldn't find a documentation how to define this in C:

Code: [Select]
type
    HTags = Pointer;

I wrote it this way:

Code: [Select]
typedef * HTags;

Probably not right, so please somebody who knows C++, take a look at 'TagsLibraryDefs.cpp' and 'TagsLibraryDefs.h'.

Not all the functions are ready in the .dll version, use 'ttAutomatic' for all the functions for 'TagType'.

Download Tags Library 0.1.5.5 alpha.zip 10.5MB

Chris

  • Posts: 1791
Re: New: Tags Library
« Reply #3 on: 11 May '14 - 17:28 »
so far i know must be
Code: [Select]
typedef void* HTags;

azrael11

  • Posts: 18
Re: New: Tags Library
« Reply #4 on: 12 May '14 - 07:44 »
How about freepascal/lazarus can i use it...?
And if i can, can i use it in windows,linux,macosx?

Thanks...

3delite

  • Posts: 869
Re: New: Tags Library
« Reply #5 on: 12 May '14 - 11:58 »
so far i know must be
Code: [Select]
typedef void* HTags;

Ok, thank you, changed it.

How about freepascal/lazarus can i use it...?
And if i can, can i use it in windows,linux,macosx?

Thanks...

The delphi class can be compiled for Win32, Win64, OSX32 (Delphi XE2), iOS and Android (XE5). Don't know about Lazarus/Free pascal, please give it a try! Maybe just a little modification is needed... what comes to my mind is don't know if TEncoding.UTF8 and TEncoding.ANSI is available in Lazarus/FP?

The latest version is here: Download Tags Library 0.1.6.4 beta.zip 8.71MB
Changed status to beta: all functions implemented, needs testing still.

One thing I forgot to mention is that the component is designed in the way, that it can do cross-tagging, for example load an ID3v2 tag and save it as a Flac tag. Of course not everyting is transfered but most common tags are.

And one more thing: with the .dll version it's possible to work on specific tag level (this is obvious in the Delphi version), just specify ttID3v2 for example for tag type in all functions and use SaveEx(), also now there's a GetTagData and SetTagData which can be used to work with binary data (eg. process a tag that's not implemented explicitly).

3delite

  • Posts: 869
Re: New: Tags Library
« Reply #6 on: 12 May '14 - 21:43 »
A quick update, fixed the .dll tutorial AV when loading the tags (a stupid typo), and fixed the TagsLibrary_AddCoverArt() function's definition (again a typo).
And added a little documentation on how to use the .dll version in Tags Library ReadMe.txt.

Please re-download from the previous post.

3delite

  • Posts: 869
Re: New: Tags Library
« Reply #7 on: 14 May '14 - 16:01 »
The package has been updated.
Added a tutorial for the .dll version on how to work with particular tag types and fixed all function that it uses.
Still beta.

Now there's an official download page: Download Tags Library

And an official home page: Tags Library home page

3delite

  • Posts: 869
Re: New: Tags Library
« Reply #8 on: 19 May '14 - 23:37 »
And an update again:

  • Added loading and saving of WAV BEXT and CART tags (also supported when loading from BASS channel handle)
  • Added TagsLibrary_DeleteTag() and TagsLibrary_DeleteTagByIndex() function
  • Some fixes

Still beta, download in the first post or from the official home page.

3delite

  • Posts: 869
Re: NEW: Tags Library
« Reply #9 on: 26 May '14 - 23:54 »
First stable release 1.0.10.10 is available for download.

Please see the first post for the download link.

MB_SOFT

  • Posts: 254
Re: NEW: Tags Library
« Reply #10 on: 27 May '14 - 11:18 »
any chance of a VB declare?

3delite

  • Posts: 869
Re: NEW: Tags Library
« Reply #11 on: 27 May '14 - 13:15 »
I'm not a VB coder myself, so please check and correct my try: TagsLibraryDefs.bas

The types are not translated, for example, I have no idea how to define an enum in VB...

EDIT: Ok, a little googleing helped for the enum, 2 issues left for sure:

Code: [Select]
type
    HTags = Pointer;

type HTags as Long '?

and the array type:

Code: [Select]
type
    TTagPriority = Array [0..8] of TTagType;

If anybody knows how to declare these in VB, that would be helpful!
« Last Edit: 27 May '14 - 18:10 by 3delite »

esasse

  • Posts: 32
Re: NEW: Tags Library
« Reply #12 on: 28 May '14 - 22:46 »
Nice library!  :)

Can you tell me why it can't read the artist from this file?
https://dl.dropboxusercontent.com/u/31010/instrumemtal.wav

The BASS Tags.dll is also unable to read, but I can see the artist in Windows Explorer and also in the file properties.

Thanks!
Erick

3delite

  • Posts: 869
Re: NEW: Tags Library
« Reply #13 on: 29 May '14 - 16:36 »
Please try the update, download in the first post.

diystar

  • Posts: 36
Re: NEW: Tags Library
« Reply #14 on: 30 May '14 - 05:09 »
Why not provide the version below delphi 2007? I use delphi 6 ;D

Chris

  • Posts: 1791
Re: NEW: Tags Library
« Reply #15 on: 30 May '14 - 05:47 »
Then just use the dll. Delphi 6 support makes no Sense (Delphi 6 dosenīt know TEncoding,Macos,Android and so on)
By the way d6 is now 13 Years old!!

diystar

  • Posts: 36
Re: NEW: Tags Library
« Reply #16 on: 30 May '14 - 06:47 »
Then just use the dll. Delphi 6 support makes no Sense (Delphi 6 dosenīt know TEncoding,Macos,Android and so on)
By the way d6 is now 13 Years old!!
DLL can be used, but i want to use the source code in my application ;D

3delite

  • Posts: 869
Re: NEW: Tags Library
« Reply #17 on: 6 Jun '14 - 15:34 »
Updated the library with support of DSD .dsf audio files (ID3v2).

3delite

  • Posts: 869
Re: NEW: Tags Library
« Reply #18 on: 10 Jun '14 - 02:27 »
New version is out, updates:

  • Added DSD .dsf audio file attributes parsing (Delphi class)
  • Added TagsLibrary_GetConfig() and TagsLibrary_SetConfig() functions (.dll version) - set padding size
  • Added TagsLibrary_GetVendor() and TagsLibrary_SetVendor() functions (.dll version)
  • Added TagsLibrary_GetAudioAttributes() (.dll version) - get .dsf, .flac, .opus and .ogg (vorbis) audio attributes

3delite

  • Posts: 869
Re: NEW: Tags Library
« Reply #19 on: 18 Jun '14 - 18:34 »
Updated the package.

Updates since last post:

  • Added new config option TAGSLIBRARY_PARSE_OGG_PLAYTIME (.dll version), 'TagsLibraryParseOggPlayTime' (Delphi class)
  • Added 'PlayTime' and 'SampleCount' to TOpusTag.Info (Delphi class)
  • Added 'PlayTime' and 'SampleCount' to TagsLibrary_GetAudioAttributes() with 'ttVorbis' and 'ttOpus' (.dll version)
  • Added TWAVTag.Attributes and TWAVTag.PlayTime and TWAVTag.SampleCount (Delphi class)
  • Added TTags.SourceAudioAttributes class (Delphi class)
  • Added 'ttWAV' support for TagsLibrary_GetAudioAttributes() (.dll version)
  • Fixed TagsLibrary_GetAudioAttributes() (.dll version)
  • Added MPEG, AIFF/AIFC, WAV attributes to TID3v2Tag (Delphi class)
  • Added 'ttAIFF', 'ttMPEG' and 'ttWMA' support for TagsLibrary_GetAudioAttributes() (.dll version)
  • Added 'TAGSLIBRARY_PARSE_ID3v2_AUDIO_ATTRIBUTES' config option (.dll version)
  • Modified all structure members to return at least a DWord (.dll version)
  • Updated C++ header file (.dll version)
  • Updated VB header file (.dll version)

The C++ and VB header files are not tested. It would be cool if someone would test them, a C++ example app. would be also very cool! :)

One thing that's missing from the VB file is a function to convert the wide strings the library returns to native VB strings. There is a function in the BASS VB file, but that's ANSI as far as I can decide. Please, a VB guru's help would be usefull!

Here's the ANSI version:

Code: [Select]
Public Function VBStrFromAnsiPtr(ByVal lpStr As Long) As String
Dim bStr() As Byte
Dim cChars As Long
On Error Resume Next
' Get the number of characters in the buffer
cChars = lstrlen(lpStr)
If cChars Then
    ' Resize the byte array
    ReDim bStr(0 To cChars - 1) As Byte
    ' Grab the ANSI buffer
    Call CopyMemory(bStr(0), ByVal lpStr, cChars)
End If
' Now convert to a VB Unicode string
VBStrFromAnsiPtr = StrConv(bStr, vbUnicode)
End Function

none

  • Guest
Re: NEW: Tags Library
« Reply #20 on: 19 Jun '14 - 01:22 »

3delite

  • Posts: 869
Re: NEW: Tags Library
« Reply #21 on: 19 Jun '14 - 15:26 »
Ok. Thank you very much, it seems that this is what I needed!

The package has been updated with a VB module containing a function 'LPWSTRtoBSTR' which can convert the returned wide strings hopefully.
To pass a string to the lib. use 'StrPtr(string)'.

3delite

  • Posts: 869
Re: NEW: Tags Library
« Reply #22 on: 27 Jun '14 - 22:08 »
Update 1.0.19.25:

  • Fixed ID3v2 Library nextgen (Android/iOS) compile, won't read AIFF/AIFC files' sample rate though (no extended (10 byte float) support in nextgen)
  • Fixed WAV tag processing with >4GB files

3delite

  • Posts: 869
Re: NEW: Tags Library
« Reply #23 on: 12 Jul '14 - 04:49 »
Trying to make my first C++ app, a little tutorial for the TagsLib.dll but having trouble making the C++ header file for it.

Here's the current status of it: http://www.3delite.hu/Tags%20Library/Download/TagsLibraryTutorial.zip

Could somebody help with it?

Thank you!

none

  • Guest
Re: NEW: Tags Library
« Reply #24 on: 12 Jul '14 - 06:44 »
use

Code: [Select]
#ifdef __cplusplus
extern "C" {
#endif
instead of define
Code: [Select]
__stdcall by Hand
define exports inside your dll is written in Delphi
sample

add to C Header File
Code: [Select]
#ifndef TAGSLIBDEF
#define TAGSLIBDEF(f) WINAPI f
#endif

Delphi
Code: [Select]
TagsLibrary_Free   name 'TagsLibrary_Free@HereTheByteWhichHTAGSHas' Sample (TagsLibrary_Free@4) if HTAGS = Integer
Create the DEF File with DumpBin
dumpbin /exports TagsLib.dll >TagsLib.def

Create a lib
LIB /DEF:TagsLib.DEF


Sample Header
Code: [Select]
#ifndef TAGSLIBDEF_H
#define TAGSLIBDEF_H

#include <wtypes.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifndef TAGSLIBDEF
#define TAGSLIBDEF(f) WINAPI f
#endif


// Your Exports Header and so on
BOOL TAGSLIBDEF(TagsLibrary_Free)(HTAGS Tags);
int TAGSLIBDEF(TagsLibrary_Load)(HTAGS Tags, LPWSTR FileName, TTagType TagType, BOOL ParseTags);

#ifdef __cplusplus
}
#endif

#endif

greets