Getting familiar with IBMDSwitcherSaveRecall Interface

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

Jasmin

  • Posts: 2
  • Joined: Wed Sep 09, 2020 12:02 pm
  • Real Name: Jasmin Kruezi

Getting familiar with IBMDSwitcherSaveRecall Interface

PostWed Sep 09, 2020 12:20 pm

Hey everyone,

my goal is to create a "One-Button" solution to save the current status of a ATEM device. I found the IBMDSwitcherSaveRecall Interface and make it work in c# like so:

Code: Select all
static void Main(string[] args)
      {
         // Code out of the "SimpleSwitcherExampleCSharp" example of the SDK
         IBMDSwitcherDiscovery discovery = new CBMDSwitcherDiscovery();
         IBMDSwitcher switcher;
         _BMDSwitcherConnectToFailure failureReason;
         discovery.ConnectTo("10.30.1.183", out switcher, out failureReason);
         Console.WriteLine("Connected to switcher");
         var atem = new AtemSwitcher(switcher);

         // Here it happens
         IBMDSwitcherSaveRecall speicher = switcher as IBMDSwitcherSaveRecall;
              speicher.Save(_BMDSwitcherSaveRecallType.bmdSwitcherSaveRecallTypeStartupState);
         // Here it ends
         }



Now I am trying the whole thing in C++, having the (probably pretty naive) goal to make it work on a raspberry pi to eliminate the need to hook up a computer, just to save settings. The problem is, I cant figure out how to cast (like in the C# example) or somehow initialize the SwitcherSaveRecall variable, and without having this work, I dont know if the Save-method even work. Do someone have a functioning implementation to show?

This is my attempt so far:
Code: Select all
IBMDSwitcherSaveRecall* saver = ???;
saver->Save(bmdSwitcherSaveRecallTypeStartupState);


Thanks everyone
best wishes
J
Offline

Gary Adams

Blackmagic Design

  • Posts: 1384
  • Joined: Sat Aug 25, 2012 6:14 am

Re: Getting familiar with IBMDSwitcherSaveRecall Interface

PostWed Sep 09, 2020 6:10 pm

Hello Jasmin. There is a Developer Form here where you might find better help.

Regards, Gary
Gary Adams
Blackmagic Design
Offline

Jasmin

  • Posts: 2
  • Joined: Wed Sep 09, 2020 12:02 pm
  • Real Name: Jasmin Kruezi

Re: Getting familiar with IBMDSwitcherSaveRecall Interface

PostTue Oct 13, 2020 9:53 am

Ah, thanks Gary, I reposted it there.
Offline

Tony Rivera

Blackmagic Design

  • Posts: 3456
  • Joined: Mon Aug 12, 2013 4:52 pm
  • Real Name: Tony Rivera

Re: Getting familiar with IBMDSwitcherSaveRecall Interface

PostTue Oct 13, 2020 1:26 pm

Moved post to the proper section of the forums.
Support: http://www.blackmagicdesign.com/support
Info: http://www.blackmagicdesign.com/company

Follow us on Instagram:
@blackmagicnewsofficial
Offline

Cameron Nichols

Blackmagic Design

  • Posts: 442
  • Joined: Mon Sep 04, 2017 4:05 am

Re: Getting familiar with IBMDSwitcherSaveRecall Interface

PostThu Oct 15, 2020 12:31 am

Hi Jasmin,

Please be aware that the ATEM Switchers SDK is only supported on Windows and macOS platforms.

Where C# casts between interfaces, C++ equivalent will use QueryInterface.
Code: Select all
IBMDSwitcherSaveRecall* saver = nullptr;
HRESULT hr = switcher->QueryInterface(IID_IBMDSwitcherSaveRecall, (void**)&saver);
if (hr == S_OK)
    hr = saver->Save(bmdSwitcherSaveRecallTypeStartupState);

Regards
Cameron
Offline

Ian Morrish

  • Posts: 580
  • Joined: Sun Jan 18, 2015 9:24 pm
  • Location: New Zealand

Re: Getting familiar with IBMDSwitcherSaveRecall Interface

PostWed Oct 28, 2020 9:00 am

You can do this on the Raspberry Pi using either a Node.JS or .Net core library (neither use the official API).
I have a PowerShell Core Library which makes it easy to do on the Pi.
The following PS1 file can be run with pwsh.exe or in VSCode PowerShell console (on Mack, Linux or Windows)

Import-Module '.\netstandard2.0\ATEMModule.dll'
$AtemISO = Add-ATEMSwitch -IPAddress "192.168.1.126"
Set-ATEMStartupState $AtemISO

See https://1drv.ms/u/s!ApGpqMMpRLhik5E1tVgBIJ0eq5wx2A?e=GejKcl
You can then use the GPI pins from PowerShell with this module
Install-Module Microsoft.PowerShell.IoT

Then you can get the value of a pin with
Get-GpioPin 2
Regards,
Ian Morrish
Video Integrated Scripting Environment
(Windows PowerShell with ATEM driver + more)
https://ianmorrish.wordpress.com

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 17 guests