VB: Simple Control for AtemSwitcher

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

cpelka

  • Posts: 5
  • Joined: Tue May 05, 2020 12:50 pm
  • Real Name: Christoph Pelka

VB: Simple Control for AtemSwitcher

PostTue May 05, 2020 1:18 pm

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 :)
Christoph
Offline

Ian Morrish

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

Re: VB: Simple Control for AtemSwitcher

PostSat May 09, 2020 12:54 am

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 = ""
Try
switcherDiscovery.ConnectTo("192.168.1.10", connectedSwitcher, failReason)
Dim switcher = connectedSwitcher
Catch ex As COMException
Console.WriteLine("Error #:" + failReason.ToString())
End Try
connectedSwitcher.GetProductName(productName)
Console.WriteLine(productName)
End Sub

End Module
Regards,
Ian Morrish
Video Integrated Scripting Environment
(Windows PowerShell with ATEM driver + more)
https://ianmorrish.wordpress.com
Offline

cpelka

  • Posts: 5
  • Joined: Tue May 05, 2020 12:50 pm
  • Real Name: Christoph Pelka

Re: VB: Simple Control for AtemSwitcher

PostSat May 09, 2020 3:48 pm

Hello Ian,

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

Greetings
Christoph
Offline

cpelka

  • Posts: 5
  • Joined: Tue May 05, 2020 12:50 pm
  • Real Name: Christoph Pelka

Re: VB: Simple Control for AtemSwitcher

PostFri May 22, 2020 11:16 am

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.

Thanks
Christoph
Offline

Ian Morrish

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

Re: VB: Simple Control for AtemSwitcher

PostFri May 22, 2020 8:04 pm

See 5.2.14 IBMDSwitcherKeyFlyParameters Interface
SetPositionX and SetPositionY
Regards,
Ian Morrish
Video Integrated Scripting Environment
(Windows PowerShell with ATEM driver + more)
https://ianmorrish.wordpress.com
Offline

cpelka

  • Posts: 5
  • Joined: Tue May 05, 2020 12:50 pm
  • Real Name: Christoph Pelka

Re: VB: Simple Control for AtemSwitcher

PostMon May 25, 2020 6:23 pm

Made my day Ian, thanks, you are awesome :) would like to donate a Beer to you, is it possible?

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 13 guests