rlm@67: #!/usr/bin/env perl rlm@67: rlm@67: rlm@67: use File::Basename; rlm@67: use Getopt::Long; rlm@67: use File::Copy; rlm@67: rlm@67: sub Usage(); rlm@67: rlm@67: my $music = undef; rlm@67: my $network = undef; rlm@67: my $from = undef; rlm@67: my $to = undef; rlm@67: my $command = undef; rlm@67: rlm@67: rlm@67: # rlm@67: # Parse the command line switches rlm@67: # rlm@67: if (! GetOptions('music=s' => \$music, rlm@67: 'network=s' => \$network, rlm@67: )) { rlm@67: Usage(); rlm@67: } rlm@67: rlm@67: print "\n\n*********************\n\nRLM:\n"; rlm@67: print "music is: $music\nnetwork is: $network\n"; rlm@67: rlm@67: rlm@67: my $bmark = $ARGV[0]; rlm@67: my $destination = $ARGV[1]; rlm@67: my $origin = "$bmark/.."; rlm@67: rlm@67: rlm@67: rlm@67: print "Origin: $origin\n"; rlm@67: print "Destination: $destination\n"; rlm@67: rlm@67: print "\nCopying Files:\n"; rlm@67: rlm@67: rlm@67: rlm@67: $from = $bmark."/run-sim.bmark"; rlm@67: $to = $destination."/run"; rlm@67: print "Copying $from to $to\n"; rlm@67: copy($from,$to) or die "Copy failed: $!"; rlm@67: $command = "chmod 777 $to"; rlm@67: `$command`; rlm@67: rlm@67: rlm@67: rlm@67: print "\nGenerating Placeholder Voices:\n"; rlm@67: rlm@67: for my $num(0..11) rlm@67: { rlm@67: $command = "cp $origin/music/null/null0.wav $destination/input$num.wav\n"; rlm@67: print $command; rlm@67: `$command`; rlm@67: } rlm@67: rlm@67: print "\nCopying Voices\n"; rlm@67: $command = "cp $origin/music/$music/*.wav $destination"; rlm@67: print "$command\n"; rlm@67: rlm@67: rlm@67: print "\nGenerating Placeholder Programs:\n"; rlm@67: $command = "mkdir $destination/programs\n"; rlm@67: print $command; rlm@67: `$command`; rlm@67: rlm@67: for my $num(0..11) rlm@67: { rlm@67: $command = "cp $origin/programs/identity.vmh $destination/programs/program$num.vmh\n"; rlm@67: print $command; rlm@67: `$command`; rlm@67: } rlm@67: rlm@67: print "\nCreating Network:\n\n"; rlm@67: print "Open $origin/networks/$network :\n"; rlm@67: open (NET, "<$origin/networks/$network") or die $!; rlm@67: rlm@67: for () rlm@67: { rlm@67: @link = eval($_); rlm@67: rlm@67: print "Voice $link[0] will be run through $link[1]\n"; rlm@67: rlm@67: $command = "cp $origin/programs/$link[1] $destination/programs/program$link[0].vmh\n"; rlm@67: print $command; rlm@67: `$command`; rlm@67: rlm@67: rlm@67: } rlm@67: rlm@67: rlm@67: rlm@76: print "\nRetarded Debug Directory:\n"; rlm@76: $command = "mkdir $destination/hasim_debug\n"; rlm@76: print $command; rlm@67: print "\n***********************\n"; rlm@67: rlm@67: