Add support for importing the Screen Capture source type from Streamlabs
scene collections. Since the Screen Capture source type is essentially
an abstraction layer for Display Capture, Game Capture, and Window
Capture, this adds some translation logic to translate Screen Capture
sources into one of those source types.
Importers are written to convert third-party collection formats to a
Windows OBS scene collection. The Studio importer is capable of
translating scene collections to the correct types for the current
operating system. This change makes it so all imports will be ran
through the Studio translation, not just Studio and SL collections.
This change makes it so any strings in a scene collection that start
with "./" are checked as being a relative path. As long as the resulting
absolute path is contained within the same directory as the collection
being imported, it will be replaced with an absolute path.
This allows scene collections to be effectively "packaged" with assets,
so long as the assets are contained somewhere within the folder the
collection is being imported from.
Versioned sources were added in commit
b2302902a3 after the scene collection
importer was added in commit 191165c721.
When a versioned source gets converted in TranslateOSStudio, it can end
up with a translated "id" but an untranslated "versioned_id". When OBS
loads the resulting JSON, it will rely on the versioned_id, and rewrite
the id to the corresponding value. Use obs_get_latest_input_type_id on
the translated source id to get the correct versioned_id when using
TranslateOSStudio.
The OS translation in the Scene Collection Importer seems to have been
broken since the feature was added because the translated sources were
not added back to the output JSON object. Add the translated sources to
the output JSON object to get the feature to work.
Previously, the importer assumed scenes had fields that sources did for
audio, namely volume, sync, mute and monitoring type. SL scenes do not
have these fields. This resulted in mistakes in importing, such as
imported scenes having a volume of 0.0.
This change gets rid of the non-existent fields, and explicitly sets the
volume of the scenes to 1.0 as a precaution.
The previous fix for repeated names accidentally meant that if a scene
item in a scene was meant to show another scene that was lower in the
list, it would fail to create the item, and wouldn't make it into the
imported collection.
This fix makes sure that scenes as sources still works properly in that
situation.
This replaces the previous Open File dialog for importing collections
with a window for importing many collections at once, based on the remux
window, along with support for importing from OBS Classic, XSplit
Broadcaster and from Streamlabs' fork. This also translates sources
between OSes that Studio supports.