|
@@ -47,7 +47,7 @@ sub addLoad($$) {
|
|
|
sub add($$) {
|
|
sub add($$) {
|
|
|
my ($name, $path) = @_;
|
|
my ($name, $path) = @_;
|
|
|
if ($DEBUG) {
|
|
if ($DEBUG) {
|
|
|
- print STDERR 'Audio::add(): ' . $name . "\n";
|
|
|
|
|
|
|
+ print STDERR 'Audio::add(): ' . $name . ', ' . $path . "\n";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
# Construct an absolute file path
|
|
# Construct an absolute file path
|
|
@@ -167,13 +167,12 @@ sub position($$) {
|
|
|
die('Invalid QT document: ' . $name . "\n");
|
|
die('Invalid QT document: ' . $name . "\n");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- # Optionally set the audio position
|
|
|
|
|
|
|
+ # Set or get the audio position
|
|
|
if ($new) {
|
|
if ($new) {
|
|
|
runApplescript('tell application "QuickTime Player" to set current time of document ' . $FILES{$name}->{'name'} . ' to ' . $new);
|
|
runApplescript('tell application "QuickTime Player" to set current time of document ' . $FILES{$name}->{'name'} . ' to ' . $new);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return runApplescript('tell application "QuickTime Player" to get current time of document ' . $FILES{$name}->{'name'});
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- # Get the current playback position from QT
|
|
|
|
|
- return runApplescript('tell application "QuickTime Player" to get current time of document ' . $FILES{$name}->{'name'});
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
sub rate($$) {
|
|
sub rate($$) {
|
|
@@ -185,13 +184,12 @@ sub rate($$) {
|
|
|
die('Invalid QT document: ' . $name . "\n");
|
|
die('Invalid QT document: ' . $name . "\n");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- # Optionally set the playback rate
|
|
|
|
|
|
|
+ # Set or get the playback rate
|
|
|
if ($new) {
|
|
if ($new) {
|
|
|
runApplescript('tell application "QuickTime Player" to set rate of document ' . $FILES{$name}->{'name'} . ' to ' . $new);
|
|
runApplescript('tell application "QuickTime Player" to set rate of document ' . $FILES{$name}->{'name'} . ' to ' . $new);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return runApplescript('tell application "QuickTime Player" to get rate of document ' . $FILES{$name}->{'name'});
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- # Get the current playback position from QT
|
|
|
|
|
- return runApplescript('tell application "QuickTime Player" to get rate of document ' . $FILES{$name}->{'name'});
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
sub pause($) {
|
|
sub pause($) {
|