Login :       Passwort :       Speicher mein Login/Passwort auf diesem Computer

frd1963

Dieser User hat keine Beschreibung eingetragen.



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

Software
Hardware
Premium Mitgliedschaft (Netsearch)
Goodies
VirtualDJ Pro Full
VirtualDJ Pro Basic
VirtualDJ Broadcaster
VirtualDJ Home FREE
VirtualDJ LE
Vergleich
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
Eigenschaften
Screenshots
VirtualDJ Home FREE
Bedienungsanleitung
Plugins
Software updates
Presse Material
Entwickler SDK
Timecode CD
Skins
Effekte
Kontroller
Sprachen
Samples
Grafx
Tools und Treiber
Foren
User Netzwerk
Musik Gruppen
Wiki & Beschreibungen
Radio
Magazine
Social Web
Erstellen Sie einen Login
Atomix Production
Privacy Policy
VIP DJs
Stellen Sie eine Frage
Meine Tickets ansehen
Wiki & Beschreibungen