#include <core/frame/frame_transform.h>
#include <boost/algorithm/cxx11/all_of.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/range/adaptor/transformed.hpp>
#include <cmath>
shader_->set("plane[2]", texture_id::plane2);
shader_->set("plane[3]", texture_id::plane3);
for (int n = 0; n < params.textures.size(); ++n)
- shader_->set("plane_size[" + boost::lexical_cast<std::string>(n) + "]",
+ shader_->set("plane_size[" + std::to_string(n) + "]",
static_cast<float>(params.textures[n]->width()),
static_cast<float>(params.textures[n]->height()));
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/split.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/range/algorithm/count.hpp>
#include <boost/iostreams/filter/grep.hpp>
#include <boost/iostreams/filter/line.hpp>
void do_filter(const std::vector<wchar_t>& src, std::vector<wchar_t>& dest) override
{
auto line_count = boost::range::count(src, L'\n') + 4;
- auto out = boost::lexical_cast<std::wstring>(line_count);
+ auto out = std::to_wstring(line_count);
dest.insert(dest.begin(), out.begin(), out.end());
dest.push_back('\n');
}
#include "win32_exception.h"
-#include <boost/lexical_cast.hpp>
-
#include "../../thread_info.h"
#include "windows.h"
auto bad_address = reinterpret_cast<const void*>(info.ExceptionInformation[1]);
auto location = info.ExceptionAddress;
- return "Access violation at " + boost::lexical_cast<std::string>(location) + " trying to " + (is_write ? "write " : "read ") + boost::lexical_cast<std::string>(bad_address);
+ return "Access violation at " + std::to_string(location) + " trying to " + (is_write ? "write " : "read ") + std::to_string(bad_address);
}
case EXCEPTION_FLT_DIVIDE_BY_ZERO:
case EXCEPTION_INT_DIVIDE_BY_ZERO:
#include <boost/property_tree/ptree.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/range/adaptor/transformed.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <map>
if (!ctx) // Lazy
ctx.reset(new scoped_context);
- ctx->replace_msg("/" + u8(pair.first) + "[" + boost::lexical_cast<std::string>(++by_name[pair.first]) + "]");
+ ctx->replace_msg("/" + u8(pair.first) + "[" + std::to_string(++by_name[pair.first]) + "]");
return pair;
}
};
{
try
{
- numbers_[i] = boost::lexical_cast<int>(tokens[i]);
+ numbers_[i] = std::stoi(tokens[i]);
}
- catch (const boost::bad_lexical_cast&)
+ catch (const std::invalid_argument&)
{
return;
}
#include "linq.h"
#include <boost/regex.hpp>
-#include <boost/lexical_cast.hpp>
#include <unordered_map>
#include <string>
{
name = what["NAME"].str();
if(what["V0"].matched)
- params.push_back(boost::lexical_cast<double>(what["V0"].str()));
+ params.push_back(std::stod(what["V0"].str()));
if(what["V1"].matched)
- params.push_back(boost::lexical_cast<double>(what["V1"].str()));
+ params.push_back(std::stod(what["V1"].str()));
}
auto it = get_tweens().find(name);
#include <common/timer.h>
#include <boost/circular_buffer.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/property_tree/ptree.hpp>
#include <functional>
prec_timer sync_timer_;
boost::circular_buffer<const_frame> frames_;
std::map<int, int64_t> send_to_consumers_delays_;
- executor executor_ { L"output " + boost::lexical_cast<std::wstring>(channel_index_) };
+ executor executor_ { L"output " + std::to_wstring(channel_index_) };
public:
impl(spl::shared_ptr<diagnostics::graph> graph, const video_format_desc& format_desc, const audio_channel_layout& channel_layout, int channel_index)
: graph_(std::move(graph))
std::wstring print() const
{
- return L"output[" + boost::lexical_cast<std::wstring>(channel_index_) + L"]";
+ return L"output[" + std::to_wstring(channel_index_) + L"]";
}
std::future<boost::property_tree::wptree> info()
#include "frame_consumer.h"
#include "../frame/frame.h"
-#include <boost/lexical_cast.hpp>
#include <future>
struct port::impl
{
int index_;
- spl::shared_ptr<monitor::subject> monitor_subject_ = spl::make_shared<monitor::subject>("/port/" + boost::lexical_cast<std::string>(index_));
+ spl::shared_ptr<monitor::subject> monitor_subject_ = spl::make_shared<monitor::subject>("/port/" + std::to_string(index_));
spl::shared_ptr<frame_consumer> consumer_;
int channel_index_;
public:
#include <common/semaphore.h>
-#include <boost/lexical_cast.hpp>
#include <boost/property_tree/ptree.hpp>
#include <future>
std::wstring print() const override
{
if (self_channel_index_ != -1)
- return L"sync[" + boost::lexical_cast<std::wstring>(self_channel_index_) + L"]to[" + boost::lexical_cast<std::wstring>(other_channel_->index()) + L"]";
+ return L"sync[" + std::to_wstring(self_channel_index_) + L"]to[" + std::to_wstring(other_channel_->index()) + L"]";
else
- return L"syncto[" + boost::lexical_cast<std::wstring>(other_channel_->index()) + L"]";
+ return L"syncto[" + std::to_wstring(other_channel_->index()) + L"]";
}
std::wstring name() const override
if (params.size() < 1 || !boost::iequals(params.at(0), L"SYNCTO"))
return core::frame_consumer::empty();
- auto channel_id = boost::lexical_cast<int>(params.at(1));
+ auto channel_id = std::stoi(params.at(1));
auto channel = channels.at(channel_id - 1);
return spl::make_shared<syncto_consumer>(channel);
#include "call_context.h"
-#include <boost/lexical_cast.hpp>
-
namespace caspar { namespace core { namespace diagnostics {
call_context& call_context::for_thread()
if (video_channel == -1)
return L"[]";
else if (layer == -1)
- return L"[ch=" + boost::lexical_cast<std::wstring>(video_channel) + L"]";
+ return L"[ch=" + std::to_wstring(video_channel) + L"]";
else
- return L"[ch=" + boost::lexical_cast<std::wstring>(video_channel) + L"; layer=" + boost::lexical_cast<std::wstring>(layer) + L"]";
+ return L"[ch=" + std::to_wstring(video_channel) + L"; layer=" + std::to_wstring(layer) + L"]";
}
}}}
#include <boost/optional.hpp>
#include <boost/circular_buffer.hpp>
-#include <boost/lexical_cast.hpp>
#include <tbb/concurrent_unordered_map.h>
#include <tbb/atomic.h>
if (context_.video_channel != -1)
{
- auto ctx_str = boost::lexical_cast<std::string>(context_.video_channel);
+ auto ctx_str = std::to_string(context_.video_channel);
if (context_.layer != -1)
- ctx_str += "-" + boost::lexical_cast<std::string>(context_.layer);
+ ctx_str += "-" + std::to_string(context_.layer);
sf::Text context_text(ctx_str, get_default_font(), text_size);
context_text.setStyle(sf::Text::Italic);
#include <common/diagnostics/graph.h>
#include <common/timer.h>
-#include <boost/lexical_cast.hpp>
-
#include <atomic>
#include <mutex>
#include <unordered_map>
class subject_graph : public caspar::diagnostics::spi::graph_sink
{
- spl::shared_ptr<monitor::subject> subject_ = spl::make_shared<monitor::subject>("/" + boost::lexical_cast<std::string>(create_id()));
+ spl::shared_ptr<monitor::subject> subject_ = spl::make_shared<monitor::subject>("/" + std::to_string(create_id()));
call_context context_ = call_context::for_thread();
std::mutex mutex_;
std::wstring text_;
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/join.hpp>
#include <boost/range/algorithm/equal.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/property_tree/ptree.hpp>
#include <map>
if (channel_order.size() > num_channels)
CASPAR_THROW_EXCEPTION(invalid_argument() << msg_info(
- channel_order_ + L" contains more than " + boost::lexical_cast<std::wstring>(num_channels)));
+ channel_order_ + L" contains more than " + std::to_wstring(num_channels)));
}
std::vector<int> audio_channel_layout::indexes_of(const std::wstring& channel_name) const
{
auto channels = boost::join(channel_order, L" ");
- return L"[audio_channel_layout] num_channels=" + boost::lexical_cast<std::wstring>(num_channels) + L" type=" + type + L" channel_order=" + channels;
+ return L"[audio_channel_layout] num_channels=" + std::to_wstring(num_channels) + L" type=" + type + L" channel_order=" + channels;
}
const audio_channel_layout& audio_channel_layout::invalid()
#include <cstdint>
#include <vector>
-#include <boost/lexical_cast.hpp>
-
namespace caspar { namespace core {
struct mutable_frame::impl : boost::noncopyable
#include <boost/range/adaptors.hpp>
#include <boost/range/distance.hpp>
-#include <boost/lexical_cast.hpp>
#include <map>
#include <stack>
const auto pFS = max[i] / static_cast<float>(std::numeric_limits<int32_t>::max());
const auto dBFS = 20.0f * std::log10(std::max(MIN_PFS, pFS));
- auto chan_str = boost::lexical_cast<std::string>(i + 1);
+ auto chan_str = std::to_string(i + 1);
monitor_subject_ << monitor::message("/" + chan_str + "/pFS") % pFS;
monitor_subject_ << monitor::message("/" + chan_str + "/dBFS") % dBFS;
#include <core/video_format.h>
#include <boost/property_tree/ptree.hpp>
-#include <boost/lexical_cast.hpp>
#include <tbb/concurrent_queue.h>
#include <tbb/spin_mutex.h>
bool straighten_alpha_ = false;
- executor executor_ { L"mixer " + boost::lexical_cast<std::wstring>(channel_index_) };
+ executor executor_ { L"mixer " + std::to_wstring(channel_index_) };
public:
impl(int channel_index, spl::shared_ptr<diagnostics::graph> graph, spl::shared_ptr<image_mixer> image_mixer)
if (boost::iequals(params.at(1), L"speed"))
{
auto destination_user_speed = boost::rational<std::int64_t>(
- static_cast<std::int64_t>(boost::lexical_cast<double>(params.at(2)) * 1000000.0),
+ static_cast<std::int64_t>(std::stod(params.at(2)) * 1000000.0),
1000000);
- auto frames = params.size() > 3 ? boost::lexical_cast<int>(params.at(3)) : 0;
+ auto frames = params.size() > 3 ? std::stoi(params.at(3)) : 0;
auto easing = params.size() > 4 ? params.at(4) : L"linear";
user_speed_ = speed_tweener(user_speed_.fetch(), destination_user_speed, frames, tweener(easing));
public:
impl(int index)
: monitor_subject_(spl::make_shared<monitor::subject>(
- "/layer/" + boost::lexical_cast<std::string>(index)))
+ "/layer/" + std::to_string(index)))
// , foreground_event_subject_("")
// , background_event_subject_("background")
{
boost::property_tree::wptree info() const
{
boost::property_tree::wptree info;
- info.add(L"auto_delta", (auto_play_delta_ ? boost::lexical_cast<std::wstring>(*auto_play_delta_) : L"null"));
+ info.add(L"auto_delta", (auto_play_delta_ ? std::to_wstring(*auto_play_delta_) : L"null"));
info.add(L"frame-number", foreground_->frame_number());
auto nb_frames = foreground_->nb_frames();
{
int index = static_cast<int>(cursor - str.begin());
- return L" at index " + boost::lexical_cast<std::wstring>(index)
+ return L" at index " + std::to_wstring(index)
+ L" in " + str;
}
++cursor;
}
- return boost::lexical_cast<double>(constant);
+ return std::stod(constant);
}
std::wstring parse_string_literal(
frame_number_ = frame_variable->value();
auto fps = format_desc_.fps * format_desc_.field_count;
- auto fps_variable = std::make_shared<core::variable_impl<double>>(boost::lexical_cast<std::wstring>(fps), false, fps);
+ auto fps_variable = std::make_shared<core::variable_impl<double>>(std::to_wstring(fps), false, fps);
store_variable(L"fps", fps_variable);
auto timeline_frame_variable = std::make_shared<core::variable_impl<int64_t>>(L"-1", false, -1);
m_x_ = 0;
m_y_ = 0;
- auto scene_width = std::make_shared<core::variable_impl<double>>(boost::lexical_cast<std::wstring>(width), false, width);
- auto scene_height = std::make_shared<core::variable_impl<double>>(boost::lexical_cast<std::wstring>(height), false, height);
+ auto scene_width = std::make_shared<core::variable_impl<double>>(std::to_wstring(width), false, width);
+ auto scene_height = std::make_shared<core::variable_impl<double>>(std::to_wstring(height), false, height);
store_variable(L"scene_width", scene_width);
store_variable(L"scene_height", scene_height);
pixel_constraints_.width = scene_width->value();
auto easing = k.second.get(L"<xmlattr>.easing", L"");
auto at = ptree_get<int64_t>(k.second, L"<xmlattr>.at");
- auto keyframe_variable_name = L"timeline." + variable_name + L"." + boost::lexical_cast<std::wstring>(at);
+ auto keyframe_variable_name = L"timeline." + variable_name + L"." + std::to_wstring(at);
if (variable.is<double>())
scene->add_keyframe(variable.as<double>(), scene->create_variable<double>(keyframe_variable_name, false, ptree_get_value<std::wstring>(k.second)), at, easing);
if (at_frame)
condition = scene->timeline_frame() == *at_frame;
else if (when)
- condition = scene->create_variable<bool>(L"tasks.task_" + boost::lexical_cast<std::wstring>(task_id), false, *when);
+ condition = scene->create_variable<bool>(L"tasks.task_" + std::to_wstring(task_id), false, *when);
else
CASPAR_THROW_EXCEPTION(user_error() << msg_info(L"Task elements must have either an at attribute or a when attribute"));
interaction_aggregator aggregator_;
// map of layer -> map of tokens (src ref) -> layer_consumer
std::map<int, std::map<void*, spl::shared_ptr<write_frame_consumer>>> layer_consumers_;
- executor executor_ { L"stage " + boost::lexical_cast<std::wstring>(channel_index_) };
+ executor executor_ { L"stage " + std::to_wstring(channel_index_) };
public:
impl(int channel_index, spl::shared_ptr<diagnostics::graph> graph)
: channel_index_(channel_index)
int x = 0, y = 0;
if(params.size() >= 4)
{
- x = boost::lexical_cast<int>(params.at(2));
- y = boost::lexical_cast<int>(params.at(3));
+ x = std::stoi(params.at(2));
+ y = std::stoi(params.at(3));
}
text::text_info text_info;
#include <tbb/spin_mutex.h>
#include <boost/property_tree/ptree.hpp>
-#include <boost/lexical_cast.hpp>
#include <string>
#include <unordered_map>
int64_t last_tick_listener_id = 0;
std::unordered_map<int64_t, std::function<void ()>> tick_listeners_;
- executor executor_ { L"video_channel " + boost::lexical_cast<std::wstring>(index_) };
+ executor executor_ { L"video_channel " + std::to_wstring(index_) };
public:
impl(
int index,
const core::audio_channel_layout& channel_layout,
std::unique_ptr<image_mixer> image_mixer)
: monitor_subject_(spl::make_shared<monitor::subject>(
- "/channel/" + boost::lexical_cast<std::string>(index)))
+ "/channel/" + std::to_string(index)))
, index_(index)
, format_desc_(format_desc)
, channel_layout_(channel_layout)
std::wstring print() const
{
- return L"video_channel[" + boost::lexical_cast<std::wstring>(index_) + L"|" + video_format_desc().name + L"]";
+ return L"video_channel[" + std::to_wstring(index_) + L"|" + video_format_desc().name + L"]";
}
int index() const
#include <core/consumer/frame_consumer.h>
#include <core/system_info_provider.h>
-#include <boost/lexical_cast.hpp>
#include <boost/property_tree/ptree.hpp>
namespace caspar { namespace bluefish {
for(int n = 1; n < (numCards+1); n++)
{
blue.attach(n);
- devices.push_back(std::wstring(get_card_desc(blue, n)) + L" [" + boost::lexical_cast<std::wstring>(n) + L"]");
+ devices.push_back(std::wstring(get_card_desc(blue, n)) + L" [" + std::to_wstring(n) + L"]");
blue.detach();
}
}
#include <tbb/atomic.h>
#include <common/assert.h>
-#include <boost/lexical_cast.hpp>
#include <boost/timer.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/property_tree/ptree.hpp>
std::wstring print() const
{
- return model_name_ + L" [" + boost::lexical_cast<std::wstring>(channel_index_) + L"-" +
- boost::lexical_cast<std::wstring>(device_index_) + L"|" + format_desc_.name + L"]";
+ return model_name_ + L" [" + std::to_wstring(channel_index_) + L"-" +
+ std::to_wstring(device_index_) + L"|" + format_desc_.name + L"]";
}
int64_t presentation_delay_millis() const
if(params.size() < 1 || !boost::iequals(params.at(0), L"BLUEFISH"))
return core::frame_consumer::empty();
- const auto device_index = params.size() > 1 ? boost::lexical_cast<int>(params.at(1)) : 1;
+ const auto device_index = params.size() > 1 ? std::stoi(params.at(1)) : 1;
const auto device_stream = contains_param( L"SDI-STREAM", params);
const auto embedded_audio = contains_param( L"EMBEDDED_AUDIO", params);
const auto key_only = contains_param( L"KEY_ONLY", params);
#include <tbb/concurrent_queue.h>
#include <common/assert.h>
-#include <boost/lexical_cast.hpp>
#include <boost/circular_buffer.hpp>
#include <boost/property_tree/ptree.hpp>
std::wstring print() const
{
if (config_.keyer == configuration::keyer_t::external_separate_device_keyer)
- return model_name_ + L" [" + boost::lexical_cast<std::wstring>(channel_index_)+L"-" +
- boost::lexical_cast<std::wstring>(config_.device_index) +
+ return model_name_ + L" [" + std::to_wstring(channel_index_)+L"-" +
+ std::to_wstring(config_.device_index) +
L"&&" +
- boost::lexical_cast<std::wstring>(config_.key_device_index()) +
+ std::to_wstring(config_.key_device_index()) +
L"|" +
format_desc_.name + L"]";
else
- return model_name_ + L" [" + boost::lexical_cast<std::wstring>(channel_index_)+L"-" +
- boost::lexical_cast<std::wstring>(config_.device_index) + L"|" + format_desc_.name + L"]";
+ return model_name_ + L" [" + std::to_wstring(channel_index_)+L"-" +
+ std::to_wstring(config_.device_index) + L"|" + format_desc_.name + L"]";
}
};
decklink_consumer_proxy(const configuration& config)
: config_(config)
- , executor_(L"decklink_consumer[" + boost::lexical_cast<std::wstring>(config.device_index) + L"]")
+ , executor_(L"decklink_consumer[" + std::to_wstring(config.device_index) + L"]")
{
auto ctx = core::diagnostics::call_context::for_thread();
executor_.begin_invoke([=]
configuration config;
if (params.size() > 1)
- config.device_index = boost::lexical_cast<int>(params.at(1));
+ config.device_index = std::stoi(params.at(1));
if (contains_param(L"INTERNAL_KEY", params))
config.keyer = configuration::keyer_t::internal_keyer;
if (success)
model_name = u16(m_name);
- devices.push_back(model_name + L" [" + boost::lexical_cast<std::wstring>(n)+L"]");
+ devices.push_back(model_name + L" [" + std::to_wstring(n)+L"]");
}
}
catch (...){}
template <typename T>
std::wstring to_string(const T& cadence)
{
- return boost::join(cadence | boost::adaptors::transformed([](size_t i) { return boost::lexical_cast<std::wstring>(i); }), L", ");
+ return boost::join(cadence | boost::adaptors::transformed([](size_t i) { return std::to_wstring(i); }), L", ");
}
class decklink_producer : boost::noncopyable, public IDeckLinkInputCallback
std::wstring print() const
{
- return model_name_ + L" [" + boost::lexical_cast<std::wstring>(device_index_) + L"|" + in_format_desc_.name + L"]";
+ return model_name_ + L" [" + std::to_wstring(device_index_) + L"|" + in_format_desc_.name + L"]";
}
boost::rational<int> get_out_framerate() const
int device_index,
const std::wstring& filter_str,
uint32_t length)
- : executor_(L"decklink_producer[" + boost::lexical_cast<std::wstring>(device_index) + L"]")
+ : executor_(L"decklink_producer[" + std::to_wstring(device_index) + L"]")
, length_(length)
{
auto ctx = core::diagnostics::call_context::for_thread();
auto device_index = get_param(L"DEVICE", params, -1);
if(device_index == -1)
- device_index = boost::lexical_cast<int>(params.at(1));
+ device_index = std::stoi(params.at(1));
auto filter_str = get_param(L"FILTER", params);
auto length = get_param(L"LENGTH", params, std::numeric_limits<uint32_t>::max());
#include "../decklink_api.h"
-#include <boost/lexical_cast.hpp>
-
#include <string>
namespace caspar { namespace decklink {
}
if(!m)
- CASPAR_THROW_EXCEPTION(user_error() << msg_info("Device could not find requested video-format: " + boost::lexical_cast<std::string>(format)));
+ CASPAR_THROW_EXCEPTION(user_error() << msg_info("Device could not find requested video-format: " + std::to_string(format)));
com_ptr<IDeckLinkDisplayMode> mode = wrap_raw<com_ptr>(m, true);
}
if(n != device_index || !decklink)
- CASPAR_THROW_EXCEPTION(user_error() << msg_info("Decklink device " + boost::lexical_cast<std::string>(device_index) + " not found."));
+ CASPAR_THROW_EXCEPTION(user_error() << msg_info("Decklink device " + std::to_string(device_index) + " not found."));
return decklink;
}
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/noncopyable.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/range/adaptors.hpp>
// Replace each occurance of each channel name with c<index>
for (int i = 0; i < input.channel_order.size(); ++i)
- boost::replace_all(mix_spec, input.channel_order.at(i), L"c" + boost::lexical_cast<std::wstring>(i));
+ boost::replace_all(mix_spec, input.channel_order.at(i), L"c" + std::to_wstring(i));
auto output_name = boost::trim_copy(output_and_spec.at(0));
auto actual_output_indexes = output.indexes_of(output_name);
CASPAR_THROW_EXCEPTION(user_error() << msg_info(
"Failed to find video codec " + (video_codec_name
? *video_codec_name
- : "with id " + boost::lexical_cast<std::string>(
+ : "with id " + std::to_string(
oc_->oformat->video_codec))));
if (!audio_codec)
CASPAR_THROW_EXCEPTION(user_error() << msg_info(
"Failed to find audio codec " + (audio_codec_name
? *audio_codec_name
- : "with id " + boost::lexical_cast<std::string>(
+ : "with id " + std::to_string(
oc_->oformat->audio_codec))));
// Filters
splitfilter += (boost::format("0x%|1$x|") % create_channel_layout_bitmask(in_channel_layout_.num_channels)).str();
for (int i = 0; i < num_output_pads; ++i)
- splitfilter += "[aout:" + boost::lexical_cast<std::string>(i) + "]";
+ splitfilter += "[aout:" + std::to_string(i) + "]";
filtergraph = u8(append_filter(u16(filtergraph), u16(splitfilter)));
}
{
if (!value.empty())
input_.loop(boost::lexical_cast<bool>(value));
- result = boost::lexical_cast<std::wstring>(input_.loop());
+ result = std::to_wstring(input_.loop());
}
else if (boost::iequals(cmd, L"in") || boost::iequals(cmd, L"start"))
{
if (!value.empty())
input_.in(boost::lexical_cast<uint32_t>(value));
- result = boost::lexical_cast<std::wstring>(input_.in());
+ result = std::to_wstring(input_.in());
}
else if (boost::iequals(cmd, L"out"))
{
if (!value.empty())
input_.out(boost::lexical_cast<uint32_t>(value));
- result = boost::lexical_cast<std::wstring>(input_.out());
+ result = std::to_wstring(input_.out());
}
else if (boost::iequals(cmd, L"length"))
{
if (!value.empty())
input_.length(boost::lexical_cast<uint32_t>(value));
- result = boost::lexical_cast<std::wstring>(input_.length());
+ result = std::to_wstring(input_.length());
}
else if (boost::iequals(cmd, L"seek") && !value.empty())
{
{
return L"ffmpeg[" + (is_url() ? filename_ : boost::filesystem::path(filename_).filename().wstring()) + L"|"
+ print_mode() + L"|"
- + boost::lexical_cast<std::wstring>(file_frame_number_) + L"/" + boost::lexical_cast<std::wstring>(file_nb_frames()) + L"]";
+ + std::to_wstring(file_frame_number_) + L"/" + std::to_wstring(file_nb_frames()) + L"]";
}
std::wstring name() const override
{
int i = 0;
for (auto& input_pad : input_pads_)
- complete_filter_graph.push_back(create_sourcefilter_str(input_pad, "a:" + boost::lexical_cast<std::string>(i++)));
+ complete_filter_graph.push_back(create_sourcefilter_str(input_pad, "a:" + std::to_string(i++)));
}
if (filtergraph_.empty())
int i = 0;
for (auto& output_pad : output_pads)
{
- complete_filter_graph.push_back(create_sinkfilter_str(output_pad, "aout:" + boost::lexical_cast<std::string>(i++)));
+ complete_filter_graph.push_back(create_sinkfilter_str(output_pad, "aout:" + std::to_string(i++)));
output_pad.sample_fmts.push_back(AVSampleFormat::AV_SAMPLE_FMT_NONE);
output_pad.audio_channel_layouts.push_back(0);
try
{
auto meta = read_flv_meta_info(context.filename);
- double fps = boost::lexical_cast<double>(meta["framerate"]);
- video_stream->nb_frames = static_cast<int64_t>(boost::lexical_cast<double>(meta["duration"])*fps);
+ double fps = std::stod(meta["framerate"]);
+ video_stream->nb_frames = static_cast<int64_t>(std::stod(meta["duration"])*fps);
}
catch (...) {}
}
if (input_pads.size() > 1)
{
for (int i = 0; i < input_pads.size(); ++i)
- amerge += L"[a:" + boost::lexical_cast<std::wstring>(i) + L"]";
+ amerge += L"[a:" + std::to_wstring(i) + L"]";
- amerge += L"amerge=inputs=" + boost::lexical_cast<std::wstring>(input_pads.size());
+ amerge += L"amerge=inputs=" + std::to_wstring(input_pads.size());
}
std::wstring afilter;
{
if (mode == core::field_mode::lower && format_desc_.field_mode == core::field_mode::upper)
{
- filter_str = append_filter(filter_str, L"CROP=h=" + boost::lexical_cast<std::wstring>(frame->height - 1) + L":y=0");
- filter_str = append_filter(filter_str, L"PAD=0:" + boost::lexical_cast<std::wstring>(frame->height) + L":0:1:black");
+ filter_str = append_filter(filter_str, L"CROP=h=" + std::to_wstring(frame->height - 1) + L":y=0");
+ filter_str = append_filter(filter_str, L"PAD=0:" + std::to_wstring(frame->height) + L":0:1:black");
filter_str = append_filter(filter_str, L"SETFIELD=tff");
}
else if (mode == core::field_mode::upper && format_desc_.field_mode == core::field_mode::lower)
if (frame->height == 480) // NTSC DV
{
- auto pad_str = L"PAD=" + boost::lexical_cast<std::wstring>(frame->width) + L":486:0:2:black";
+ auto pad_str = L"PAD=" + std::to_wstring(frame->width) + L":486:0:2:black";
filter_str = append_filter(filter_str, pad_str);
}
{
static_assert(sizeof(double) == 8, "");
std::reverse(ptr, ptr+8);
- values[name] = boost::lexical_cast<std::string>(*(double*)(ptr));
+ values[name] = std::to_string(*(double*)(ptr));
ptr += 9;
break;
}
case 1: // bool
{
- values[name] = boost::lexical_cast<std::string>(*ptr != 0);
+ values[name] = std::to_string(*ptr != 0);
ptr += 2;
break;
#include <common/assert.h>
#include <boost/filesystem.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/rational.hpp>
#include <fstream>
try
{
auto meta = read_flv_meta_info(context.filename);
- return boost::rational<int>(static_cast<int>(boost::lexical_cast<double>(meta["framerate"]) * 1000000.0), 1000000);
+ return boost::rational<int>(static_cast<int>(std::stod(meta["framerate"]) * 1000000.0), 1000000);
}
catch (...)
{
try
{
auto meta = read_flv_meta_info(context.filename);
- double fps = boost::lexical_cast<double>(meta["framerate"]);
- video_stream->nb_frames = static_cast<int64_t>(boost::lexical_cast<double>(meta["duration"])*fps);
+ double fps = std::stod(meta["framerate"]);
+ video_stream->nb_frames = static_cast<int64_t>(std::stod(meta["duration"])*fps);
}
catch(...){}
}
std::wostringstream fps_ss;
fps_ss << std::fixed << std::setprecision(2) << (!interlaced ? fps : 2.0 * fps);
- return boost::lexical_cast<std::wstring>(width) + L"x" + boost::lexical_cast<std::wstring>(height) + (!interlaced ? L"p" : L"i") + fps_ss.str();
+ return std::to_wstring(width) + L"x" + std::to_wstring(height) + (!interlaced ? L"p" : L"i") + fps_ss.str();
}
bool is_valid_file(const std::wstring& filename, bool only_video)
std::string to_string(const boost::rational<int>& framerate)
{
- return boost::lexical_cast<std::string>(framerate.numerator())
- + "/" + boost::lexical_cast<std::string>(framerate.denominator()) + " (" + boost::lexical_cast<std::string>(static_cast<double>(framerate.numerator()) / static_cast<double>(framerate.denominator())) + ") fps";
+ return std::to_string(framerate.numerator())
+ + "/" + std::to_string(framerate.denominator()) + " (" + std::to_string(static_cast<double>(framerate.numerator()) / static_cast<double>(framerate.denominator())) + ") fps";
}
std::vector<int> find_audio_cadence(const boost::rational<int>& framerate)
std::wstring print()
{
return L"flash-player[" + boost::filesystem::path(filename_).filename().wstring()
- + L"|" + boost::lexical_cast<std::wstring>(width_)
- + L"x" + boost::lexical_cast<std::wstring>(height_)
+ + L"|" + std::to_wstring(width_)
+ + L"x" + std::to_wstring(height_)
+ L"]";
}
};
std::wstring print() const override
{
- return L"flash[" + boost::filesystem::path(filename_).wstring() + L"|" + boost::lexical_cast<std::wstring>(fps_) + L"]";
+ return L"flash[" + boost::filesystem::path(filename_).wstring() + L"|" + std::to_wstring(fps_) + L"]";
}
std::wstring name() const override
#include <boost/foreach.hpp>
#include <boost/timer.hpp>
#include <boost/range/algorithm/remove_if.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/log/trivial.hpp>
#include <boost/property_tree/ptree.hpp>
{
caspar_log(browser, boost::log::trivial::trace,
"context for frame "
- + boost::lexical_cast<std::string>(frame->GetIdentifier())
+ + std::to_string(frame->GetIdentifier())
+ " created");
contexts_.push_back(context);
if (removed != contexts_.end())
caspar_log(browser, boost::log::trivial::trace,
"context for frame "
- + boost::lexical_cast<std::string>(frame->GetIdentifier())
+ + std::to_string(frame->GetIdentifier())
+ " released");
else
caspar_log(browser, boost::log::trivial::warning,
"context for frame "
- + boost::lexical_cast<std::string>(frame->GetIdentifier())
+ + std::to_string(frame->GetIdentifier())
+ " released, but not found");
}
false
);
- auto cef_version_major = boost::lexical_cast<std::wstring>(cef_version_info(0));
- auto cef_revision = boost::lexical_cast<std::wstring>(cef_version_info(1));
- auto chrome_major = boost::lexical_cast<std::wstring>(cef_version_info(2));
- auto chrome_minor = boost::lexical_cast<std::wstring>(cef_version_info(3));
- auto chrome_build = boost::lexical_cast<std::wstring>(cef_version_info(4));
- auto chrome_patch = boost::lexical_cast<std::wstring>(cef_version_info(5));
+ auto cef_version_major = std::to_wstring(cef_version_info(0));
+ auto cef_revision = std::to_wstring(cef_version_info(1));
+ auto chrome_major = std::to_wstring(cef_version_info(2));
+ auto chrome_minor = std::to_wstring(cef_version_info(3));
+ auto chrome_build = std::to_wstring(cef_version_info(4));
+ auto chrome_patch = std::to_wstring(cef_version_info(5));
dependencies.system_info_provider_repo->register_version_provider(L"cef", [=]
{
#include <common/future.h>
#include <boost/filesystem.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/scoped_array.hpp>
#include <boost/date_time.hpp>
if (boost::iequals(cmd, L"SPEED"))
{
if (params.size() == 1)
- return make_ready_future(boost::lexical_cast<std::wstring>(-speed_.fetch()));
+ return make_ready_future(std::to_wstring(-speed_.fetch()));
- auto val = boost::lexical_cast<double>(params.at(1));
- int duration = params.size() > 2 ? boost::lexical_cast<int>(params.at(2)) : 0;
+ auto val = std::stod(params.at(1));
+ int duration = params.size() > 2 ? std::stoi(params.at(2)) : 0;
std::wstring tween = params.size() > 3 ? params.at(3) : L"linear";
speed_ = speed_tweener(speed_.fetch(), -val, duration, tween);
}
#include <core/help/help_repository.h>
#include <boost/circular_buffer.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/timer.hpp>
#include <boost/algorithm/string.hpp>
std::wstring print() const override
{
- return L"oal[" + boost::lexical_cast<std::wstring>(channel_index_) + L"|" + format_desc_.name + L"]";
+ return L"oal[" + std::to_wstring(channel_index_) + L"|" + format_desc_.name + L"]";
}
std::wstring name() const override
\r
#include <boost/property_tree/ptree.hpp>\r
#include <boost/algorithm/string.hpp>\r
-#include <boost/lexical_cast.hpp>\r
\r
#include <algorithm>\r
+#include <cmath>\r
+#include <cstdlib>\r
\r
namespace caspar { namespace psd {\r
\r
\r
auto c = cos(angle);\r
auto s = sin(angle);\r
- auto scale_x = (abs(c) > 0.1) ? xx / c : xy / s;\r
+ auto scale_x = (std::abs(c) > 0.1) ? xx / c : xy / s;\r
\r
if (xx / scale_x < 0) { //fel kvadrant\r
angle += PI;\r
c = cos(angle);\r
s = sin(angle);\r
- scale_x = (abs(c) > 0.1) ? xx / c : xy / s;\r
+ scale_x = (std::abs(c) > 0.1) ? xx / c : xy / s;\r
}\r
\r
auto shear_factor = (yx*c + yy*s) / (yy*c - yx * s);\r
auto scale_y = 1.0;\r
- if (abs(shear_factor) < 0.0001 || std::isnan(shear_factor)) {\r
+ if (std::abs(shear_factor) < 0.0001 || std::isnan(shear_factor)) {\r
shear_factor = 0;\r
- scale_y = (abs(c) > 0.1) ? yy / c : yx / -s;\r
+ scale_y = (std::abs(c) > 0.1) ? yy / c : yx / -s;\r
}\r
else {\r
scale_y = yx / (c*shear_factor - s);\r
else if(encoding == 1)\r
read_rle_image_data(stream, target, offset);\r
else\r
- CASPAR_THROW_EXCEPTION(psd_file_format_exception() << msg_info("Unhandled image data encoding: " + boost::lexical_cast<std::string>(encoding)));\r
+ CASPAR_THROW_EXCEPTION(psd_file_format_exception() << msg_info("Unhandled image data encoding: " + std::to_string(encoding)));\r
}\r
}\r
stream.set_position(end_of_data);\r
#include <boost/spirit/home/qi.hpp>
#pragma warning(pop)
-#include <boost/lexical_cast.hpp>
-
#include <cstdint>
namespace qi = boost::spirit::qi;
}
void set_value(double val)
{
- value = boost::lexical_cast<std::wstring>(val);
+ value = std::to_wstring(val);
set_value();
}
#include <core/frame/frame_factory.h>
#include <core/video_format.h>
-#include <boost/lexical_cast.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/range/algorithm/copy.hpp>
std::wstring print() const override
{
- return L"[channel-consumer|" + boost::lexical_cast<std::wstring>(channel_index_) + L"]";
+ return L"[channel-consumer|" + std::to_wstring(channel_index_) + L"]";
}
boost::property_tree::wptree info() const override
std::wstring print() const override
{
- return L"layer-producer[" + boost::lexical_cast<std::wstring>(layer_) + L"]";
+ return L"layer-producer[" + std::to_wstring(layer_) + L"]";
}
std::wstring name() const override
int channel_id;
if (has_layer_spec)
- channel_id = boost::lexical_cast<int>(channel_layer_spec.substr(0, dash));
+ channel_id = std::stoi(channel_layer_spec.substr(0, dash));
else
- channel_id = boost::lexical_cast<int>(channel_layer_spec);
+ channel_id = std::stoi(channel_layer_spec);
auto found_channel = boost::find_if(dependencies.channels, [=](spl::shared_ptr<core::video_channel> ch) { return ch->index() == channel_id; });
if (found_channel == dependencies.channels.end())
- CASPAR_THROW_EXCEPTION(user_error() << msg_info(L"No channel with id " + boost::lexical_cast<std::wstring>(channel_id)));
+ CASPAR_THROW_EXCEPTION(user_error() << msg_info(L"No channel with id " + std::to_wstring(channel_id)));
auto params2 = params;
params2.erase(params2.begin());
if (has_layer_spec)
{
- auto layer = boost::lexical_cast<int>(channel_layer_spec.substr(dash + 1));
+ auto layer = std::stoi(channel_layer_spec.substr(dash + 1));
return create_layer_producer(*found_channel, layer, frames_delay, dependencies.format_desc);
}
#include <core/help/help_repository.h>
#include <boost/circular_buffer.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/algorithm/string.hpp>
std::wstring channel_and_format() const
{
- return L"[" + boost::lexical_cast<std::wstring>(channel_index_) + L"|" + format_desc_.name + L"]";
+ return L"[" + std::to_wstring(channel_index_) + L"|" + format_desc_.name + L"]";
}
std::wstring print() const
configuration config;
if (params.size() > 1)
- config.screen_index = boost::lexical_cast<int>(params.at(1));
+ config.screen_index = std::stoi(params.at(1));
config.windowed = !contains_param(L"FULLSCREEN", params);
config.key_only = contains_param(L"KEY_ONLY", params);
CASPAR_LOG(error) << L"Missing parameter. Check syntax. Turn on log level debug for stacktrace.";
pCurrentCommand->SetReplyString(L"402 " + pCurrentCommand->print() + L" FAILED\r\n");
}
- catch (boost::bad_lexical_cast&)
+ catch (std::invalid_argument&)
{
CASPAR_LOG_CURRENT_EXCEPTION_AT_LEVEL(debug);
CASPAR_LOG(error) << L"Invalid parameter. Check syntax. Turn on log level debug for stacktrace.";
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());
+ 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";
}
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());
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);
}
{
//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;
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";
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";
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";
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";
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'{')
{
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";
}
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";
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;
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";
}
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)
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)
}
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));
}
}
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
{
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
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
{
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
{
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
{
{
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
{
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
{
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;
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";
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));
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)
{
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++;
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";
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));
for (int i = 0; i < repo_->channels().size(); ++i)
{
commandQueues_.push_back(spl::make_shared<AMCPCommandQueue>(
- L"Channel " + boost::lexical_cast<std::wstring>(i + 1) + L" for " + name));
+ L"Channel " + std::to_wstring(i + 1) + L" for " + name));
}
}
break;
default:
CASPAR_THROW_EXCEPTION(programming_error()
- << msg_info(L"Unhandled error_state enum constant " + boost::lexical_cast<std::wstring>(static_cast<int>(result.error))));
+ << msg_info(L"Unhandled error_state enum constant " + std::to_wstring(static_cast<int>(result.error))));
}
client->send(answer.str());
}
int index = 0;
for (const auto& channel : channels)
{
- std::wstring lifecycle_key = L"lock" + boost::lexical_cast<std::wstring>(index);
+ std::wstring lifecycle_key = L"lock" + std::to_wstring(index);
this->channels.push_back(channel_context(channel, lifecycle_key));
++index;
}
#include <boost/locale.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/split.hpp>
-#include <boost/lexical_cast.hpp>
namespace caspar { namespace protocol { namespace cii {
// Add Template to layer X in the active templatehost
if((parameters.size() > 5) && parameters[1] == L"5" && parameters[2] == L"13")
{
- layer_ = boost::lexical_cast<int>(parameters[4]);
+ layer_ = std::stoi(parameters[4]);
filename_ = parameters[5];
if(filename_.find(L"PK/") == std::wstring::npos && filename_.find(L"PK\\") == std::wstring::npos)
filename_ = L"PK/" + filename_;
try
{
- casparLayer_ = boost::lexical_cast<int>(split[0]);
+ casparLayer_ = std::stoi(split[0]);
if(split.size() > 1)
- layer_ = boost::lexical_cast<int>(split[1]);
+ layer_ = std::stoi(split[1]);
}
catch(...)
{
#include <functional>
#include <boost/asio.hpp>
-#include <boost/lexical_cast.hpp>
#include <tbb/mutex.h>
#include <tbb/concurrent_hash_map.h>
connection(const std::shared_ptr<boost::asio::io_service>& service, const spl::shared_ptr<tcp::socket>& socket, const protocol_strategy_factory<char>::ptr& protocol_factory, const spl::shared_ptr<connection_set>& connection_set)
: socket_(socket)
, service_(service)
- , listen_port_(socket_->is_open() ? boost::lexical_cast<std::wstring>(socket_->local_endpoint().port()) : L"no-port")
+ , listen_port_(socket_->is_open() ? std::to_wstring(socket_->local_endpoint().port()) : L"no-port")
, connection_set_(connection_set)
, protocol_factory_(protocol_factory)
, is_writing_(false)
std::wstring print() const
{
- return L"async_event_server[:" + boost::lexical_cast<std::wstring>(acceptor_.local_endpoint().port()) + L"]";
+ return L"async_event_server[:" + std::to_wstring(acceptor_.local_endpoint().port()) + L"]";
}
void add_client_lifecycle_object_factory(const lifecycle_factory_t& factory)
#include <boost/property_tree/detail/file_parser_error.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <boost/locale.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/algorithm/string/split.hpp>
std::wstring file;
try
{
- num = boost::lexical_cast<int>(wcmd.substr(1, 2));
+ num = std::stoi(wcmd.substr(1, 2));
file = wcmd.substr(4, wcmd.length()-1);
}
catch(...)
{
- num = boost::lexical_cast<int>(wcmd.substr(1, 1));
+ num = std::stoi(wcmd.substr(1, 1));
file = wcmd.substr(3, wcmd.length()-1);
}
n++;
}
- wcmd = L"MIXER 1 GRID " + boost::lexical_cast<std::wstring>(n);
+ wcmd = L"MIXER 1 GRID " + std::to_wstring(n);
for(int i = 1; i <= num; ++i)
- wcmd += L"\r\nPLAY 1-" + boost::lexical_cast<std::wstring>(i) + L" " + file + L" LOOP";// + L" SLIDE 100 LOOP";
+ wcmd += L"\r\nPLAY 1-" + std::to_wstring(i) + L" " + file + L" LOOP";// + L" SLIDE 100 LOOP";
}
}
catch (...)
#include <protocol/log/tcp_logger_protocol_strategy.h>
#include <boost/algorithm/string.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <boost/asio.hpp>
auto port = ptree_get<unsigned int>(xml_controller.second, L"port");
auto asyncbootstrapper = spl::make_shared<IO::AsyncEventServer>(
io_service_,
- create_protocol(protocol, L"TCP Port " + boost::lexical_cast<std::wstring>(port)),
+ create_protocol(protocol, L"TCP Port " + std::to_wstring(port)),
port);
async_servers_.push_back(asyncbootstrapper);