std::wstring log;\r
std::wstring ftemplate;\r
std::wstring data;\r
-boost::property_tree::ptree pt;\r
+boost::property_tree::wptree pt;\r
\r
void check_is_configured()\r
{\r
BOOST_THROW_EXCEPTION(invalid_operation() << msg_info("Enviroment properties has not been configured"));\r
}\r
\r
-void configure(const std::string& filename)\r
+void configure(const std::wstring& filename)\r
{\r
try\r
{\r
- std::string initialPath = boost::filesystem::initial_path().file_string();\r
+ auto initialPath = boost::filesystem::initial_path<boost::filesystem2::wpath>().file_string();\r
\r
- boost::property_tree::read_xml(initialPath + "\\" + filename, pt, boost::property_tree::xml_parser::trim_whitespace | boost::property_tree::xml_parser::no_comments);\r
-\r
- auto paths = pt.get_child("configuration.paths");\r
- media = widen(paths.get("media-path", initialPath + "\\media\\"));\r
- log = widen(paths.get("log-path", initialPath + "\\log\\"));\r
- ftemplate = complete(wpath(widen(paths.get("template-path", initialPath + "\\template\\")))).string(); \r
- data = widen(paths.get("data-path", initialPath + "\\data\\"));\r
+ std::wifstream file(initialPath + L"\\" + filename);\r
+ boost::property_tree::read_xml(file, pt, boost::property_tree::xml_parser::trim_whitespace | boost::property_tree::xml_parser::no_comments);\r
+\r
+ auto paths = pt.get_child(L"configuration.paths");\r
+ media = widen(paths.get(L"media-path", initialPath + L"\\media\\"));\r
+ log = widen(paths.get(L"log-path", initialPath + L"\\log\\"));\r
+ ftemplate = complete(wpath(widen(paths.get(L"template-path", initialPath + L"\\template\\")))).string(); \r
+ data = widen(paths.get(L"data-path", initialPath + L"\\data\\"));\r
}\r
catch(...)\r
{\r
return ver;\r
}\r
\r
-const boost::property_tree::ptree& properties()\r
+const boost::property_tree::wptree& properties()\r
{\r
check_is_configured();\r
return pt;\r
\r
namespace caspar { namespace env {\r
\r
-void configure(const std::string& filename);\r
+void configure(const std::wstring& filename);\r
\r
const std::wstring& media_folder();\r
const std::wstring& log_folder();\r
const std::wstring& data_folder();\r
const std::wstring& version();\r
\r
-const boost::property_tree::ptree& properties();\r
+const boost::property_tree::wptree& properties();\r
\r
} }
\ No newline at end of file
\r
try\r
{ \r
- g_blend_modes = glTextureBarrierNV ? env::properties().get("configuration.blend-modes", false) : false;\r
+ g_blend_modes = glTextureBarrierNV ? env::properties().get(L"configuration.blend-modes", false) : false;\r
g_shader.reset(new shader(get_vertex(), get_fragment(g_blend_modes)));\r
}\r
catch(...)\r
graph_->set_text(print());\r
diagnostics::register_graph(graph_);\r
\r
- for(int n = 0; n < std::max(1, env::properties().get("configuration.pipeline-tokens", 2)); ++n)\r
+ for(int n = 0; n < std::max(1, env::properties().get(L"configuration.pipeline-tokens", 2)); ++n)\r
stage_->spawn_token();\r
\r
CASPAR_LOG(info) << print() << " Successfully Initialized.";\r
return make_safe<bluefish_consumer_proxy>(device_index, embedded_audio, key_only);\r
}\r
\r
-safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree) \r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree) \r
{ \r
- const auto device_index = ptree.get("device", 1);\r
- const auto embedded_audio = ptree.get("embedded-audio", false);\r
- const auto key_only = ptree.get("key-only", false);\r
+ const auto device_index = ptree.get(L"device", 1);\r
+ const auto embedded_audio = ptree.get(L"embedded-audio", false);\r
+ const auto key_only = ptree.get(L"key-only", false);\r
\r
return make_safe<bluefish_consumer_proxy>(device_index, embedded_audio, key_only);\r
}\r
namespace bluefish {\r
\r
safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
-safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree);\r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree);\r
\r
}}
\ No newline at end of file
return make_safe<decklink_consumer_proxy>(config);\r
}\r
\r
-safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree) \r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree) \r
{\r
configuration config;\r
\r
- config.internal_key = ptree.get("internal-key", config.internal_key);\r
- config.low_latency = ptree.get("low-latency", config.low_latency);\r
- config.key_only = ptree.get("key-only", config.key_only);\r
- config.device_index = ptree.get("device", config.device_index);\r
- config.embedded_audio = ptree.get("embedded-audio", config.embedded_audio);\r
- config.base_buffer_depth = ptree.get("buffer-depth", config.base_buffer_depth);\r
+ config.internal_key = ptree.get(L"internal-key", config.internal_key);\r
+ config.low_latency = ptree.get(L"low-latency", config.low_latency);\r
+ config.key_only = ptree.get(L"key-only", config.key_only);\r
+ config.device_index = ptree.get(L"device", config.device_index);\r
+ config.embedded_audio = ptree.get(L"embedded-audio", config.embedded_audio);\r
+ config.base_buffer_depth = ptree.get(L"buffer-depth", config.base_buffer_depth);\r
\r
return make_safe<decklink_consumer_proxy>(config);\r
}\r
namespace decklink {\r
\r
safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
-safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree);\r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree);\r
\r
}}
\ No newline at end of file
return make_safe<ffmpeg_consumer_proxy>(env::media_folder() + filename, key_only, codec, options);\r
}\r
\r
-safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree)\r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree)\r
{\r
- std::string filename = ptree.get<std::string>("path");\r
- auto key_only = ptree.get("key-only", false);\r
- auto codec = ptree.get("codec", "libx264");\r
- auto options = ptree.get("options", "");\r
+ auto filename = ptree.get<std::wstring>(L"path");\r
+ auto key_only = ptree.get(L"key-only", false);\r
+ auto codec = ptree.get(L"codec", L"libx264");\r
+ auto options = ptree.get(L"options", L"");\r
\r
- return make_safe<ffmpeg_consumer_proxy>(env::media_folder() + widen(filename), key_only, widen(codec), widen(options));\r
+ return make_safe<ffmpeg_consumer_proxy>(env::media_folder() + filename, key_only, codec, options);\r
}\r
\r
}}\r
\r
\r
safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
-safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree);\r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree);\r
\r
}}
\ No newline at end of file
: display_mode_(display_mode::invalid)\r
, in_fps_(in_fps)\r
, format_desc_(frame_factory->get_video_format_desc())\r
- , auto_transcode_(env::properties().get("configuration.auto-transcode", true))\r
- , auto_deinterlace_(env::properties().get("configuration.auto-deinterlace", true))\r
+ , auto_transcode_(env::properties().get(L"configuration.auto-transcode", true))\r
+ , auto_deinterlace_(env::properties().get(L"configuration.auto-deinterlace", true))\r
, audio_cadence_(format_desc_.audio_cadence)\r
, frame_factory_(frame_factory)\r
, filter_str_(filter_str)\r
\r
struct template_host\r
{\r
- std::string field_mode;\r
- std::string filename;\r
- size_t width;\r
- size_t height;\r
+ std::wstring video_mode;\r
+ std::wstring filename;\r
+ size_t width;\r
+ size_t height;\r
};\r
\r
template_host get_template_host(const core::video_format_desc& desc)\r
try\r
{\r
std::vector<template_host> template_hosts;\r
- BOOST_FOREACH(auto& xml_mapping, env::properties().get_child("configuration.template-hosts"))\r
+ BOOST_FOREACH(auto& xml_mapping, env::properties().get_child(L"configuration.template-hosts"))\r
{\r
try\r
{\r
template_host template_host;\r
- template_host.field_mode = xml_mapping.second.get("video-mode", narrow(desc.name));\r
- template_host.filename = xml_mapping.second.get("filename", "cg.fth");\r
- template_host.width = xml_mapping.second.get("width", desc.width);\r
- template_host.height = xml_mapping.second.get("height", desc.height);\r
+ template_host.video_mode = xml_mapping.second.get(L"video-mode", L"");\r
+ template_host.filename = xml_mapping.second.get(L"filename", L"cg.fth");\r
+ template_host.width = xml_mapping.second.get(L"width", desc.width);\r
+ template_host.height = xml_mapping.second.get(L"height", desc.height);\r
template_hosts.push_back(template_host);\r
}\r
catch(...){}\r
}\r
\r
- auto template_host_it = boost::find_if(template_hosts, [&](template_host template_host){return template_host.field_mode == narrow(desc.name);});\r
+ auto template_host_it = boost::find_if(template_hosts, [&](template_host template_host){return template_host.video_mode == desc.name;});\r
if(template_host_it == template_hosts.end())\r
- template_host_it = boost::find_if(template_hosts, [&](template_host template_host){return template_host.field_mode == "";});\r
+ template_host_it = boost::find_if(template_hosts, [&](template_host template_host){return template_host.video_mode == L"";});\r
\r
if(template_host_it != template_hosts.end())\r
return *template_host_it;\r
}\r
- catch(...)\r
- {\r
- }\r
+ catch(...){}\r
\r
template_host template_host;\r
- template_host.filename = "cg.fth";\r
+ template_host.filename = L"cg.fth";\r
\r
for(auto it = boost::filesystem2::wdirectory_iterator(env::template_folder()); it != boost::filesystem2::wdirectory_iterator(); ++it)\r
{\r
if(boost::iequals(it->path().extension(), L"." + desc.name))\r
{\r
- template_host.filename = narrow(it->filename());\r
+ template_host.filename = it->filename();\r
break;\r
}\r
}\r
\r
- template_host.width = desc.square_width;\r
+ template_host.width = desc.square_width;\r
template_host.height = desc.square_height;\r
return template_host;\r
}\r
{\r
auto template_host = get_template_host(frame_factory->get_video_format_desc());\r
\r
- return create_producer_destroy_proxy(make_safe<flash_producer>(frame_factory, env::template_folder() + L"\\" + widen(template_host.filename), template_host.width, template_host.height));\r
+ return create_producer_destroy_proxy(make_safe<flash_producer>(frame_factory, env::template_folder() + L"\\" + template_host.filename, template_host.width, template_host.height));\r
}\r
\r
std::wstring find_template(const std::wstring& template_name)\r
return make_safe<ogl_consumer_proxy>(config);\r
}\r
\r
-safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree) \r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree) \r
{\r
configuration config;\r
- config.name = widen(ptree.get("name", narrow(config.name)));\r
- config.screen_index = ptree.get("device", config.screen_index+1)-1;\r
- config.windowed = ptree.get("windowed", config.windowed);\r
- config.key_only = ptree.get("key-only", config.key_only);\r
- config.auto_deinterlace = ptree.get("auto-deinterlace", config.auto_deinterlace);\r
+ config.name = ptree.get(L"name", config.name);\r
+ config.screen_index = ptree.get(L"device", config.screen_index+1)-1;\r
+ config.windowed = ptree.get(L"windowed", config.windowed);\r
+ config.key_only = ptree.get(L"key-only", config.key_only);\r
+ config.auto_deinterlace = ptree.get(L"auto-deinterlace", config.auto_deinterlace);\r
\r
- auto stretch_str = ptree.get("stretch", "default");\r
- if(stretch_str == "uniform")\r
+ auto stretch_str = ptree.get(L"stretch", L"default");\r
+ if(stretch_str == L"uniform")\r
config.stretch = stretch::uniform;\r
- else if(stretch_str == "uniform_to_fill")\r
+ else if(stretch_str == L"uniform_to_fill")\r
config.stretch = stretch::uniform_to_fill;\r
\r
return make_safe<ogl_consumer_proxy>(config);\r
\r
\r
safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
-safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree);\r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree);\r
\r
}}
\ No newline at end of file
\r
#include <common/log/log.h>\r
#include <common/diagnostics/graph.h>\r
+#include <common/os/windows/current_version.h>\r
+#include <common/os/windows/system_info.h>\r
\r
#include <core/producer/frame_producer.h>\r
#include <core/video_format.h>\r
#include <core/mixer/mixer.h>\r
#include <core/consumer/output.h>\r
\r
+#include <modules/bluefish/bluefish.h>\r
+#include <modules/decklink/decklink.h>\r
+#include <modules/ffmpeg/ffmpeg.h>\r
#include <modules/flash/flash.h>\r
#include <modules/flash/util/swf.h>\r
#include <modules/flash/producer/flash_producer.h>\r
#include <modules/flash/producer/cg_producer.h>\r
#include <modules/ffmpeg/producer/util/util.h>\r
+#include <modules/image/image.h>\r
\r
#include <algorithm>\r
#include <locale>\r
\r
bool InfoCommand::DoExecute()\r
{\r
- if(_parameters.size() >= 1 && _parameters[0] == L"TEMPLATE")\r
- { \r
- try\r
- {\r
+ std::wstringstream replyString;\r
+ \r
+ boost::property_tree::xml_writer_settings<wchar_t> w(' ', 3);\r
+\r
+ try\r
+ {\r
+ if(_parameters.size() >= 1 && _parameters[0] == L"TEMPLATE")\r
+ { \r
+ replyString << L"201 INFO TEMPLATE OK\r\n";\r
+\r
// Needs to be extended for any file, not just flash.\r
\r
auto filename = flash::find_template(env::template_folder() + _parameters.at(1));\r
-\r
- std::wstringstream replyString;\r
- replyString << L"201 INFO OK\r\n";\r
- \r
+ \r
std::wstringstream str;\r
str << widen(flash::read_template_meta_info(filename));\r
boost::property_tree::wptree info;\r
boost::property_tree::xml_parser::read_xml(str, info, boost::property_tree::xml_parser::trim_whitespace | boost::property_tree::xml_parser::no_comments);\r
- boost::property_tree::xml_parser::write_xml(replyString, info, boost::property_tree::xml_writer_settings<wchar_t>(' ', 3));\r
\r
- replyString << L"\r\n";\r
+ boost::property_tree::xml_parser::write_xml(replyString, info, w);\r
+ }\r
+ else if(_parameters.size() >= 1 && _parameters[0] == L"CONFIG")\r
+ { \r
+ replyString << L"201 INFO CONFIG OK\r\n";\r
\r
- SetReplyString(replyString.str());\r
- return true;\r
+ boost::property_tree::write_xml(replyString, caspar::env::properties(), w);\r
}\r
- catch(...)\r
+ else if(_parameters.size() >= 1 && _parameters[0] == L"PATHS")\r
{\r
- SetReplyString(TEXT("403 INFO ERROR\r\n"));\r
- return false;\r
+ replyString << L"201 INFO PATHS OK\r\n";\r
+\r
+ boost::property_tree::wptree info;\r
+ info.add_child(L"paths", caspar::env::properties().get_child(L"configuration.paths"));\r
+ info.add(L"paths.initial-path", boost::filesystem2::initial_path<boost::filesystem2::wpath>().directory_string() + L"\\");\r
+\r
+ boost::property_tree::write_xml(replyString, info, w);\r
}\r
- }\r
- else // channel\r
- {\r
- try\r
+ else if(_parameters.size() >= 1 && _parameters[0] == L"SYSTEM")\r
+ {\r
+ replyString << L"201 INFO SYSTEM OK\r\n";\r
+ \r
+ boost::property_tree::wptree info;\r
+ \r
+ info.add(L"system.name", caspar::get_system_product_name());\r
+ info.add(L"system.windows.name", caspar::get_win_product_name());\r
+ info.add(L"system.windows.service-pack", caspar::get_win_sp_version());\r
+ info.add(L"system.cpu", caspar::get_cpu_info());\r
+ \r
+ BOOST_FOREACH(auto device, caspar::decklink::get_device_list())\r
+ info.add(L"system.decklink.device", device);\r
+\r
+ BOOST_FOREACH(auto device, caspar::bluefish::get_device_list())\r
+ info.add(L"system.bluefish.device", device);\r
+ \r
+ info.add(L"system.flash", caspar::flash::get_version());\r
+ info.add(L"system.free-image", caspar::image::get_version());\r
+ info.add(L"system.ffmpeg.avcodec", caspar::ffmpeg::get_avcodec_version());\r
+ info.add(L"system.ffmpeg.avformat", caspar::ffmpeg::get_avformat_version());\r
+ info.add(L"system.ffmpeg.avfilter", caspar::ffmpeg::get_avfilter_version());\r
+ info.add(L"system.ffmpeg.avutil", caspar::ffmpeg::get_avutil_version());\r
+ info.add(L"system.ffmpeg.swscale", caspar::ffmpeg::get_swscale_version());\r
+ \r
+ boost::property_tree::write_xml(replyString, info, w);\r
+ }\r
+ else // channel\r
{\r
- std::wstringstream replyString;\r
replyString << TEXT("201 INFO OK\r\n");\r
\r
boost::property_tree::wptree info;\r
int index = 0;\r
BOOST_FOREACH(auto channel, channels_)\r
info.add_child(L"channels.channel", channel->info())\r
- .add(L"index", ++index);\r
+ .add(L"index", ++index);\r
}\r
\r
- boost::property_tree::xml_parser::write_xml(replyString, info, boost::property_tree::xml_writer_settings<wchar_t>(' ', 3));\r
- replyString << TEXT("\r\n");\r
- SetReplyString(replyString.str());\r
- return true;\r
- }\r
- catch(...)\r
- {\r
- SetReplyString(TEXT("403 INFO ERROR\r\n"));\r
- return false;\r
+ boost::property_tree::xml_parser::write_xml(replyString, info, w);\r
}\r
}\r
+ catch(...)\r
+ {\r
+ SetReplyString(TEXT("403 INFO ERROR\r\n"));\r
+ return false;\r
+ }\r
+\r
+ replyString << TEXT("\r\n");\r
+ SetReplyString(replyString.str());\r
+ return true;\r
}\r
\r
bool ClsCommand::DoExecute()\r
<decklink>\r
<embedded-audio>true</embedded-audio>\r
</decklink>\r
+ <screen>\r
+ \r
+ </screen>\r
</consumers>\r
</channel>\r
</channels>\r
#include <common/os/windows/current_version.h>\r
#include <common/os/windows/system_info.h>\r
\r
-#include <core/mixer/gpu/ogl_device.h>\r
-\r
#include <tbb/task_scheduler_init.h>\r
#include <tbb/task_scheduler_observer.h>\r
\r
#include <boost/property_tree/detail/file_parser_error.hpp>\r
#include <boost/property_tree/xml_parser.hpp>\r
-\r
-#include <algorithm>\r
+#include <boost/foreach.hpp>\r
\r
// NOTE: This is needed in order to make CComObject work since this is not a real ATL project.\r
CComModule _AtlModule;\r
CASPAR_LOG(info) << L"on " << caspar::get_win_product_name() << L" " << caspar::get_win_sp_version();\r
CASPAR_LOG(info) << caspar::get_cpu_info();\r
CASPAR_LOG(info) << caspar::get_system_product_name();\r
- CASPAR_LOG(info) << L"Flash " << caspar::flash::get_version();\r
- CASPAR_LOG(info) << L"FreeImage " << caspar::image::get_version();\r
\r
CASPAR_LOG(info) << L"Decklink " << caspar::decklink::get_version();\r
- auto deck = caspar::decklink::get_device_list();\r
- std::for_each(deck.begin(), deck.end(), [](const std::wstring& device)\r
- {\r
- CASPAR_LOG(info) << L" - " << device;\r
- });\r
+ BOOST_FOREACH(auto device, caspar::decklink::get_device_list())\r
+ CASPAR_LOG(info) << L" - " << device; \r
\r
CASPAR_LOG(info) << L"Bluefish " << caspar::bluefish::get_version();\r
- auto blue = caspar::bluefish::get_device_list();\r
- std::for_each(blue.begin(), blue.end(), [](const std::wstring& device)\r
- {\r
- CASPAR_LOG(info) << L" - " << device;\r
- });\r
+ BOOST_FOREACH(auto device, caspar::bluefish::get_device_list())\r
+ CASPAR_LOG(info) << L" - " << device; \r
\r
+ CASPAR_LOG(info) << L"Flash " << caspar::flash::get_version();\r
+ CASPAR_LOG(info) << L"FreeImage " << caspar::image::get_version();\r
CASPAR_LOG(info) << L"FFMPEG-avcodec " << caspar::ffmpeg::get_avcodec_version();\r
CASPAR_LOG(info) << L"FFMPEG-avformat " << caspar::ffmpeg::get_avformat_version();\r
CASPAR_LOG(info) << L"FFMPEG-avfilter " << caspar::ffmpeg::get_avfilter_version();\r
try \r
{\r
// Configure environment properties from configuration.\r
- caspar::env::configure("casparcg.config");\r
+ caspar::env::configure(L"casparcg.config");\r
\r
#ifdef _DEBUG\r
- if(caspar::env::properties().get("configuration.debugging.remote", false))\r
+ if(caspar::env::properties().get(L"configuration.debugging.remote", false))\r
MessageBox(nullptr, TEXT("Now is the time to connect for remote debugging..."), TEXT("Debug"), MB_OK | MB_TOPMOST);\r
#endif \r
\r
// Print environment information.\r
print_info();\r
\r
- std::stringstream str;\r
- boost::property_tree::xml_writer_settings<char> w(' ', 3);\r
+ std::wstringstream str;\r
+ boost::property_tree::xml_writer_settings<wchar_t> w(' ', 3);\r
boost::property_tree::write_xml(str, caspar::env::properties(), w);\r
CASPAR_LOG(info) << L"casparcg.config:\n-----------------------------------------\n" << str.str().c_str() << L"-----------------------------------------";\r
\r
channels_.clear();\r
}\r
\r
- void setup_channels(const boost::property_tree::ptree& pt)\r
+ void setup_channels(const boost::property_tree::wptree& pt)\r
{ \r
- using boost::property_tree::ptree;\r
- BOOST_FOREACH(auto& xml_channel, pt.get_child("configuration.channels"))\r
+ using boost::property_tree::wptree;\r
+ BOOST_FOREACH(auto& xml_channel, pt.get_child(L"configuration.channels"))\r
{ \r
- auto format_desc = video_format_desc::get(widen(xml_channel.second.get("video-mode", "PAL"))); \r
+ auto format_desc = video_format_desc::get(widen(xml_channel.second.get(L"video-mode", L"PAL"))); \r
if(format_desc.format == video_format::invalid)\r
BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("Invalid video-mode."));\r
\r
channels_.push_back(make_safe<video_channel>(channels_.size()+1, format_desc, ogl_));\r
\r
- BOOST_FOREACH(auto& xml_consumer, xml_channel.second.get_child("consumers"))\r
+ BOOST_FOREACH(auto& xml_consumer, xml_channel.second.get_child(L"consumers"))\r
{\r
try\r
{\r
- const std::string name = xml_consumer.first;\r
- if(name == "screen")\r
+ auto name = xml_consumer.first;\r
+ if(name == L"screen")\r
channels_.back()->output()->add(ogl::create_consumer(xml_consumer.second)); \r
- else if(name == "bluefish") \r
+ else if(name == L"bluefish") \r
channels_.back()->output()->add(bluefish::create_consumer(xml_consumer.second)); \r
- else if(name == "decklink") \r
+ else if(name == L"decklink") \r
channels_.back()->output()->add(decklink::create_consumer(xml_consumer.second)); \r
- else if(name == "file") \r
+ else if(name == L"file") \r
channels_.back()->output()->add(ffmpeg::create_consumer(xml_consumer.second)); \r
- else if(name == "system-audio")\r
+ else if(name == L"system-audio")\r
channels_.back()->output()->add(oal::create_consumer()); \r
- else if(name != "<xmlcomment>")\r
+ else if(name != L"<xmlcomment>")\r
CASPAR_LOG(warning) << "Invalid consumer: " << widen(name); \r
}\r
catch(...)\r
}\r
}\r
\r
- void setup_controllers(const boost::property_tree::ptree& pt)\r
+ void setup_controllers(const boost::property_tree::wptree& pt)\r
{ \r
- using boost::property_tree::ptree;\r
- BOOST_FOREACH(auto& xml_controller, pt.get_child("configuration.controllers"))\r
+ using boost::property_tree::wptree;\r
+ BOOST_FOREACH(auto& xml_controller, pt.get_child(L"configuration.controllers"))\r
{\r
try\r
{\r
- std::string name = xml_controller.first;\r
- std::string protocol = xml_controller.second.get<std::string>("protocol"); \r
+ auto name = xml_controller.first;\r
+ auto protocol = xml_controller.second.get<std::wstring>(L"protocol"); \r
\r
- if(name == "tcp")\r
+ if(name == L"tcp")\r
{ \r
- unsigned int port = xml_controller.second.get("port", 5250);\r
+ unsigned int port = xml_controller.second.get(L"port", 5250);\r
auto asyncbootstrapper = make_safe<IO::AsyncEventServer>(create_protocol(protocol), port);\r
asyncbootstrapper->Start();\r
async_servers_.push_back(asyncbootstrapper);\r
}\r
}\r
\r
- safe_ptr<IO::IProtocolStrategy> create_protocol(const std::string& name) const\r
+ safe_ptr<IO::IProtocolStrategy> create_protocol(const std::wstring& name) const\r
{\r
- if(name == "AMCP")\r
+ if(boost::iequals(name, L"AMCP"))\r
return make_safe<amcp::AMCPProtocolStrategy>(channels_);\r
- else if(name == "CII")\r
+ else if(boost::iequals(name, L"CII"))\r
return make_safe<cii::CIIProtocolStrategy>(channels_);\r
- else if(name == "CLOCK")\r
+ else if(boost::iequals(name, L"CLOCK"))\r
return make_safe<CLK::CLKProtocolStrategy>(channels_);\r
\r
- BOOST_THROW_EXCEPTION(caspar_exception() << arg_name_info("name") << arg_value_info(name) << msg_info("Invalid protocol"));\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << arg_name_info("name") << arg_value_info(narrow(name)) << msg_info("Invalid protocol"));\r
}\r
};\r
\r