Page 1 of 1

Atem CPP SDK AUX

PostPosted: Fri Oct 16, 2020 2:41 am
by martin.mignon
Hi,

I'm trying to add aux control on the Switcher Panel Sample . I'have already spend hours on it and i'm still not able to figure how it's work.

So i need to itearate all the aux in the Atem, add a Callback on them and finaly get or set the input.

Im already able to know if i have Aux in my atem

Code: Select all
   InputMonitor* inputMonitor = new InputMonitor(input, m_hWnd);

         BMDSwitcherPortType inputPortType;
         input->GetPortType(&inputPortType);
         if(inputPortType==bmdSwitcherPortTypeAuxOutput){
            MessageBox(_T("There is an Aux"), _T("Test Message"));
         }

         input->Release();
         mInputMonitors.push_back(inputMonitor);


But i'm not able to put a Callback on this aux, to get or set an input

Coud you help me ?

Thank's a lot

Martin

Re: Atem CPP SDK AUX

PostPosted: Fri Oct 16, 2020 7:13 pm
by Ian Morrish
You don't need a callback. That is only if you want to be notified of changes.
See this example
https://forum.blackmagicdesign.com/viewtopic.php?f=12&t=101252&p=560887&hilit=aux+iterator#p560887

Re: Atem CPP SDK AUX

PostPosted: Sat Oct 17, 2020 1:12 pm
by martin.mignon
Yes I've seen that exemple but it is in C# and not CPP.

In my project, I need to be notified of changes, maybe in a second time.

Re: Atem CPP SDK AUX

PostPosted: Tue Oct 20, 2020 12:36 am
by Cameron Nichols
Hi Martin,

First you should obtain the IBMDSwitcherInputAux interface[1] from your IBMDSwitcherInput object:
Code: Select all
IBMDSwitcherInputAux* inputAux = nullptr;
HRESULT hr = input->QueryInterface(IID_IBMDSwitcherInputAux, (void**)&inputAux);
if (hr != S_OK)
    // Does not have Input AUX interface
Next generate a new class that implements IBMDSwitcherInputAuxCallback callback interface[2]. Implement IBMDSwitcherInputAuxCallback::Notify to filter BMDSwitcherInputAuxEventType = bmdSwitcherInputAuxEventTypeInputSourceChanged[3]. I recommend passing the input ID to the class constructor (or reference to InputMonitor from your code sample) so that you can uniquely identify the callback.

Finally, register your callback class with IBMDSwitcherInputAux::AddCallback and unregister with IBMDSwitcherInputAux::RemoveCallback.

Regards
Cameron

References (ATEM Switchers SDK Manual):
[1] 2.3.12 IBMDSwitcherInputAux Interface
[2] 2.3.13 IBMDSwitcherInputAuxCallback Interface
[3] 2.2.17 Switcher Aux Events

Re: Atem CPP SDK AUX

PostPosted: Thu Oct 22, 2020 12:35 am
by martin.mignon
Thank's for your help.