diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-01-17 13:13:58 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-01-17 13:13:58 +0000 |
commit | 76c25a4a4459b8e550c3c687458d04db0beaee77 (patch) | |
tree | 5a3da92468a71945b5acd373dae08e216a8e2828 /tools/ARDOUR | |
parent | 9fc6895565fc81ec6061088fe7f4fc4e8318c800 (diff) |
add sampo's synthesize_sources perl script to tools; add scroll-playhead-{forward,backward} with ctrl-<arrow> default bindings (for mr beasley)
git-svn-id: svn://localhost/ardour2/trunk@1336 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'tools/ARDOUR')
-rw-r--r-- | tools/ARDOUR/SourceInfoLoader.pm | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/tools/ARDOUR/SourceInfoLoader.pm b/tools/ARDOUR/SourceInfoLoader.pm new file mode 100644 index 0000000000..ec327d91f6 --- /dev/null +++ b/tools/ARDOUR/SourceInfoLoader.pm @@ -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; + + + |