+
+ void setup_audio_config(const boost::property_tree::wptree& pt)
+ {
+ using boost::property_tree::wptree;
+
+ auto default_config = get_default_audio_config();
+
+ // Start with the defaults
+ audio_channel_layout_repository::get_default()->register_all_layouts(default_config.get_child(L"audio.channel-layouts"));
+ audio_mix_config_repository::get_default()->register_all_configs(default_config.get_child(L"audio.mix-configs"));
+
+ // Merge with user configuration (adds to or overwrites the defaults)
+ auto custom_channel_layouts = pt.get_child_optional(L"configuration.audio.channel-layouts");
+ auto custom_mix_configs = pt.get_child_optional(L"configuration.audio.mix-configs");
+
+ if (custom_channel_layouts)
+ {
+ CASPAR_SCOPED_CONTEXT_MSG("/configuration/audio/channel-layouts");
+ audio_channel_layout_repository::get_default()->register_all_layouts(*custom_channel_layouts);
+ }
+
+ if (custom_mix_configs)
+ {
+ CASPAR_SCOPED_CONTEXT_MSG("/configuration/audio/mix-configs");
+ audio_mix_config_repository::get_default()->register_all_configs(*custom_mix_configs);
+ }
+ }
+