Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
UT2004 internal MediaPlayer, Playlist Generator Script
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gamers & Players
View previous topic :: View next topic  
Author Message
sk2k4_ops
n00b
n00b


Joined: 12 May 2004
Posts: 5

PostPosted: Sun Jul 25, 2004 11:30 pm    Post subject: UT2004 internal MediaPlayer, Playlist Generator Script Reply with quote

Okay i've revised my script, it works in Linux and Windows.
UT2004's builtin Media Player will play M3U's, Mp3's, and OGG's . For some reason it won't play MP3's in the Linux port. blah

#!/usr/bin/perl
#Little Perl Script to generate UT2004 playlists
#GPL 2 or later
#by Sk2k4_ops
print("UT2004 Playlist Generator\nBy sk2k4_ops\@yahoo.com\n\n");
print("\t1) Generate Windows UPlaylists.ini
2) Generate Linux UPlaylists.ini
q) Quit
choose an option: ");
chomp($win_lin=<STDIN> );

if(lc($win_lin) eq 'q'){
exit();
}

while(){
if(int($win_lin) == '1'){#Windows
print("Please enter directory <EX: C:\\music\\ >(enter 'q' to quit)\n: ");
chomp($some_dir=<STDIN> );
$newdir=$some_dir;
}
if(int($win_lin) == '2'){#Linux
print("Please enter directory (enter 'q' to quit): /");
chomp($some_dir=<STDIN> );
$newdir="/$some_dir";
}

if(lc("q") eq $some_dir){
exit();}
chdir($some_dir);

if(int($win_lin) == '1'){#Windows
print("Enter Location of UT2004 <Default is C:\\UT2004> : ");
chomp($ut2004dir=<STDIN> );
open(PLAY, ">>$ut2004dir\\System\\UPlaylists.ini") || die "$!";
}
if(int($win_lin) == '2'){#Linux
open(PLAY, ">>$ENV{HOME}/.ut2004/System/UPlaylists.ini") || die "$!";
}

opendir(DIR, $newdir) || die "can't opendir $newdir: $!";
@dots = grep { /.ogg$/i || /.m3u$/i || /.mp3$/i && "$newdir/" } readdir(DIR);
closedir DIR;

if(@dots == 0){
print("\nNo media files in $newdir: ogg(s) , mp3(s), or m3u(s) \n\n");
next;
}

print("Name of New Playlist (Don't use spaces): ");
chomp($playl=<STDIN> );
print PLAY "[$playl StreamPlaylist]\nCurrent=0\nbNeedSave=False\n\n";

my $x=0;
@ndots=sort(@dots);
foreach(@ndots){
if(int($win_lin) == '1'){#Windows
print "Added:\nPlaylist=$newdir\\@ndots[$x]\n\n";
print PLAY "Playlist=$newdir\\@ndots[$x]\n";

}
if(int($win_lin) == '2'){#Linux
print "Added:\nPlaylist=$newdir/@ndots[$x]\n\n";
print PLAY "Playlist=$newdir/@ndots[$x]\n";
}
$x++;
}close(PLAY);
print PLAY "\n";


}
_________________
Be gone!!
Back to top
View user's profile Send private message
Mekoryuk
Apprentice
Apprentice


Joined: 17 Sep 2003
Posts: 174

PostPosted: Wed Jul 28, 2004 3:33 pm    Post subject: Woah! Reply with quote

Holy crap! You mean the internal media player really does work?? How? When? :P
Back to top
View user's profile Send private message
sk2k4_ops
n00b
n00b


Joined: 12 May 2004
Posts: 5

PostPosted: Wed Jul 28, 2004 8:21 pm    Post subject: Reply with quote

Yes it works, just use my script or edit the UPlaylists.ini file, Then bring up the mediaplayer in UT2004 with F11 . You need direct links to files in the playlist, the Sandbox security of UT2004 will not let you browse the File System directly. 8O

MP3's won't play in the Linux Port :x
_________________
Be gone!!
Back to top
View user's profile Send private message
Mekoryuk
Apprentice
Apprentice


Joined: 17 Sep 2003
Posts: 174

PostPosted: Sat Sep 04, 2004 2:05 am    Post subject: Reply with quote

What does this error mean?

Code:
Undefined subroutine &main::PrivoxyWindowOpen called at playlist.pl line 38, <STDIN> line 2.
Back to top
View user's profile Send private message
sk2k4_ops
n00b
n00b


Joined: 12 May 2004
Posts: 5

PostPosted: Mon Sep 13, 2004 3:51 am    Post subject: Reply with quote

Does this error occur everytime the script is executed ?

:-?
http://www.privoxy.org/faq/misc.html#DOWNLOADS
:idea:

download it in gzip format:
http://f2.pg.briefcase.yahoo.com/sk2k4_ops
_________________
Be gone!!
Back to top
View user's profile Send private message
mr.travolte
n00b
n00b


Joined: 15 Dec 2008
Posts: 1

PostPosted: Mon Dec 15, 2008 7:29 pm    Post subject: Reply with quote

anyone offer a step-by-step guide on how to do this? script noob myself.

what do you modify the Uplaylist.ini to say? i checked mine out and it has all the tracks i want in there... but wen i fire up UT2004 and open the music player, all the tracks are there, but when you double click to play the track it just goes thru every track till it gets to the bottom and doesnt play a single one of the tracks :(

please help!
Back to top
View user's profile Send private message
Mekoryuk
Apprentice
Apprentice


Joined: 17 Sep 2003
Posts: 174

PostPosted: Tue Dec 16, 2008 3:57 pm    Post subject: Reply with quote

mr.travolte wrote:
anyone offer a step-by-step guide on how to do this? script noob myself.

what do you modify the Uplaylist.ini to say? i checked mine out and it has all the tracks i want in there... but wen i fire up UT2004 and open the music player, all the tracks are there, but when you double click to play the track it just goes thru every track till it gets to the bottom and doesnt play a single one of the tracks :(

please help!


Woah, major thread necro.

Uhm, are the tracks in ogg format? I think they have to be in ogg format for UT2004 to play them.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gamers & Players All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum