+ if (env::properties().get(L"configuration.channel-grid", false))
+ {
+ auto channel_id = static_cast<int>(channels_.size() + 1);
+ channels_.push_back(spl::make_shared<video_channel>(
+ channel_id,
+ core::video_format_desc(core::video_format::x576p2500),
+ *core::audio_channel_layout_repository::get_default()->get_layout(L"stereo"),
+ accelerator_.create_image_mixer(channel_id)));
+ channels_.back()->monitor_output().attach_parent(monitor_subject_);
+ }
+ }
+
+ void setup_osc(const boost::property_tree::wptree& pt)
+ {
+ using boost::property_tree::wptree;
+ using namespace boost::asio::ip;
+
+ monitor_subject_->attach_parent(osc_client_->sink());
+
+ auto default_port =
+ pt.get<unsigned short>(L"configuration.osc.default-port", 6250);
+ auto disable_send_to_amcp_clients =
+ pt.get(L"configuration.osc.disable-send-to-amcp-clients", false);
+ auto predefined_clients =
+ pt.get_child_optional(L"configuration.osc.predefined-clients");
+
+ if (predefined_clients)
+ {
+ for (auto& predefined_client : pt | witerate_children(L"configuration.osc.predefined-clients") | welement_context_iteration)
+ {
+ ptree_verify_element_name(predefined_client, L"predefined-client");
+
+ const auto address =
+ ptree_get<std::wstring>(predefined_client.second, L"address");
+ const auto port =
+ ptree_get<unsigned short>(predefined_client.second, L"port");
+ predefined_osc_subscriptions_.push_back(
+ osc_client_->get_subscription_token(udp::endpoint(
+ address_v4::from_string(u8(address)),
+ port)));
+ }
+ }
+
+ if (!disable_send_to_amcp_clients && primary_amcp_server_)
+ primary_amcp_server_->add_client_lifecycle_object_factory(
+ [=] (const std::string& ipv4_address)
+ -> std::pair<std::wstring, std::shared_ptr<void>>
+ {
+ using namespace boost::asio::ip;
+
+ return std::make_pair(
+ std::wstring(L"osc_subscribe"),
+ osc_client_->get_subscription_token(
+ udp::endpoint(
+ address_v4::from_string(
+ ipv4_address),
+ default_port)));
+ });