X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=tools%2Fresample_session.pl;h=60bb212b62d4ce3f452cb448730deb777fde9ab9;hb=f699773490ffc4b7380eede4e529c66416f965ac;hp=c6a390f480c27d86f93a4f693f05d2f2cf989f08;hpb=666e0870554705f4fb466fc6b188fe9b4000ca49;p=ardour.git diff --git a/tools/resample_session.pl b/tools/resample_session.pl index c6a390f480..60bb212b62 100755 --- a/tools/resample_session.pl +++ b/tools/resample_session.pl @@ -9,6 +9,8 @@ # The peakfiles and dead_sounds aren't copied. Only "identified" files are copied, instant.xml's # or .bak's aren't copied either. +use FindBin '$Bin'; +use lib "$Bin"; use XML::Parser::PerlSAX; use XML::Handler::XMLWriter; use IO::Handle; @@ -97,15 +99,17 @@ while ( my $file=readdir(DOT_ARDOUR) ) { } close(DOT_ARDOUR); -# Read the names of all automation files in /automation/ -opendir(AUTOMATION,$sourceDirectory."/automation/") || die ($sourceDirectory."/automation: could not open!"); -while ( my $file=readdir(AUTOMATION) ) { - if ( -f $sourceDirectory."/automation/".$file && - index($file,".automation") eq (length($file)-11)) { - push(@automation,$file); +if ( -d $sourceDirectory."/automation/") { + # Read the names of all automation files in /automation/ + opendir(AUTOMATION,$sourceDirectory."/automation/") || die ($sourceDirectory."/automation: could not open!"); + while ( my $file=readdir(AUTOMATION) ) { + if ( -f $sourceDirectory."/automation/".$file && + index($file,".automation") eq (length($file)-11)) { + push(@automation,$file); + } } + close(AUTOMATION); } -close(AUTOMATION); # Check for /peaks/ if ( ! -d $sourceDirectory."/peaks" ) {