Skip to content

Commit

Permalink
Add ATEM switcher macro trigers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Shaw authored and Nick Shaw committed Jul 26, 2021
1 parent 97c9ca4 commit 8881ed5
Show file tree
Hide file tree
Showing 11 changed files with 216 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>19H1030</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>ATEM Camera Control</string>
<key>CFBundleIconFile</key>
<string>AppIcon</string>
<key>CFBundleIconName</key>
<string>AppIcon</string>
<key>CFBundleIdentifier</key>
<string>com.antlerpost.ATEM-Camera-Control</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>ATEM Camera Control</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.2</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>3</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>12C33</string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>11.1</string>
<key>DTSDKBuild</key>
<string>20C63</string>
<key>DTSDKName</key>
<string>macosx11.1</string>
<key>DTXcode</key>
<string>1230</string>
<key>DTXcodeBuild</key>
<string>12C33</string>
<key>LSMinimumSystemVersion</key>
<string>10.9</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2021 Antler Post. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
APPL????
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 4 additions & 4 deletions source/ATEM Camera Control.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,12 @@
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "ATEM Camera Control/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 1.0.1;
MARKETING_VERSION = 1.0.2;
PRODUCT_BUNDLE_IDENTIFIER = "com.antlerpost.ATEM-Camera-Control";
PRODUCT_NAME = "$(TARGET_NAME)";
};
Expand All @@ -296,12 +296,12 @@
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "ATEM Camera Control/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 1.0.1;
MARKETING_VERSION = 1.0.2;
PRODUCT_BUNDLE_IDENTIFIER = "com.antlerpost.ATEM-Camera-Control";
PRODUCT_NAME = "$(TARGET_NAME)";
};
Expand Down
10 changes: 10 additions & 0 deletions source/ATEM Camera Control/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@
- (IBAction)gradeLiftUpdate:(id)sender;
- (IBAction)gradeGammaUpdate:(id)sender;
- (IBAction)gradeSatUpdate:(id)sender;
- (IBAction)runMacroZero:(id)sender;
- (IBAction)runMacroOne:(id)sender;
- (IBAction)runMacroTwo:(id)sender;
- (IBAction)runMacroThree:(id)sender;
- (IBAction)runMacroFour:(id)sender;
- (IBAction)runMacroFive:(id)sender;
- (IBAction)runMacroSix:(id)sender;
- (IBAction)runMacroSeven:(id)sender;
- (IBAction)runMacroNine:(id)sender;
- (IBAction)runMacroEight:(id)sender;


@end
Expand Down
88 changes: 88 additions & 0 deletions source/ATEM Camera Control/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
static const uint8_t kCameraAddress = 1; // Camera Number 1
IBMDSwitcher* switcher;
IBMDSwitcherCameraControl* cameraControl;
IBMDSwitcherMacroControl* macroControl;
double focus = 0.35;
double iris = 0.0;
double zoom = 0.5;
Expand Down Expand Up @@ -83,6 +84,13 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
NSRunAlertPanel(@"Camera Failure", @"Too bad!", @"Quit", nil, nil);
[NSApp terminate:self];
}
// Get camera control interface from switcher object
result = switcher->QueryInterface(IID_IBMDSwitcherMacroControl, (void**)&macroControl);
if (result != S_OK)
{
NSRunAlertPanel(@"Macro Failure", @"Too bad!", @"Quit", nil, nil);
[NSApp terminate:self];
}
[_memA sendActionOn:NSEventMaskLeftMouseDown];
[_memB sendActionOn:NSEventMaskLeftMouseDown];
[_memC sendActionOn:NSEventMaskLeftMouseDown];
Expand Down Expand Up @@ -634,6 +642,86 @@ - (IBAction)gradeGammaUpdate:(id)sender {
[self sendGamma];
}

- (IBAction)runMacroEight:(id)sender {
HRESULT result = macroControl->Run(8);
if (result != S_OK)
{
NSLog(@"Failed to send Macro Eight");
}
}

- (IBAction)runMacroNine:(id)sender {
HRESULT result = macroControl->Run(9);
if (result != S_OK)
{
NSLog(@"Failed to send Macro Nine");
}
}

- (IBAction)runMacroSeven:(id)sender {
HRESULT result = macroControl->Run(7);
if (result != S_OK)
{
NSLog(@"Failed to send Macro Seven");
}
}

- (IBAction)runMacroSix:(id)sender {
HRESULT result = macroControl->Run(6);
if (result != S_OK)
{
NSLog(@"Failed to send Macro Six");
}
}

- (IBAction)runMacroFive:(id)sender {
HRESULT result = macroControl->Run(5);
if (result != S_OK)
{
NSLog(@"Failed to send Macro Five");
}
}

- (IBAction)runMacroFour:(id)sender {
HRESULT result = macroControl->Run(4);
if (result != S_OK)
{
NSLog(@"Failed to send Macro Four");
}
}

- (IBAction)runMacroThree:(id)sender {
HRESULT result = macroControl->Run(3);
if (result != S_OK)
{
NSLog(@"Failed to send Macro Three");
}
}

- (IBAction)runMacroTwo:(id)sender {
HRESULT result = macroControl->Run(2);
if (result != S_OK)
{
NSLog(@"Failed to send Macro Two");
}
}

- (IBAction)runMacroOne:(id)sender {
HRESULT result = macroControl->Run(1);
if (result != S_OK)
{
NSLog(@"Failed to send Macro One");
}
}

- (IBAction)runMacroZero:(id)sender {
HRESULT result = macroControl->Run(0);
if (result != S_OK)
{
NSLog(@"Failed to send Macro Zero");
}
}

- (IBAction)gradeSatUpdate:(id)sender {
gradeSat = [sender floatValue];
[self.gradeSatField setFloatValue:gradeSat];
Expand Down
57 changes: 57 additions & 0 deletions source/ATEM Camera Control/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,63 @@
</items>
</menu>
</menuItem>
<menuItem title="Macro" id="oXW-hV-H9H">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Macro" id="Zm1-QF-8JE">
<items>
<menuItem title="0" keyEquivalent="0" id="rNC-6g-p0x">
<connections>
<action selector="runMacroZero:" target="Voe-Tx-rLC" id="Joy-El-szb"/>
</connections>
</menuItem>
<menuItem title="1" keyEquivalent="1" id="y3V-W2-Lvm">
<connections>
<action selector="runMacroOne:" target="Voe-Tx-rLC" id="upL-EI-4q2"/>
</connections>
</menuItem>
<menuItem title="2" keyEquivalent="2" id="gaG-qr-RGg" userLabel="2">
<connections>
<action selector="runMacroTwo:" target="Voe-Tx-rLC" id="Lac-CT-y8Y"/>
</connections>
</menuItem>
<menuItem title="3" keyEquivalent="3" id="085-1p-fKO" userLabel="3">
<connections>
<action selector="runMacroThree:" target="Voe-Tx-rLC" id="0f1-0g-LbK"/>
</connections>
</menuItem>
<menuItem title="4" keyEquivalent="4" id="jut-Tb-bJP" userLabel="4">
<connections>
<action selector="runMacroFour:" target="Voe-Tx-rLC" id="qOx-dS-9Yq"/>
</connections>
</menuItem>
<menuItem title="5" keyEquivalent="5" id="vx8-dR-go5" userLabel="5">
<connections>
<action selector="runMacroFive:" target="Voe-Tx-rLC" id="k8G-Td-vcU"/>
</connections>
</menuItem>
<menuItem title="6" keyEquivalent="6" id="9TN-ar-YHA" userLabel="6">
<connections>
<action selector="runMacroSix:" target="Voe-Tx-rLC" id="U2n-43-x71"/>
</connections>
</menuItem>
<menuItem title="7" keyEquivalent="7" id="Fs9-u4-saX" userLabel="7">
<connections>
<action selector="runMacroSeven:" target="Voe-Tx-rLC" id="1vh-Vd-CdN"/>
</connections>
</menuItem>
<menuItem title="8" keyEquivalent="8" id="OJW-hT-OhT" userLabel="8">
<connections>
<action selector="runMacroEight:" target="Voe-Tx-rLC" id="JEA-HD-qQJ"/>
</connections>
</menuItem>
<menuItem title="9" keyEquivalent="9" id="hVj-Ga-8eP" userLabel="9">
<connections>
<action selector="runMacroNine:" target="Voe-Tx-rLC" id="Dbd-pQ-dag"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
</menuItem>
Expand Down

0 comments on commit 8881ed5

Please sign in to comment.