- Posts: 3
- Joined: Tue Mar 03, 2020 7:53 am
- Real Name: Remo Roethlisberger
Hi all,
I am very much new to the ATEM suite and also the C++ SDK that is available for the switches. I am currently working on a small project that tries to integrate the Blackmagic Configuration with our own products. I got the first script to work - it compiles and runs just fine. However, it's not actually changing any settings on our Blackmagic ATEM Production Studio 4K. So I was wondering if someone could help me with debugging...
When I call the above function, I can connect to the ATEM. But then nothing more happens! Is there some final send method that one needs to call? I couldn't find anything that would differ from the sample SDK/API snippets that Blackmagic Design provides...
Thanks a lot for your help,
Remo
I am very much new to the ATEM suite and also the C++ SDK that is available for the switches. I am currently working on a small project that tries to integrate the Blackmagic Configuration with our own products. I got the first script to work - it compiles and runs just fine. However, it's not actually changing any settings on our Blackmagic ATEM Production Studio 4K. So I was wondering if someone could help me with debugging...
- Code: Select all
#include "BMDSwitcherAPI.h"
#include <iostream>
// IP Address
static const CFStringRef ip_address = CFSTR("192.168.10.240");
int setMode0()
{
HRESULT result;
// Create discovery instance
IBMDSwitcherDiscovery *discovery = CreateBMDSwitcherDiscoveryInstance();
if (!discovery)
{
std::cerr << "Failed to create IBMDSwitcherDiscovery!" << std::endl;
return 1;
}
// Use discovery instance to connect to switcher
std::cout << "Connecting to switcher..." << std::endl;
IBMDSwitcher *switcher;
BMDSwitcherConnectToFailure connectToFailReason;
result = discovery->ConnectTo(ip_address, &switcher, &connectToFailReason);
discovery->Release();
if (result != S_OK)
{
std::cerr << "Failed to connect to switcher!" << std::endl;
return 1;
}
//Mix Effect input changer
IBMDSwitcherMixEffectBlockIterator *mixIterator = NULL;
result = switcher->CreateIterator(IID_IBMDSwitcherMixEffectBlockIterator, (void **)&mixIterator);
IBMDSwitcherMixEffectBlock *mixEffect = NULL;
if (SUCCEEDED(result))
{
while (S_OK == mixIterator->Next(&mixEffect))
{
// set the program input
mixEffect->SetProgramInput(5);
}
}
//Downstream Keyer
IBMDSwitcherDownstreamKeyIterator *dskIterator = NULL;
result = switcher->CreateIterator(IID_IBMDSwitcherDownstreamKeyIterator, (void **)&dskIterator);
IBMDSwitcherDownstreamKey *downstreamKey = NULL;
int i = 0;
if (SUCCEEDED(result))
{
while (S_OK == dskIterator->Next(&downstreamKey))
{
if (i)
{
// this is the key - which should be media input key
downstreamKey->SetInputCut(5);
// this is the fill source which would be the computer output
downstreamKey->SetInputFill(2);
// mask the area we want
downstreamKey->SetMasked(true);
downstreamKey->SetMaskBottom(-12.0);
downstreamKey->SetMaskLeft(-4.0);
downstreamKey->SetMaskRight(9);
downstreamKey->SetMaskTop(5.0);
i = 0;
}
else
{
// this is the key - which should be media input key
downstreamKey->SetInputCut(5);
// this is the fill source which would be the computer output
downstreamKey->SetInputFill(2);
i = 1;
}
}
}
dskIterator->Release();
dskIterator = NULL;
switcher->Release();
return 0;
}
When I call the above function, I can connect to the ATEM. But then nothing more happens! Is there some final send method that one needs to call? I couldn't find anything that would differ from the sample SDK/API snippets that Blackmagic Design provides...
Thanks a lot for your help,
Remo