mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
Merged with trunk R1393.
git-svn-id: svn://localhost/ardour2/branches/midi@1395 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
cd37c36326
commit
f9f5ec85fb
85 changed files with 5136 additions and 2848 deletions
75
tools/ARDOUR/SourceInfoLoader.pm
Normal file
75
tools/ARDOUR/SourceInfoLoader.pm
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
package ARDOUR::SourceInfoLoader;
|
||||
|
||||
|
||||
use XML::Handler::Subs;
|
||||
|
||||
@ISA = qw( XML::Handler::Subs );
|
||||
|
||||
$VERSION = 1.0;
|
||||
|
||||
|
||||
sub new {
|
||||
my ($type, $sessionName) = @_;
|
||||
|
||||
my $self = $type->SUPER::new();
|
||||
|
||||
$self->{SessionName} = $sessionName;
|
||||
$self->{InRegions} = 0;
|
||||
%self->{Sources} = {};
|
||||
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub start_element {
|
||||
my $self = shift;
|
||||
my $element = shift;
|
||||
|
||||
my $atts = $element->{Attributes};
|
||||
|
||||
if ( $element->{Name} eq "Source") {
|
||||
if ( ! -f "interchange/".$sessionName."/audiofiles/".$atts->{name}) {
|
||||
$atts->{calculated_length} = 1;
|
||||
$self->{Sources}->{$atts->{id}} = $atts;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( $self->{InRegions} eq 1 && $element->{Name} eq "Region") {
|
||||
#print "Looking at region ".$atts->{id}."\n";
|
||||
my $num = 0;
|
||||
|
||||
my $region_length = $atts->{length};
|
||||
while ( $atts->{"source-".$num} ne "" ) {
|
||||
|
||||
if ($region_length > $self->{Sources}->{$atts->{"source-".$num}}->{calculated_length} ) {
|
||||
$self->{Sources}->{$atts->{"source-".$num}}->{calculated_length} = $region_length;
|
||||
}
|
||||
|
||||
$num++;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $element->{Name} eq "Regions") {
|
||||
$self->{InRegions} = 1;
|
||||
#print "In regions\n";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
sub end_element {
|
||||
my $self = shift;
|
||||
my $element = shift;
|
||||
|
||||
if ( $element->{Name} eq "Regions") {
|
||||
$self->{InRegions} = 0;
|
||||
#print "Out of regions\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue