From 6319973b2f58903575b1d164cc9d211e1b2b42ea Mon Sep 17 00:00:00 2001 From: VodBox Date: Mon, 23 Mar 2020 23:18:46 +1300 Subject: [PATCH] UI: Fix silent scenes with imported SL scenes 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. --- UI/importers/sl.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/UI/importers/sl.cpp b/UI/importers/sl.cpp index c1b98b24b..11e55a4ad 100644 --- a/UI/importers/sl.cpp +++ b/UI/importers/sl.cpp @@ -298,15 +298,8 @@ static int attempt_import(const Json &root, const string &name, Json &res) Json::array filter_items = in_filters["items"].array_items(); Json in_settings = scene["settings"]; - Json in_sync = scene["syncOffset"]; - int sync = (int)(in_sync["sec"].number_value() * 1000000000 + - in_sync["nsec"].number_value()); - - double vol = scene["volume"].number_value(); - bool muted = scene["muted"].bool_value(); string name = scene["name"].string_value(); - int monitoring = scene["monitoringType"].int_value(); Json::object out_hotkeys = Json::object{}; get_hotkey_bindings(out_hotkeys, hotkey_items, ""); @@ -336,11 +329,8 @@ static int attempt_import(const Json &root, const string &name, Json &res) {"id", "scene"}, {"sl_id", sl_id}, {"settings", in_settings}, - {"sync", sync}, - {"volume", vol}, - {"muted", muted}, + {"volume", 1.0}, {"name", out_name}, - {"monitoring_type", monitoring}, {"private_settings", Json::object{}}}; Json in_items = scene["sceneItems"];