mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-01 15:49:51 +08:00
UI: Add versioned sources to scene collection importer
Versioned sources were added in commitb2302902a3after the scene collection importer was added in commit191165c721. 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.
This commit is contained in:
@@ -31,15 +31,17 @@ void TranslateOSStudio(Json &res)
|
||||
|
||||
string id = source["id"].string_value();
|
||||
|
||||
#define DirectTranslation(before, after) \
|
||||
if (id == before) { \
|
||||
source["id"] = after; \
|
||||
#define DirectTranslation(before, after) \
|
||||
if (id == before) { \
|
||||
source["id"] = after; \
|
||||
source["versioned_id"] = obs_get_latest_input_type_id(after); \
|
||||
}
|
||||
|
||||
#define ClearTranslation(before, after) \
|
||||
if (id == before) { \
|
||||
source["id"] = after; \
|
||||
source["settings"] = Json::object{}; \
|
||||
#define ClearTranslation(before, after) \
|
||||
if (id == before) { \
|
||||
source["id"] = after; \
|
||||
source["settings"] = Json::object{}; \
|
||||
source["versioned_id"] = obs_get_latest_input_type_id(after); \
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
Reference in New Issue
Block a user