]> git.sesse.net Git - casparcg/blobdiff - protocol/amcp/AMCPCommandsImpl.cpp
Remove most of boost::lexical_cast.
[casparcg] / protocol / amcp / AMCPCommandsImpl.cpp
index 69826476d6e7c443c2ede347314a0bd5c3c0589f..aaf771631a6459b7dfe73f8091ed838dd17e555c 100644 (file)
@@ -213,7 +213,7 @@ std::wstring MediaInfo(const boost::filesystem::path& path, const spl::shared_pt
        writeTimeStr.erase(std::remove_if(writeTimeStr.begin(), writeTimeStr.end(), is_not_digit), writeTimeStr.end());
        auto writeTimeWStr = std::wstring(writeTimeStr.begin(), writeTimeStr.end());
 
-       auto sizeStr = boost::lexical_cast<std::wstring>(boost::filesystem::file_size(path));
+       auto sizeStr = std::to_wstring(boost::filesystem::file_size(path));
        sizeStr.erase(std::remove_if(sizeStr.begin(), sizeStr.end(), is_not_digit), sizeStr.end());
        auto sizeWStr = std::wstring(sizeStr.begin(), sizeStr.end());
 
@@ -228,8 +228,8 @@ std::wstring MediaInfo(const boost::filesystem::path& path, const spl::shared_pt
                + L"\" " + media_info->clip_type +
                + L" " + sizeStr +
                + L" " + writeTimeWStr +
-               + L" " + boost::lexical_cast<std::wstring>(media_info->duration) +
-               + L" " + boost::lexical_cast<std::wstring>(media_info->time_base.numerator()) + L"/" + boost::lexical_cast<std::wstring>(media_info->time_base.denominator())
+               + L" " + std::to_wstring(media_info->duration) +
+               + L" " + std::to_wstring(media_info->time_base.numerator()) + L"/" + std::to_wstring(media_info->time_base.denominator())
                + L"\r\n";
 }
 
@@ -269,7 +269,7 @@ std::wstring ListTemplates(const spl::shared_ptr<core::cg_producer_registry>& cg
                        writeTimeStr.erase(std::remove_if(writeTimeStr.begin(), writeTimeStr.end(), [](char c){ return std::isdigit(c) == 0;}), writeTimeStr.end());
                        auto writeTimeWStr = std::wstring(writeTimeStr.begin(), writeTimeStr.end());
 
-                       auto sizeStr = boost::lexical_cast<std::string>(boost::filesystem::file_size(itr->path()));
+                       auto sizeStr = std::to_string(boost::filesystem::file_size(itr->path()));
                        sizeStr.erase(std::remove_if(sizeStr.begin(), sizeStr.end(), [](char c){ return std::isdigit(c) == 0;}), sizeStr.end());
 
                        auto sizeWStr = std::wstring(sizeStr.begin(), sizeStr.end());
@@ -597,17 +597,17 @@ std::wstring swap_command(command_context& ctx)
                boost::split(strs, ctx.parameters[0], boost::is_any_of("-"));
 
                auto ch1 = ctx.channel.channel;
-               auto ch2 = ctx.channels.at(boost::lexical_cast<int>(strs.at(0)) - 1);
+               auto ch2 = ctx.channels.at(std::stoi(strs.at(0)) - 1);
 
                int l1 = ctx.layer_index();
-               int l2 = boost::lexical_cast<int>(strs.at(1));
+               int l2 = std::stoi(strs.at(1));
 
                ch1->stage().swap_layer(l1, l2, ch2.channel->stage(), swap_transforms);
        }
        else
        {
                auto ch1 = ctx.channel.channel;
-               auto ch2 = ctx.channels.at(boost::lexical_cast<int>(ctx.parameters[0]) - 1);
+               auto ch2 = ctx.channels.at(std::stoi(ctx.parameters[0]) - 1);
                ch1->stage().swap_layers(ch2.channel->stage(), swap_transforms);
        }
 
@@ -966,7 +966,7 @@ std::wstring cg_add_command(command_context& ctx)
 {
        //CG 1 ADD 0 "template_folder/templatename" [STARTLABEL] 0/1 [DATA]
 
-       int layer = boost::lexical_cast<int>(ctx.parameters.at(0));
+       int layer = std::stoi(ctx.parameters.at(0));
        std::wstring label;             //_parameters[2]
        bool bDoStart = false;          //_parameters[2] alt. _parameters[3]
        unsigned int dataIndex = 3;
@@ -1035,7 +1035,7 @@ void cg_play_describer(core::help_sink& sink, const core::help_repository& repo)
 
 std::wstring cg_play_command(command_context& ctx)
 {
-       int layer = boost::lexical_cast<int>(ctx.parameters.at(0));
+       int layer = std::stoi(ctx.parameters.at(0));
        ctx.cg_registry->get_proxy(spl::make_shared_ptr(ctx.channel.channel), ctx.layer_index(core::cg_proxy::DEFAULT_LAYER))->play(layer);
 
        return L"202 CG OK\r\n";
@@ -1064,7 +1064,7 @@ void cg_stop_describer(core::help_sink& sink, const core::help_repository& repo)
 
 std::wstring cg_stop_command(command_context& ctx)
 {
-       int layer = boost::lexical_cast<int>(ctx.parameters.at(0));
+       int layer = std::stoi(ctx.parameters.at(0));
        get_expected_cg_proxy(ctx)->stop(layer, 0);
 
        return L"202 CG OK\r\n";
@@ -1083,7 +1083,7 @@ void cg_next_describer(core::help_sink& sink, const core::help_repository& repo)
 
 std::wstring cg_next_command(command_context& ctx)
 {
-       int layer = boost::lexical_cast<int>(ctx.parameters.at(0));
+       int layer = std::stoi(ctx.parameters.at(0));
        get_expected_cg_proxy(ctx)->next(layer);
 
        return L"202 CG OK\r\n";
@@ -1100,7 +1100,7 @@ void cg_remove_describer(core::help_sink& sink, const core::help_repository& rep
 
 std::wstring cg_remove_command(command_context& ctx)
 {
-       int layer = boost::lexical_cast<int>(ctx.parameters.at(0));
+       int layer = std::stoi(ctx.parameters.at(0));
        get_expected_cg_proxy(ctx)->remove(layer);
 
        return L"202 CG OK\r\n";
@@ -1131,7 +1131,7 @@ void cg_update_describer(core::help_sink& sink, const core::help_repository& rep
 
 std::wstring cg_update_command(command_context& ctx)
 {
-       int layer = boost::lexical_cast<int>(ctx.parameters.at(0));
+       int layer = std::stoi(ctx.parameters.at(0));
 
        std::wstring dataString = ctx.parameters.at(1);
        if (dataString.at(0) != L'<' && dataString.at(0) != L'{')
@@ -1161,7 +1161,7 @@ std::wstring cg_invoke_command(command_context& ctx)
 {
        std::wstringstream replyString;
        replyString << L"201 CG OK\r\n";
-       int layer = boost::lexical_cast<int>(ctx.parameters.at(0));
+       int layer = std::stoi(ctx.parameters.at(0));
        auto result = get_expected_cg_proxy(ctx)->invoke(layer, ctx.parameters.at(1));
        replyString << result << L"\r\n";
 
@@ -1188,7 +1188,7 @@ std::wstring cg_info_command(command_context& ctx)
        }
        else
        {
-               int layer = boost::lexical_cast<int>(ctx.parameters.at(0));
+               int layer = std::stoi(ctx.parameters.at(0));
                auto desc = get_expected_cg_proxy(ctx)->description(layer);
 
                replyString << desc << L"\r\n";
@@ -1278,7 +1278,7 @@ std::wstring mixer_keyer_command(command_context& ctx)
                return reply_value(ctx, [](const frame_transform& t) { return t.image_transform.is_key ? 1 : 0; });
 
        transforms_applier transforms(ctx);
-       bool value = boost::lexical_cast<int>(ctx.parameters.at(0));
+       bool value = std::stoi(ctx.parameters.at(0));
        transforms.add(stage::transform_tuple_t(ctx.layer_index(), [=](frame_transform transform) -> frame_transform
        {
                transform.image_transform.is_key = value;
@@ -1330,13 +1330,13 @@ std::wstring mixer_chroma_command(command_context& ctx)
                auto chroma = get_current_transform(ctx).image_transform.chroma;
                return L"201 MIXER OK\r\n"
                        + std::wstring(chroma.enable ? L"1 " : L"0 ")
-                       + boost::lexical_cast<std::wstring>(chroma.target_hue) + L" "
-                       + boost::lexical_cast<std::wstring>(chroma.hue_width) + L" "
-                       + boost::lexical_cast<std::wstring>(chroma.min_saturation) + L" "
-                       + boost::lexical_cast<std::wstring>(chroma.min_brightness) + L" "
-                       + boost::lexical_cast<std::wstring>(chroma.softness) + L" "
-                       + boost::lexical_cast<std::wstring>(chroma.spill_suppress) + L" "
-                       + boost::lexical_cast<std::wstring>(chroma.spill_suppress_saturation) + L" "
+                       + std::to_wstring(chroma.target_hue) + L" "
+                       + std::to_wstring(chroma.hue_width) + L" "
+                       + std::to_wstring(chroma.min_saturation) + L" "
+                       + std::to_wstring(chroma.min_brightness) + L" "
+                       + std::to_wstring(chroma.softness) + L" "
+                       + std::to_wstring(chroma.spill_suppress) + L" "
+                       + std::to_wstring(chroma.spill_suppress_saturation) + L" "
                        + std::wstring(chroma.show_mask ? L"1" : L"0") + L"\r\n";
        }
 
@@ -1351,7 +1351,7 @@ std::wstring mixer_chroma_command(command_context& ctx)
        if (legacy_mode)
        {
 
-               duration = ctx.parameters.size() > 4 ? boost::lexical_cast<int>(ctx.parameters.at(4)) : 0;
+               duration = ctx.parameters.size() > 4 ? std::stoi(ctx.parameters.at(4)) : 0;
                tween = ctx.parameters.size() > 5 ? ctx.parameters.at(5) : L"linear";
 
                if (*legacy_mode == chroma::legacy_type::none)
@@ -1361,11 +1361,11 @@ std::wstring mixer_chroma_command(command_context& ctx)
                else
                {
                        chroma.enable                                           = true;
-                       chroma.hue_width                                        = 0.5 - boost::lexical_cast<double>(ctx.parameters.at(1)) * 0.5;
-                       chroma.min_brightness                           = boost::lexical_cast<double>(ctx.parameters.at(1));
-                       chroma.min_saturation                           = boost::lexical_cast<double>(ctx.parameters.at(1));
-                       chroma.softness                                         = boost::lexical_cast<double>(ctx.parameters.at(2)) - boost::lexical_cast<double>(ctx.parameters.at(1));
-                       chroma.spill_suppress                           = 180.0 - boost::lexical_cast<double>(ctx.parameters.at(3)) * 180.0;
+                       chroma.hue_width                                        = 0.5 - std::stod(ctx.parameters.at(1)) * 0.5;
+                       chroma.min_brightness                           = std::stod(ctx.parameters.at(1));
+                       chroma.min_saturation                           = std::stod(ctx.parameters.at(1));
+                       chroma.softness                                         = std::stod(ctx.parameters.at(2)) - std::stod(ctx.parameters.at(1));
+                       chroma.spill_suppress                           = 180.0 - std::stod(ctx.parameters.at(3)) * 180.0;
                        chroma.spill_suppress_saturation        = 1;
 
                        if (*legacy_mode == chroma::legacy_type::green)
@@ -1376,21 +1376,21 @@ std::wstring mixer_chroma_command(command_context& ctx)
        }
        else
        {
-               duration = ctx.parameters.size() > 9 ? boost::lexical_cast<int>(ctx.parameters.at(9)) : 0;
+               duration = ctx.parameters.size() > 9 ? std::stoi(ctx.parameters.at(9)) : 0;
                tween = ctx.parameters.size() > 10 ? ctx.parameters.at(10) : L"linear";
 
                chroma.enable = ctx.parameters.at(0) == L"1";
 
                if (chroma.enable)
                {
-                       chroma.target_hue                                       = boost::lexical_cast<double>(ctx.parameters.at(1));
-                       chroma.hue_width                                        = boost::lexical_cast<double>(ctx.parameters.at(2));
-                       chroma.min_saturation                           = boost::lexical_cast<double>(ctx.parameters.at(3));
-                       chroma.min_brightness                           = boost::lexical_cast<double>(ctx.parameters.at(4));
-                       chroma.softness                                         = boost::lexical_cast<double>(ctx.parameters.at(5));
-                       chroma.spill_suppress                           = boost::lexical_cast<double>(ctx.parameters.at(6));
-                       chroma.spill_suppress_saturation        = boost::lexical_cast<double>(ctx.parameters.at(7));
-                       chroma.show_mask                                        = boost::lexical_cast<double>(ctx.parameters.at(8));
+                       chroma.target_hue                                       = std::stod(ctx.parameters.at(1));
+                       chroma.hue_width                                        = std::stod(ctx.parameters.at(2));
+                       chroma.min_saturation                           = std::stod(ctx.parameters.at(3));
+                       chroma.min_brightness                           = std::stod(ctx.parameters.at(4));
+                       chroma.softness                                         = std::stod(ctx.parameters.at(5));
+                       chroma.spill_suppress                           = std::stod(ctx.parameters.at(6));
+                       chroma.spill_suppress_saturation        = std::stod(ctx.parameters.at(7));
+                       chroma.show_mask                                        = std::stod(ctx.parameters.at(8));
                }
        }
 
@@ -1450,8 +1450,8 @@ std::wstring single_double_animatable_mixer_command(command_context& ctx, const
                return reply_value(ctx, getter);
 
        transforms_applier transforms(ctx);
-       double value = boost::lexical_cast<double>(ctx.parameters.at(0));
-       int duration = ctx.parameters.size() > 1 ? boost::lexical_cast<int>(ctx.parameters[1]) : 0;
+       double value = std::stod(ctx.parameters.at(0));
+       int duration = ctx.parameters.size() > 1 ? std::stoi(ctx.parameters[1]) : 0;
        std::wstring tween = ctx.parameters.size() > 2 ? ctx.parameters[2] : L"linear";
 
        transforms.add(stage::transform_tuple_t(ctx.layer_index(), [=](frame_transform transform) -> frame_transform
@@ -1578,21 +1578,21 @@ std::wstring mixer_levels_command(command_context& ctx)
        {
                auto levels = get_current_transform(ctx).image_transform.levels;
                return L"201 MIXER OK\r\n"
-                       + boost::lexical_cast<std::wstring>(levels.min_input) + L" "
-                       + boost::lexical_cast<std::wstring>(levels.max_input) + L" "
-                       + boost::lexical_cast<std::wstring>(levels.gamma) + L" "
-                       + boost::lexical_cast<std::wstring>(levels.min_output) + L" "
-                       + boost::lexical_cast<std::wstring>(levels.max_output) + L"\r\n";
+                       + std::to_wstring(levels.min_input) + L" "
+                       + std::to_wstring(levels.max_input) + L" "
+                       + std::to_wstring(levels.gamma) + L" "
+                       + std::to_wstring(levels.min_output) + L" "
+                       + std::to_wstring(levels.max_output) + L"\r\n";
        }
 
        transforms_applier transforms(ctx);
        levels value;
-       value.min_input = boost::lexical_cast<double>(ctx.parameters.at(0));
-       value.max_input = boost::lexical_cast<double>(ctx.parameters.at(1));
-       value.gamma = boost::lexical_cast<double>(ctx.parameters.at(2));
-       value.min_output = boost::lexical_cast<double>(ctx.parameters.at(3));
-       value.max_output = boost::lexical_cast<double>(ctx.parameters.at(4));
-       int duration = ctx.parameters.size() > 5 ? boost::lexical_cast<int>(ctx.parameters[5]) : 0;
+       value.min_input = std::stod(ctx.parameters.at(0));
+       value.max_input = std::stod(ctx.parameters.at(1));
+       value.gamma = std::stod(ctx.parameters.at(2));
+       value.min_output = std::stod(ctx.parameters.at(3));
+       value.max_output = std::stod(ctx.parameters.at(4));
+       int duration = ctx.parameters.size() > 5 ? std::stoi(ctx.parameters[5]) : 0;
        std::wstring tween = ctx.parameters.size() > 6 ? ctx.parameters[6] : L"linear";
 
        transforms.add(stage::transform_tuple_t(ctx.layer_index(), [=](frame_transform transform) -> frame_transform
@@ -1644,19 +1644,19 @@ std::wstring mixer_fill_command(command_context& ctx)
                auto translation = transform.fill_translation;
                auto scale = transform.fill_scale;
                return L"201 MIXER OK\r\n"
-                       + boost::lexical_cast<std::wstring>(translation[0]) + L" "
-                       + boost::lexical_cast<std::wstring>(translation[1]) + L" "
-                       + boost::lexical_cast<std::wstring>(scale[0]) + L" "
-                       + boost::lexical_cast<std::wstring>(scale[1]) + L"\r\n";
+                       + std::to_wstring(translation[0]) + L" "
+                       + std::to_wstring(translation[1]) + L" "
+                       + std::to_wstring(scale[0]) + L" "
+                       + std::to_wstring(scale[1]) + L"\r\n";
        }
 
        transforms_applier transforms(ctx);
-       int duration = ctx.parameters.size() > 4 ? boost::lexical_cast<int>(ctx.parameters[4]) : 0;
+       int duration = ctx.parameters.size() > 4 ? std::stoi(ctx.parameters[4]) : 0;
        std::wstring tween = ctx.parameters.size() > 5 ? ctx.parameters[5] : L"linear";
-       double x = boost::lexical_cast<double>(ctx.parameters.at(0));
-       double y = boost::lexical_cast<double>(ctx.parameters.at(1));
-       double x_s = boost::lexical_cast<double>(ctx.parameters.at(2));
-       double y_s = boost::lexical_cast<double>(ctx.parameters.at(3));
+       double x = std::stod(ctx.parameters.at(0));
+       double y = std::stod(ctx.parameters.at(1));
+       double x_s = std::stod(ctx.parameters.at(2));
+       double y_s = std::stod(ctx.parameters.at(3));
 
        transforms.add(stage::transform_tuple_t(ctx.layer_index(), [=](frame_transform transform) mutable -> frame_transform
        {
@@ -1701,19 +1701,19 @@ std::wstring mixer_clip_command(command_context& ctx)
                auto scale = transform.clip_scale;
 
                return L"201 MIXER OK\r\n"
-                       + boost::lexical_cast<std::wstring>(translation[0]) + L" "
-                       + boost::lexical_cast<std::wstring>(translation[1]) + L" "
-                       + boost::lexical_cast<std::wstring>(scale[0]) + L" "
-                       + boost::lexical_cast<std::wstring>(scale[1]) + L"\r\n";
+                       + std::to_wstring(translation[0]) + L" "
+                       + std::to_wstring(translation[1]) + L" "
+                       + std::to_wstring(scale[0]) + L" "
+                       + std::to_wstring(scale[1]) + L"\r\n";
        }
 
        transforms_applier transforms(ctx);
-       int duration = ctx.parameters.size() > 4 ? boost::lexical_cast<int>(ctx.parameters[4]) : 0;
+       int duration = ctx.parameters.size() > 4 ? std::stoi(ctx.parameters[4]) : 0;
        std::wstring tween = ctx.parameters.size() > 5 ? ctx.parameters[5] : L"linear";
-       double x = boost::lexical_cast<double>(ctx.parameters.at(0));
-       double y = boost::lexical_cast<double>(ctx.parameters.at(1));
-       double x_s = boost::lexical_cast<double>(ctx.parameters.at(2));
-       double y_s = boost::lexical_cast<double>(ctx.parameters.at(3));
+       double x = std::stod(ctx.parameters.at(0));
+       double y = std::stod(ctx.parameters.at(1));
+       double x_s = std::stod(ctx.parameters.at(2));
+       double y_s = std::stod(ctx.parameters.at(3));
 
        transforms.add(stage::transform_tuple_t(ctx.layer_index(), [=](frame_transform transform) -> frame_transform
        {
@@ -1754,15 +1754,15 @@ std::wstring mixer_anchor_command(command_context& ctx)
                auto transform = get_current_transform(ctx).image_transform;
                auto anchor = transform.anchor;
                return L"201 MIXER OK\r\n"
-                       + boost::lexical_cast<std::wstring>(anchor[0]) + L" "
-                       + boost::lexical_cast<std::wstring>(anchor[1]) + L"\r\n";
+                       + std::to_wstring(anchor[0]) + L" "
+                       + std::to_wstring(anchor[1]) + L"\r\n";
        }
 
        transforms_applier transforms(ctx);
-       int duration = ctx.parameters.size() > 2 ? boost::lexical_cast<int>(ctx.parameters[2]) : 0;
+       int duration = ctx.parameters.size() > 2 ? std::stoi(ctx.parameters[2]) : 0;
        std::wstring tween = ctx.parameters.size() > 3 ? ctx.parameters[3] : L"linear";
-       double x = boost::lexical_cast<double>(ctx.parameters.at(0));
-       double y = boost::lexical_cast<double>(ctx.parameters.at(1));
+       double x = std::stod(ctx.parameters.at(0));
+       double y = std::stod(ctx.parameters.at(1));
 
        transforms.add(stage::transform_tuple_t(ctx.layer_index(), [=](frame_transform transform) mutable -> frame_transform
        {
@@ -1802,19 +1802,19 @@ std::wstring mixer_crop_command(command_context& ctx)
        {
                auto crop = get_current_transform(ctx).image_transform.crop;
                return L"201 MIXER OK\r\n"
-                       + boost::lexical_cast<std::wstring>(crop.ul[0]) + L" "
-                       + boost::lexical_cast<std::wstring>(crop.ul[1]) + L" "
-                       + boost::lexical_cast<std::wstring>(crop.lr[0]) + L" "
-                       + boost::lexical_cast<std::wstring>(crop.lr[1]) + L"\r\n";
+                       + std::to_wstring(crop.ul[0]) + L" "
+                       + std::to_wstring(crop.ul[1]) + L" "
+                       + std::to_wstring(crop.lr[0]) + L" "
+                       + std::to_wstring(crop.lr[1]) + L"\r\n";
        }
 
        transforms_applier transforms(ctx);
-       int duration = ctx.parameters.size() > 4 ? boost::lexical_cast<int>(ctx.parameters[4]) : 0;
+       int duration = ctx.parameters.size() > 4 ? std::stoi(ctx.parameters[4]) : 0;
        std::wstring tween = ctx.parameters.size() > 5 ? ctx.parameters[5] : L"linear";
-       double ul_x = boost::lexical_cast<double>(ctx.parameters.at(0));
-       double ul_y = boost::lexical_cast<double>(ctx.parameters.at(1));
-       double lr_x = boost::lexical_cast<double>(ctx.parameters.at(2));
-       double lr_y = boost::lexical_cast<double>(ctx.parameters.at(3));
+       double ul_x = std::stod(ctx.parameters.at(0));
+       double ul_y = std::stod(ctx.parameters.at(1));
+       double lr_x = std::stod(ctx.parameters.at(2));
+       double lr_y = std::stod(ctx.parameters.at(3));
 
        transforms.add(stage::transform_tuple_t(ctx.layer_index(), [=](frame_transform transform) -> frame_transform
        {
@@ -1880,27 +1880,27 @@ std::wstring mixer_perspective_command(command_context& ctx)
                auto perspective = get_current_transform(ctx).image_transform.perspective;
                return
                        L"201 MIXER OK\r\n"
-                       + boost::lexical_cast<std::wstring>(perspective.ul[0]) + L" "
-                       + boost::lexical_cast<std::wstring>(perspective.ul[1]) + L" "
-                       + boost::lexical_cast<std::wstring>(perspective.ur[0]) + L" "
-                       + boost::lexical_cast<std::wstring>(perspective.ur[1]) + L" "
-                       + boost::lexical_cast<std::wstring>(perspective.lr[0]) + L" "
-                       + boost::lexical_cast<std::wstring>(perspective.lr[1]) + L" "
-                       + boost::lexical_cast<std::wstring>(perspective.ll[0]) + L" "
-                       + boost::lexical_cast<std::wstring>(perspective.ll[1]) + L"\r\n";
+                       + std::to_wstring(perspective.ul[0]) + L" "
+                       + std::to_wstring(perspective.ul[1]) + L" "
+                       + std::to_wstring(perspective.ur[0]) + L" "
+                       + std::to_wstring(perspective.ur[1]) + L" "
+                       + std::to_wstring(perspective.lr[0]) + L" "
+                       + std::to_wstring(perspective.lr[1]) + L" "
+                       + std::to_wstring(perspective.ll[0]) + L" "
+                       + std::to_wstring(perspective.ll[1]) + L"\r\n";
        }
 
        transforms_applier transforms(ctx);
-       int duration = ctx.parameters.size() > 8 ? boost::lexical_cast<int>(ctx.parameters[8]) : 0;
+       int duration = ctx.parameters.size() > 8 ? std::stoi(ctx.parameters[8]) : 0;
        std::wstring tween = ctx.parameters.size() > 9 ? ctx.parameters[9] : L"linear";
-       double ul_x = boost::lexical_cast<double>(ctx.parameters.at(0));
-       double ul_y = boost::lexical_cast<double>(ctx.parameters.at(1));
-       double ur_x = boost::lexical_cast<double>(ctx.parameters.at(2));
-       double ur_y = boost::lexical_cast<double>(ctx.parameters.at(3));
-       double lr_x = boost::lexical_cast<double>(ctx.parameters.at(4));
-       double lr_y = boost::lexical_cast<double>(ctx.parameters.at(5));
-       double ll_x = boost::lexical_cast<double>(ctx.parameters.at(6));
-       double ll_y = boost::lexical_cast<double>(ctx.parameters.at(7));
+       double ul_x = std::stod(ctx.parameters.at(0));
+       double ul_y = std::stod(ctx.parameters.at(1));
+       double ur_x = std::stod(ctx.parameters.at(2));
+       double ur_y = std::stod(ctx.parameters.at(3));
+       double lr_x = std::stod(ctx.parameters.at(4));
+       double lr_y = std::stod(ctx.parameters.at(5));
+       double ll_x = std::stod(ctx.parameters.at(6));
+       double ll_y = std::stod(ctx.parameters.at(7));
 
        transforms.add(stage::transform_tuple_t(ctx.layer_index(), [=](frame_transform transform) -> frame_transform
        {
@@ -1941,7 +1941,7 @@ std::wstring mixer_mipmap_command(command_context& ctx)
                return reply_value(ctx, [](const frame_transform& t) { return t.image_transform.use_mipmap ? 1 : 0; });
 
        transforms_applier transforms(ctx);
-       bool value = boost::lexical_cast<int>(ctx.parameters.at(0));
+       bool value = std::stoi(ctx.parameters.at(0));
        transforms.add(stage::transform_tuple_t(ctx.layer_index(), [=](frame_transform transform) -> frame_transform
        {
                transform.image_transform.use_mipmap = value;
@@ -1991,10 +1991,10 @@ std::wstring mixer_mastervolume_command(command_context& ctx)
        if (ctx.parameters.empty())
        {
                auto volume = ctx.channel.channel->mixer().get_master_volume();
-               return L"201 MIXER OK\r\n" + boost::lexical_cast<std::wstring>(volume)+L"\r\n";
+               return L"201 MIXER OK\r\n" + std::to_wstring(volume)+L"\r\n";
        }
 
-       float master_volume = boost::lexical_cast<float>(ctx.parameters.at(0));
+       float master_volume = std::stof(ctx.parameters.at(0));
        ctx.channel.channel->mixer().set_master_volume(master_volume);
 
        return L"202 MIXER OK\r\n";
@@ -2020,7 +2020,7 @@ std::wstring mixer_straight_alpha_command(command_context& ctx)
        if (ctx.parameters.empty())
        {
                bool state = ctx.channel.channel->mixer().get_straight_alpha_output();
-               return L"201 MIXER OK\r\n" + boost::lexical_cast<std::wstring>(state) + L"\r\n";
+               return L"201 MIXER OK\r\n" + std::to_wstring(state) + L"\r\n";
        }
 
        bool state = boost::lexical_cast<bool>(ctx.parameters.at(0));
@@ -2043,9 +2043,9 @@ void mixer_grid_describer(core::help_sink& sink, const core::help_repository& re
 std::wstring mixer_grid_command(command_context& ctx)
 {
        transforms_applier transforms(ctx);
-       int duration = ctx.parameters.size() > 1 ? boost::lexical_cast<int>(ctx.parameters[1]) : 0;
+       int duration = ctx.parameters.size() > 1 ? std::stoi(ctx.parameters[1]) : 0;
        std::wstring tween = ctx.parameters.size() > 2 ? ctx.parameters[2] : L"linear";
-       int n = boost::lexical_cast<int>(ctx.parameters.at(0));
+       int n = std::stoi(ctx.parameters.at(0));
        double delta = 1.0 / static_cast<double>(n);
        for (int x = 0; x < n; ++x)
        {
@@ -2145,7 +2145,7 @@ std::wstring channel_grid_command(command_context& ctx)
                if (channel.channel != self.channel)
                {
                        core::diagnostics::call_context::for_thread().layer = index;
-                       auto producer = ctx.producer_registry->create_producer(get_producer_dependencies(self.channel, ctx), L"route://" + boost::lexical_cast<std::wstring>(channel.channel->index()) + L" NO_AUTO_DEINTERLACE");
+                       auto producer = ctx.producer_registry->create_producer(get_producer_dependencies(self.channel, ctx), L"route://" + std::to_wstring(channel.channel->index()) + L" NO_AUTO_DEINTERLACE");
                        self.channel->stage().load(index, producer, false);
                        self.channel->stage().play(index);
                        index++;
@@ -2158,7 +2158,7 @@ std::wstring channel_grid_command(command_context& ctx)
        ctx.channel_index = self.channel->index();
        ctx.channel = self;
        ctx.parameters.clear();
-       ctx.parameters.push_back(boost::lexical_cast<std::wstring>(square_side_length));
+       ctx.parameters.push_back(std::to_wstring(square_side_length));
        mixer_grid_command(ctx);
 
        return L"202 CHANNEL_GRID OK\r\n";
@@ -2954,7 +2954,7 @@ void lock_describer(core::help_sink& sink, const core::help_repository& repo)
 
 std::wstring lock_command(command_context& ctx)
 {
-       int channel_index = boost::lexical_cast<int>(ctx.parameters.at(0)) - 1;
+       int channel_index = std::stoi(ctx.parameters.at(0)) - 1;
        auto lock = ctx.channels.at(channel_index).lock;
        auto command = boost::to_upper_copy(ctx.parameters.at(1));