- Posts: 2
- Joined: Sun Sep 12, 2021 6:18 pm
- Real Name: Jeff Oakley
Hi, First time posting on this forum!
I have a custom made motorized Pan/Tilt mount and I am working on a project to get the Pan/Tilt status of the Joystick on an ATEM 1 M/E Advanced Panel. I'm using windows and the firmware version of the panel is 8.5.3 and I'm using the 8.5.3 version of the SDK.
I started with the CameraFocus example which is written in C++. If I make no changes to the example I am able to connect to the switcher and it will issue the first SetFloats() without error but then fails on subsequent calls. The same is true if I call GetFloats(), it will show S_OK on the first call then all subsequent calls return with E_FAIL.
Then I saw there was a C# example (A language I'm much more familiar with). Using that I am able to to successfully call GetFloats() multiple times. Then (with the code below) I am able to sucessfully get the current Pan value (left and right) of the joystick but not the Tilt value. In the C++ library the GetFloats function has an output parameter that returns a pointer to an array instead of a just a single double value like the C# library.
I was not able to find any documentation on the C# library so I figured I would see if anyone here had any thoughts on what I can do to get either the C++ version working or what I may be doing incorrectly to get the Tilt value as well in the C# library.
Thanks so much for any help!
I have a custom made motorized Pan/Tilt mount and I am working on a project to get the Pan/Tilt status of the Joystick on an ATEM 1 M/E Advanced Panel. I'm using windows and the firmware version of the panel is 8.5.3 and I'm using the 8.5.3 version of the SDK.
I started with the CameraFocus example which is written in C++. If I make no changes to the example I am able to connect to the switcher and it will issue the first SetFloats() without error but then fails on subsequent calls. The same is true if I call GetFloats(), it will show S_OK on the first call then all subsequent calls return with E_FAIL.
Then I saw there was a C# example (A language I'm much more familiar with). Using that I am able to to successfully call GetFloats() multiple times. Then (with the code below) I am able to sucessfully get the current Pan value (left and right) of the joystick but not the Tilt value. In the C++ library the GetFloats function has an output parameter that returns a pointer to an array instead of a just a single double value like the C# library.
I was not able to find any documentation on the C# library so I figured I would see if anyone here had any thoughts on what I can do to get either the C++ version working or what I may be doing incorrectly to get the Tilt value as well in the C# library.
Thanks so much for any help!
- Code: Select all
static void Main(string[] args)
{
// Create switcher discovery object
IBMDSwitcherDiscovery discovery = new CBMDSwitcherDiscovery();
// Connect to switcher
IBMDSwitcher switcher;
_BMDSwitcherConnectToFailure failureReason;
discovery.ConnectTo("192.168.10.240", out switcher, out failureReason);
Console.WriteLine("Connected to switcher");
IntPtr cameraControlIntPtr;
IBMDSwitcherCameraControl cameraControl;
Guid cameraControlGuid = typeof(IBMDSwitcherCameraControl).GUID;
IntPtr pSwitcher = Marshal.GetIUnknownForObject(switcher);
int queryInterfaceResult = Marshal.QueryInterface(pSwitcher, ref cameraControlGuid, out cameraControlIntPtr);
cameraControl = Marshal.GetObjectForIUnknown(cameraControlIntPtr) as IBMDSwitcherCameraControl;
uint count = 2;
double outputValues;
while (true)
{
cameraControl.GetFloats(1, 11, 0, ref count, out outputValues);
Console.WriteLine(outputValues);
System.Threading.Thread.Sleep(100);
}
}