1 package ARDOUR
::SourceInfoLoader
;
4 use XML
::Handler
::Subs
;
6 @ISA = qw( XML::Handler::Subs );
12 my ($type, $sessionName) = @_;
14 my $self = $type->SUPER::new
();
16 $self->{SessionName
} = $sessionName;
17 $self->{InRegions
} = 0;
18 %self->{Sources
} = {};
28 my $atts = $element->{Attributes
};
30 if ( $element->{Name
} eq "Source") {
31 if ( ! -f
"interchange/".$sessionName."/audiofiles/".$atts->{name
}) {
32 $atts->{calculated_length
} = 1;
33 $self->{Sources
}->{$atts->{id
}} = $atts;
38 if ( $self->{InRegions
} eq 1 && $element->{Name
} eq "Region") {
39 #print "Looking at region ".$atts->{id}."\n";
42 my $region_length = $atts->{length};
43 while ( $atts->{"source-".$num} ne "" ) {
45 if ($region_length > $self->{Sources
}->{$atts->{"source-".$num}}->{calculated_length
} ) {
46 $self->{Sources
}->{$atts->{"source-".$num}}->{calculated_length
} = $region_length;
53 if ( $element->{Name
} eq "Regions") {
54 $self->{InRegions
} = 1;
55 #print "In regions\n";
65 if ( $element->{Name
} eq "Regions") {
66 $self->{InRegions
} = 0;
67 #print "Out of regions\n";