Well it turns out that libmikmod doesn't provide the duration of a
module. The only way to figure it out is to play through the module
once and see how long it took. Even without generating sound (using the
no sound driver) it would take quite some time while scaning the
library.
The other problem was that using:
Code:
--------------------
MikMod_RegisterAllDrivers();
MikMod_RegisterAllLoaders();
MikMod_Init();
--------------------
for every file inside the gettag function was simply killing my server
(99% cpu for way too long I had to kill it).
I'm also not sure how to access the module structure that mikmod
returns in perl. Does this look correct:
Code:
--------------------
my $module = Player_Load($file, 256, 0);
if ($module) {
$::d_formats && msg("opened file $file\n");
}
else {
$::d_formats && msg("ERROR Can't open file $file\n");
}
--------------------
I also added this to my script:
Code:
--------------------
$tags->{'GENRE'} = "Computer Module";
--------------------
So every module has a genre of "Computer Module" but if I decide to
browse by genre -> Computer Module it shows no file.
And this last bit was just a wild guess. Can a real perl programmer
who's dealt with mikmod <cough>Dan?</cough> maybe have a quick look to
tell me if this is correct or not. Maybe it killed my server because I
have no clue about what I'm doing.
Code:
--------------------
if (defined $module->songname) {
$tags->{'TITLE'} = $module->songname;
}
if (defined $module->comment) {
$tags->{'COMMENT'} = $module->comment;
}
--------------------
If once fixed it's really too slow I may write a preprocessor that will
scan the modules and create a table in which I can add author, group,
demo, duration etc and then use that table in Mod.pm
Thanks for your help.
-WildCoder
--
WildCoder
------------------------------------------------------------------------
WildCoder's Profile: http://forums.slimdevices.com/member.php?userid=1827
View this thread: http://forums.slimdevices.com/showthread.php?t=17845
_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/unix