Просмотр исходного кода

Make the rope delay runtime-configurable

Zachary Kotlarek 14 лет назад
Родитель
Сommit
eddb364e94

+ 1 - 0
dmx/launchd/com.uberzach.ola.rope.plist

@@ -20,6 +20,7 @@
 	<key>ProgramArguments</key>
 	<array>
 		<string>/Users/tv/bin/video/dmx/rope.pl</string>
+		<string>0.25</string>
 	</array>
 </dict>
 </plist>

+ 8 - 2
dmx/rope.pl

@@ -13,8 +13,7 @@ my %DIM = (
 	'PLAY'  => { 'value' => 64,  'time' => 250 },
 	'PAUSE' => { 'value' => 192, 'time' => 1000 }
 );
-my $TIMEOUT = 600;              # Seconds
-my $DELAY   = 0.5 * 1000000;    # Microseconds
+my $TIMEOUT = 600;    # Seconds
 
 # App config
 my $TEMP_DIR = `getconf DARWIN_USER_TEMP_DIR`;
@@ -35,6 +34,13 @@ if ($ENV{'DEBUG'}) {
 	$DEBUG = 1;
 }
 
+# Command-line arguments
+my ($DELAY) = @ARGV;
+if (!$DELAY) {
+	$DELAY = 0.5;
+}
+$DELAY *= 1000000;    # Microseconds;
+
 # Sanity check
 if (!-d $EXEC_DIR || !-d $DATA_DIR) {
 	die("Bad config\n");

+ 1 - 1
plexMonitor/launchd/com.uberzach.plexMonitor.playing.plist

@@ -21,7 +21,7 @@
 	<key>ProgramArguments</key>
 	<array>
 		<string>/Users/tv/bin/video/plexMonitor/plexMonitor-playing</string>
-		<string>0.5</string>
+		<string>0.25</string>
 	</array>
 </dict>
 </plist>