Identifiant :       Mot de Passe :       Se souvenir de moi

frd1963

Cet utilisateur n'a pas encore édité sa description.



Perl script for resizing VDJ skins v1.0

Wed 01 Jun 05 @ 10:55 pm


#!perl
#
#Script for resizing skin defining XML files for VirtualDJ
# by frd1963

$V = 0;
$XML = $ARGV[0];
$WIDTH = $ARGV[1];
$HEIGHT = $ARGV[2];

die "Must specify a valid xml file!" unless (-e "$XML");
open(INFILE,"$XML") || die "Can't open '$XML' : $!";
my @in = ;
close(INFILE);

# Get original height and width
$height = $in[0];
$width = $in[0];
chomp($width);
chomp($height);
print("Using header line '$width'\n") if $V;
$height =~ s/^.*\sheight=\"(\d+)\".*/\1/i;
$width =~ s/^.*\swidth=\"(\d+)\".*/\1/i;

#prompt for new dimensions if not defined or invalid
while ($HEIGHT !~ /^\d+$/ || $WIDTH !~ /^\d+$/) {
     print("Old width = $width     Enter new width : ");
     $WIDTH = ;
     chomp($WIDTH);
     print("Old height = $height     Enter new height: ");
     $HEIGHT = ;
     chomp($HEIGHT);
}

#calculate conversion ratios
my $ratioX = ($WIDTH / $width);
my $ratioY = ($HEIGHT / $height);
print("Width ratio =     $ratioX\nHeight ratio =     $ratioY\n") if $V;

# Convert the sizes, positions and widths
# iterating through each line
$size = @in;
for(my $i = 0; $i $newName") || die "Can't open '$newName' : $!";
foreach $line (@in) {
     print OUTFILE ("$line\n");
}
close(OUTFILE);

$ratioX *= 100;
$ratioY *= 100;
$bmp = $XML;
$bmp =~ s/.xml$/.bmp/i;
$newBmp = "$bmp" . "${HEIGHT}x${WIDTH}" . "bmp";
$bmp = "$bmp" . ".bmp";
print("Now don't forget to make '$newBMP' by stretching '$bmp':\n\tstretch width by '$ratioX%'\n\tstretch height by '$ratioY%'\n");

exit;

sub Convert {
     my $string = shift(@_);
     my $r = shift(@_);
     my @list = @_;

     my $newString = $string;

     foreach my $tag (@list) {
          my $value = $newString;
          $value =~ s/^.*$tag=\"(\d+)\".*/\1/i;
          next if ($value eq "" || $value eq $newString);
          print("Scaling for tag '$tag': '$value' becomes ");
          $value *= $r;
          $value = int($value + .5);
          print("'$value'\n");
          $newString =~ s/^(.*$tag=\")\d+(\".*)/\1$value\2/i;
     }
     return "$newString";
}


Site map
(C)opyright Atomix Productions 2012

Logiciel
Matériel
Membership
Goodies
VirtualDJ Pro Full
VirtualDJ Pro Basic
VirtualDJ Broadcaster
VirtualDJ Home FREE
VirtualDJ LE
Comparaison
Numark CUE
VirtualVinyl
VirtualDJ iRemote
AtomixMP3
eJay DJMixStation
DJ-Box
Why VirtualDJ?
Vdj for Video
Vdj for Turntablism
Vdj for Club DJ
Vdj for Mobile DJ
What's new
Fonctionalités
Capture d'écran
VirtualDJ Home FREE
Manuels d'utilisateurs
Plugins
Mises à jour logiciel
Matériel de Presse
Developer SDK
CD Timecode
Skins
Effets
Contrôleurs
Langages
Samples
Grafx
Outils & Pilotes
Forums
Réseau d'utilisateurs
Music Groups
Wiki & Manuels
Radio
Magazine
Reseaux Sociaux
Créer un identifiant
Atomix Productions
Privacy Policy
DJs VIP
Poser une question
Voir vos dossiers
Wiki & Manuels