Old 30th May 2002, 14:42   #1
Russ
Mostly Harmless
(Alumni)
 
Join Date: Jan 2001
Location: UK
Posts: 2,319
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 .

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 . I'd like to get track length and so implemented though.

For long you live and high you fly, but only if you ride the tide, and balanced on the biggest wave you race towards an early grave.
|Musicbrainz|Audioscrobbler|last.fm|
Russ is offline  
Old 31st May 2002, 06:55   #2
Brennan
Monkey Hump Master
 
Brennan's Avatar
 
Join Date: Apr 2000
Posts: 782
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
Brennan is offline  
Old 3rd June 2002, 17:29   #3
Aus
French Canadian
(Alumni)
 
Aus's Avatar
 
Join Date: Dec 2001
Location: A shiny Igloo.
Posts: 333
Send a message via AIM to Aus
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

Aus -- NoisePort.Org, chronicles of the french canadian alien (Temporarly down during the move).
Aus is offline  
Old 3rd June 2002, 20:06   #4
Brennan
Monkey Hump Master
 
Brennan's Avatar
 
Join Date: Apr 2000
Posts: 782
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
Brennan is offline  
Old 3rd June 2002, 20:12   #5
Aus
French Canadian
(Alumni)
 
Aus's Avatar
 
Join Date: Dec 2001
Location: A shiny Igloo.
Posts: 333
Send a message via AIM to Aus
haha, that's horrible, i should look at the function prototype before answering next time.

=)

Aus -- NoisePort.Org, chronicles of the french canadian alien (Temporarly down during the move).
Aus is offline  
Old 4th June 2002, 02:25   #6
LENZ.NET
Senior Member
 
Join Date: Oct 2001
Location: Australia
Posts: 291
Send a message via ICQ to LENZ.NET
That's cause Aus has overloaded the casting functions so it is ULTRA smart. Maybe you should check with him first Brennan.

"Some dance to remember, Some dance to forget."
Spacer | Previewer |
LENZ.NET is offline  
Old 4th June 2002, 02:30   #7
Aus
French Canadian
(Alumni)
 
Aus's Avatar
 
Join Date: Dec 2001
Location: A shiny Igloo.
Posts: 333
Send a message via AIM to Aus
yes, and my iq has magically risen 20 points =)

Aus -- NoisePort.Org, chronicles of the french canadian alien (Temporarly down during the move).
Aus is offline  
Old 4th June 2002, 08:43   #8
Russ
Mostly Harmless
(Alumni)
 
Join Date: Jan 2001
Location: UK
Posts: 2,319
Ah that makes it a bit clearer... types in C++ confuuse me .

For long you live and high you fly, but only if you ride the tide, and balanced on the biggest wave you race towards an early grave.
|Musicbrainz|Audioscrobbler|last.fm|
Russ is offline  
 
Go Back   Winamp & Shoutcast Forums > Winamp3 > Wasabi Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump