nrkno / sofie-atem-connection

Sofie ATEM Connection: A Part of the Sofie TV Studio Automation System
https://github.com/nrkno/Sofie-TV-automation/
MIT License
129 stars 36 forks source link

How to work with macros #119

Closed br8kpoint closed 2 years ago

br8kpoint commented 3 years ago

Initially I'd like to just list the macros defined by name and then run them however that happens.

Then I'd like to be able to change the macros around. Do you do this by loading an xml or would it be programatically by setting the properties?

I'm looking to add macro functionality to the touch portal extension I built: https://github.com/br8kpoint/touch-portal-atem

Julusian commented 3 years ago

Currently the support for macros matches what you can do in the atem software except for handling them in xml form. The methods available are: image

Being able to generate and upload macros is something I would like to support (and did make some progress on in the past for another atem library/project https://github.com/LibAtem/AtemMacroEditor), but I have not found any prior work on it, so it is a very large task of reverse engineering every macro operation (with no list of what they all are).

It is something I would like to do one day, but I need to find the time to get it started

br8kpoint commented 3 years ago

Thanks for the response. I finally have some time to work on this and can see the functions to actually run and control the macros. What I do not see is a way to actually obtain the list of macros already defined in the system. I would like to present the list of macros by name in the UI of my plugin for say the "Run" action of a Touch Portal button that users define. Is there a way to get the number of macros that are currently defined and then get the macro meta data such as the name/index? Something like macroGetProperties?

Julusian commented 3 years ago

Look at the state property on the client object. That tracks the current state of the atem, including the names and descriptions of the macros. Be careful to handle it and some of the contents being null