![]() |
MetaDB question
Has anyone managed to get metadb_getMetaData to return anything sensible with numeric types such as MT_LENGTH, or is it just me? All I seem to be able to get is rubbish. Maybe it's just because I'm not a C++ programmer at heart but it seems a bit stupid returning a number using a char* type :p.
I'm 99% finished on a new Winamp3/mIRC plugin which works using the new mIRC SendMessage interface, and is hopefully more configurable than my previous one :D. I'd like to get track length and so implemented though. |
It returns the number of milliseconds. So 10000 is ten seconds long. Also, it uses a char* interface along with a type parameter so one function can access any kind of metadata.
--Brennan |
since you know it's an int, you'd do something like this to make the return value what you need it to be:
int * len = (int *)metadb_getMetaData(...); --aus |
No... no, you wouldn't. That's plain wrong. Ignore what he just said.
You would do: int val=0; api->metadb_getMetaData(playstring, MT_LENGTH, (char *)&val, sizeof(val), MDT_INT); --Brennan |
haha, that's horrible, i should look at the function prototype before answering next time.
=) |
That's cause Aus has overloaded the casting functions so it is ULTRA smart. ;) Maybe you should check with him first Brennan. ;)
|
yes, and my iq has magically risen 20 points =)
|
Ah that makes it a bit clearer... types in C++ confuuse me :p.
|
| All times are GMT. The time now is 20:46. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.