Page 1 of 1

VB: Simple Control for AtemSwitcher

PostPosted: Tue May 05, 2020 1:18 pm
by cpelka
Hi, everybody,

for now: I'm new to video production and the last time I programmed was ages ago - and only rudimentary Visual Basic.
I now have a whole bunch of hardware from Blackmagic, including an ATEM Television Studio, 2 Hyperdecks, 1 WebPresenter, an Atem Mini...
Now I need a software that runs on a Windows Tablet with camlink where I can easily select the active camera and additionally persuade the hyperdecks to record by pressing a button.
Ian Morrish did it with Powershell, it's nice and a good starting point.
I've started a new VB Project, added the Blackmagic.dll and can access the BMDSwitcherAPI. On the SDK-pdf and the C# and C++ Samples i've found out that i need to connect via IBMDSwitcherDiscovery.ConnectTo(adress, switcher_interface, failReason) to the Switcher. But I can't get the Switcher_Interface to work properly. Has anyone here implemented something like this in VB and can push me in the right direction?

Thanks for your help :)

Re: VB: Simple Control for AtemSwitcher

PostPosted: Sat May 09, 2020 12:54 am
by Ian Morrish
I have never written a line of VB.Net until today. Got this to compile. See this thread for some more info on ittereators viewtopic.php?f=12&t=63911

Imports BMDSwitcherAPI
Imports System
Imports System.Collections.Generic
Imports System.Runtime.InteropServices
Module Module1

Sub Main()
Dim switcherDiscovery As IBMDSwitcherDiscovery = New CBMDSwitcherDiscovery()
Dim failReason As _BMDSwitcherConnectToFailure = 0
Dim connectedSwitcher As IBMDSwitcher = Nothing
Dim productName As String = ""
switcherDiscovery.ConnectTo("", connectedSwitcher, failReason)
Dim switcher = connectedSwitcher
Catch ex As COMException
Console.WriteLine("Error #:" + failReason.ToString())
End Try
End Sub

End Module

Re: VB: Simple Control for AtemSwitcher

PostPosted: Sat May 09, 2020 3:48 pm
by cpelka
Hello Ian,

thanks, i'll give it a try on monday. But i think i have Seen my mistake :)


Re: VB: Simple Control for AtemSwitcher

PostPosted: Fri May 22, 2020 11:16 am
by cpelka
Hey everyone,

at first: Thanks for help and the hint to iteration Ian - you showed me the right way :)

But i've a new Problem/Question:
I want to Enable/Disable Picture in Picture. Always when PiP is enabled, i want so set the position and Size of PiP.
I've tried over IBMDSwitcherKey, but the only thing i can do is enable/disable OnAir.
What i want to do: Enable PiP and set Picture in Picture position and size.
I've searched the sdk pdf for fill source and any word in english that came into my mind, but i've found nothing. Can anyone help me?
I have an Atem Mini Pro with one upstream keyer here.


Re: VB: Simple Control for AtemSwitcher

PostPosted: Fri May 22, 2020 8:04 pm
by Ian Morrish
See 5.2.14 IBMDSwitcherKeyFlyParameters Interface
SetPositionX and SetPositionY

Re: VB: Simple Control for AtemSwitcher

PostPosted: Mon May 25, 2020 6:23 pm
by cpelka
Made my day Ian, thanks, you are awesome :) would like to donate a Beer to you, is it possible?