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: 1081
  • 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: 3423
  • 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: 305
  • 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

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 7 guests