ID3LIB - Standard GNU MP3 Tagging library

Everything else that doesn't fall into one of the other PB categories.
naw
Enthusiast
Enthusiast
Posts: 573
Joined: Fri Apr 25, 2003 4:57 pm

ID3LIB - Standard GNU MP3 Tagging library

Post by naw »

Has anyone out there used this with PB?

http://id3lib.sourceforge.net/

- seems to be the standard lib that all the main media players use - would be nice if it worked with PB too!

BTW I just downloaded MediaMonkey. I bought a copy of MusicMatch a couple of years ago, I love it but its beginning to collapse under its own weight of features. MediaMonkey seems to have taken the essential feature of MMJB, iTunes etc and is a nice alternative... (it also apparently uses ID3LIB)

Ta - N
Ta - N
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

ID3lib is a C++ lib wich can't be used as a library, btw, you can use the dllimport to import functions and call them like standard functions (with the "_" char)
There is the possiblity to use my unfinished read/write tagger (it also read mp3 header even vbr ones) : click here (source code here)
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

KarLKoX wrote:ID3lib is a C++ lib wich can't be used as a library
You can always write a C-wrapper without too much hassle.

The beginning of a wrapper is even included in the pack, wrapping additional
functions shouldn't be that hard. There're already user-patches wrapping more
functions. Other than that, yeah, simply use the DLL-version.
Good programmers don't comment their code. It was hard to write, should be hard to read.
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

traumatic wrote:
KarLKoX wrote:ID3lib is a C++ lib wich can't be used as a library
You can always write a C-wrapper without too much hassle.
No, this is impossible : i allready tried the C wrapper for the libmodplug (this is an example) but as pelle's* is only a C compiler it can't resolved C++ symbols.
I played a lot with the linker <--> purebasic and i never found a way to use C++ code within a purelibrary (even a simple "hello world").
If you got a solution you ll be very HELPFUL ! :D


* The 3.0 build is available :)
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

KarLKoX wrote:
traumatic wrote:
KarLKoX wrote:ID3lib is a C++ lib wich can't be used as a library
You can always write a C-wrapper without too much hassle.
No, this is impossible : i allready tried the C wrapper for the libmodplug (this is an example) but as pelle's* is only a C compiler it can't resolved C++ symbols.
I played a lot with the linker <--> purebasic and i never found a way to use C++ code within a purelibrary (even a simple "hello world").
If you got a solution you ll be very HELPFUL ! :D


* The 3.0 build is available :)
You can use Visual C++, it works with it ;)
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

This is what i do to create the lib but don't forget that purebasic use the pelles'c linker to create it's executable :wink:
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

Fred told me in another topic that PellesC's linker can link c++ object files :)
And this seems to be true :)
Fred
Administrator
Administrator
Posts: 18351
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

The problem is the symbol 'mangling' of C++, it's not a linker problem. You can perfectly link VC++ .lib if you declare the functions which needs to be exported as 'extern C {}' then the symbol is correctly generated. Then you can use C++ function in a C function (like new, etc..)
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

The pb didn't come from my exported function wich are all exported with the extern "C" but from other symbols like _rtti, _$text and others wich i can't remember.
I ll try to make a simple package to show you if it works or not.
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
Fred
Administrator
Administrator
Posts: 18351
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

yes, this would be an interesting try
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

IT WORKS ???! This is really wired ... i tried a lot with lcc but never got it working ...
I ll see if i can compile a big project like libmodplug or ... id3lib but it seems that i was wrong somewhere, sorry :oops:
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

Of course it works. Its just a matter of extern "C" as Fred said.
I did this a few times with success. Besides wrapping C++, I can't
imagine how I would survive with just plain C. I'm using this 'hybrid approach'
on a daily basis. (IIRC I already told you this in another thread some time ago) ;)
Good programmers don't comment their code. It was hard to write, should be hard to read.
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

This was not a extern "C" as i compiled a lot of userlib with success (with the right calling conv), my pb occured when i was mixing my C code for my C library with a third C++ lib (libmodplug) : this lib allready have a C wrapper with the extern "C" keyword so it can't be a extern "C" pb.
And i never got errors related to a "un-exported" function, it was always for some exe section or some kind of (bsdata, _rtti, __$text ...)
Note this was the case with the lcc linker (pb 3.81 and <) and this is my second try with pelles'c.
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

Be sure to tell us about your progress. :)
Good programmers don't comment their code. It was hard to write, should be hard to read.
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

No pb, first i won't adapt id3lib, there must be a lot of work done to get it working : function return classes, some classes use template --> they must be wrapped to generic functions and there are a lot !
But i ll try with libmodplug wich is better than midas and would be a better alternative.
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
Post Reply