Skip to content

Commit

Permalink
Merge pull request #48 from spiffy-sam/sg-active-count
Browse files Browse the repository at this point in the history
Pass active device count.
  • Loading branch information
objective-see authored Oct 26, 2023
2 parents 8af2140 + d079ba2 commit 863ed80
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
4 changes: 4 additions & 0 deletions Application/Application/AVMonitor.m
Original file line number Diff line number Diff line change
Expand Up @@ -1585,6 +1585,10 @@ -(BOOL)executeUserAction:(Event*)event
[args addObject:@"-process"];
[args addObject:event.client.pid.stringValue];
}

//add active device count
[args addObject:@"-activeCount"];
[args addObject:[NSNumber numberWithUnsignedLong:[self enumerateActiveDevices].count]];
}

//exec user specified action
Expand Down
24 changes: 13 additions & 11 deletions Application/Application/Preferences.xib
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
<rect key="contentRect" x="196" y="240" width="600" height="426"/>
<rect key="screenRect" x="0.0" y="0.0" width="3440" height="1415"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
<view key="contentView" wantsLayer="YES" id="se5-gp-TjO">
<rect key="frame" x="0.0" y="0.0" width="600" height="426"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Expand Down Expand Up @@ -256,16 +256,6 @@
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="471" translatesAutoresizingMaskIntoConstraints="NO" id="GP0-UX-66J">
<rect key="frame" x="72" y="84" width="510" height="60"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="7Ah-kZ-gGe">
<font key="font" size="13" name="Menlo-Regular"/>
<string key="title">OverSight will pass in the following arguments:
-device &lt;camera|microphone&gt; -event &lt;on|off&gt; -process &lt;pid&gt;

Note: -process is only specified on activation events.</string>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" fixedFrame="YES" preferredMaxLayoutWidth="382" translatesAutoresizingMaskIntoConstraints="NO" id="z32-0s-dpb">
<rect key="frame" x="143" y="223" width="437" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
Expand Down Expand Up @@ -301,6 +291,18 @@
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="471" translatesAutoresizingMaskIntoConstraints="NO" id="GP0-UX-66J">
<rect key="frame" x="72" y="39" width="510" height="105"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="7Ah-kZ-gGe">
<font key="font" size="13" name="Menlo-Regular"/>
<string key="title">OverSight will pass in the following arguments:
-device &lt;camera|microphone&gt; -event &lt;on|off&gt; -process &lt;pid&gt; -activeCount &lt;0..n&gt;

Notes:
-process is only specified on activation events.
-activeCount is the number of devices still active.</string>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="gVP-Ih-dFA" secondAttribute="trailing" constant="20" symbolic="YES" id="CvO-h8-LQr"/>
Expand Down

0 comments on commit 863ed80

Please sign in to comment.