Old 14th June 2003, 18:34   #1
cc213t
Junior Member
 
Join Date: Jun 2003
Posts: 7
Media converter sort placement in SDK build #488

I'm using SDK build #488 and WINAMP 3.0D, and I'm having a problem with a media converter component I've written.

My input converter handles MIDI files, and I'd like it to coexist with WINAMP's own cnv_midi.wac. Specifically, I want my converter to have first crack at MIDI files and use an attribute to let the user control whether MIDI files are processed by my converter or rejected (to be picked up cnv_midi.wac). So far so good.

I added a svc_mediaConverterI::sortPlacement() function to my converter, and was planning to have it return -1 when appropriate to place my converter above cnv_midi.wac. Unfortunately, it seems that WINAMP never calls my sortPlacement(). (Is this a known problem with SDK build #488, or is there something I need to do in my component to ensure it is called?)

So I tried the brute force method of renaming my component to sort earlier alphabetically than cnv_midi.wac, causing WINAMP to load it sooner. This solution works fine on Win2k and XP, but it fails under 98 and ME because on those platforms the WAC files are not loaded in alphabetical order, but rather in the order the files were added to the raw directory.

Is there any way I can get my converter placed above cnv_midi on all platforms?
cc213t is offline  
Old 14th June 2003, 21:48   #2
Russ
Mostly Harmless
(Alumni)
 
Join Date: Jan 2001
Location: UK
Posts: 2,319
Err, have you tried it in a later build and did it work? I'm assuming it must work in builds above 491ish because the ReplayGain scanner uses it.

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 15th June 2003, 00:19   #3
cc213t
Junior Member
 
Join Date: Jun 2003
Posts: 7
I tried rebuilding my component with SDK #490 and running it in WINAMP build #498 (the latest posted versions on the NSDN pages).

The plugin runs OK, but the sortPlacement() function is still not called in this configuration. Also, the cnv_midi.wac is missing in WINAMP build #498 (the XML dir is there, but no .wac), making it hard to test interaction with my component.

So I figure you mean I need SDK version 491 or later..? Where can I get later builds of WINAMP and the SDK? They're not on NSDN and http://canada.landoleet.org/ is down.
cc213t is offline  
Old 15th June 2003, 08:48   #4
Russ
Mostly Harmless
(Alumni)
 
Join Date: Jan 2001
Location: UK
Posts: 2,319
http://russ.garrett.co.uk/wa3install_build498.exe
http://russ.garrett.co.uk/wasabi-sdk_build498.exe

(still uploading these, if they aren't there try again in a ferw minutes)

You should just be able to copy cnv_midi.wac in from an earlier build.

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 15th June 2003, 09:09   #5
Russ
Mostly Harmless
(Alumni)
 
Join Date: Jan 2001
Location: UK
Posts: 2,319
Meh, download from there, AOL has more bandwidth than 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  
Old 15th June 2003, 14:43   #6
cc213t
Junior Member
 
Join Date: Jun 2003
Posts: 7
Thanks guys, I'll give the combination of WA 498 + SDK 498 a shot.

I found a solution that works with build 488 in case anyone's interested. There is a command line utility called "lfnsort.exe" available that can rearrange the physical entries of a 95/98/ME VFAT directory to be in alphabetical order (then WINAMP will see them alphabetically too). I was able to have my NSIS installer provide and run this utility on the wacs directory after installing my plugin if the install is happening on Win98 or ME. It's a clunky solution, but it gets the job done.

I'll see how it goes with the newer SDK.

Last edited by cc213t; 15th June 2003 at 15:40.
cc213t is offline  
Old 7th February 2004, 08:03   #7
cc213t
Junior Member
 
Join Date: Jun 2003
Posts: 7
Well, I tried builds 498 and 499 and had too many problems with missing/broken features outside of my own component.

In case anyone's interested, I found a better way to solve this problem in build #488. I put the following at the end of my media converter's onCreate():

code:

// make sure we are called ahead of cnv_midi.wac
waServiceFactory *s;
for (int i=0; s=api->service_enumService(WaSvc::MEDIACONVERTER, i); i++) {
if (strcmp(s->getServiceName(), "MIDI Player") == 0) {
api->service_deregister(s);
api->service_register(s);
break;
}
}


Basically if cnv_midi got loaded first, we reregister it below us. If we got loaded first, well, that's what we wanted.

I also tried using api->service_getServiceByGuid() to locate cnv_midi, and I'm positive I got the GUID right, but it did not work for some reason.

Is the above solution safe?
cc213t is offline  
Old 9th May 2004, 17:45   #8
cc213t
Junior Member
 
Join Date: Jun 2003
Posts: 7
To follow up on this, this method appears safe. I have used this approach for a few months now with zero problems.
cc213t 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