Răsfoiți Sursa

Use rate() to determine playing(), as QT has some quirks in that respect

Zachary Kotlarek 13 ani în urmă
părinte
comite
45b9d47016
2 a modificat fișierele cu 4 adăugiri și 6 ștergeri
  1. 3 5
      dmx/Audio.pm
  2. 1 1
      dmx/rifftrax.pl

+ 3 - 5
dmx/Audio.pm

@@ -186,13 +186,11 @@ sub playing($) {
 	if ($DEBUG) {
 		print STDERR 'Audio::playing(): ' . $name . "\n";
 	}
-	if (!loaded($name)) {
-		die('Invalid QT document: ' . $name . "\n");
-	}
 
 	# Ask QT if the document is playing
-	my $result = runApplescript('tell application "QuickTime Player" to get playing of document ' . $FILES{$name}->{'name'});
-	if ($result =~ /true/i) {
+	# Note that while QT has a "playing" property it is only true when rate == 1.0
+	my $rate = rate($name);
+	if ($rate > 0) {
 		return 1;
 	}
 	return 0;

+ 1 - 1
dmx/rifftrax.pl

@@ -176,7 +176,7 @@ while (1) {
 			DMX::say('RiffTrax initiated');
 
 			# Load and start the audio file
-			Audio::addLoad('RIFF', $RIFFS{$riff}->{'path'});
+			Audio::addLoad('RIFF', $RIFFS{$riff}->{'file'});
 			playRiff();
 			setRiffRate($RIFFS{$riff}->{'rate'});