Super Source Iterator

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

Michael Valentine

  • Posts: 6
  • Joined: Sun Nov 01, 2015 9:55 pm

Super Source Iterator

PostTue Jan 12, 2016 12:53 pm

I was originally looking at the code for selecting inputs for AUX outputs in another thread and wanted to try and make a couple of changes to see if I could get some code working to do a similar thing for super source box inputs.

I hacked together the below code to try and change the input for box 1 on a button click (This was just an example to see if I could get it working) but I get the error "Specified cast is not valid." on the line "this.m_switcher.CreateIterator(ref ssIteratorIID, out ssIteratorPtr);"

My initial thoughts is that I shouldn't be using "this.m_switcher".

Could someone point me in the right direction for the implementation of the SuperSourceBoxIterator?

Code: Select all
                int Box1 = 1;
                long inputId = 1;
                IBMDSwitcherSuperSourceBoxIterator ssIterator = null;
                IntPtr ssIteratorPtr;
                Guid ssIteratorIID = typeof(IBMDSwitcherSuperSourceBoxIterator).GUID;
                this.m_switcher.CreateIterator(ref ssIteratorIID, out ssIteratorPtr);
                if (ssIteratorPtr != null)
                {
                    ssIterator = (IBMDSwitcherSuperSourceBoxIterator)Marshal.GetObjectForIUnknown(ssIteratorPtr);
                }

                if (ssIterator != null)
                {
                    IBMDSwitcherSuperSourceBox input;
                    ssIterator.Next(out input);
                    int BOXCount = 0;
                    while (input != null)
                    {
                            BOXCount++;
                            if (BOXCount == Box1)
                            {
                                IBMDSwitcherSuperSourceBox liveBox = (IBMDSwitcherSuperSourceBox)input;
                                liveBox.SetInputSource(inputId);
                                break;
                            }
                        ssIterator.Next(out input);
                    }
                }
Offline
User avatar

JohnBengston

  • Posts: 570
  • Joined: Sun Sep 30, 2012 1:52 pm

Re: Super Source Iterator

PostTue Jan 12, 2016 9:42 pm

You need to Query the SuperSource Input to pickup the SuperSource box iterator.

In the same way my example AUX code picks up the AUX Control interface from the Aux "Input", you pickup your iterator for supersource boxes from the SuperSource Input.
Offline

Michael Valentine

  • Posts: 6
  • Joined: Sun Nov 01, 2015 9:55 pm

Re: Super Source Iterator

PostWed Jan 13, 2016 11:21 am

Thanks John. Will look at this again today.
Offline

John Hartwell

  • Posts: 3
  • Joined: Wed Jun 15, 2016 3:26 am

Re: Super Source Iterator

PostThu Aug 04, 2016 2:59 am

Sorry for the previous post. Somehow it got posted before I was through.

I have tried to get iterate the Super Source Box with the following:

IBMDSwitcherSuperSourceBoxIterator ssIterator = null;
IntPtr ssIteratorPtr;
Guid ssIteratorIID = typeof(IBMDSwitcherSuperSourceBoxIterator).GUID;
m_SSource.CreateIterator(ref ssIteratorIID, out ssIteratorPtr);

Where m_SSource is a IBMDSwitcherInputSuperSource object.

I believe this is what John was talking about as the syntax worked well for the audio mixer. While there is no error in the development environment, when run I receive an access violation when the last line is run.

Accoding to the SDK document this seems correct. What have I missed?
Offline

tomerbr

  • Posts: 2
  • Joined: Sun Feb 10, 2019 12:11 am
  • Real Name: Tomer Bron

Re: Super Source Iterator

PostTue Aug 29, 2023 4:09 am

Hi,
any luck figuring that out?
I could use a tip on how to set the source on a supersource box

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 14 guests