namespace caspar { namespace core { namespace scene {
layer::layer(const std::wstring& name, const spl::shared_ptr<frame_producer>& producer)
- : name(name), producer(producer)
+ : name(name)
+ , producer(producer)
+ , volume(1.0)
{
crop.lower_right.x.bind(producer.get()->pixel_constraints().width);
crop.lower_right.y.bind(producer.get()->pixel_constraints().height);
adjustments::adjustments()
: opacity(1.0)
+ , contrast(1.0)
+ , saturation(1.0)
+ , brightness(1.0)
+{
+}
+
+levels::levels()
+ : min_input(0.0)
+ , max_input(1.0)
+ , gamma(1.0)
+ , min_output(0.0)
+ , max_output(1.0)
{
}
else if (name == L"remove")
return mark_action::remove;
else
- CASPAR_THROW_EXCEPTION(invalid_argument() << msg_info(L"Invalid mark_action " + name));
+ CASPAR_THROW_EXCEPTION(user_error() << msg_info(L"Invalid mark_action " + name));
}
struct marker
struct scene_producer::impl
{
+ std::wstring producer_name_;
+ std::wstring template_name_;
constraints pixel_constraints_;
video_format_desc format_desc_;
std::list<layer> layers_;
interaction_aggregator aggregator_;
- binding<int64_t> frame_number_;
+ binding<double> frame_number_;
+ binding<int64_t> timeline_frame_number_;
binding<double> speed_;
- double frame_fraction_ = 0.0;
+ mutable tbb::atomic<int64_t> m_x_;
+ mutable tbb::atomic<int64_t> m_y_;
+ binding<int64_t> mouse_x_;
+ binding<int64_t> mouse_y_;
+ double frame_fraction_ = 0.0;
std::map<void*, timeline> timelines_;
std::map<std::wstring, std::shared_ptr<core::variable>> variables_;
std::vector<std::wstring> variable_names_;
std::multimap<int64_t, marker> markers_by_frame_;
+ std::vector<std::shared_ptr<void>> task_subscriptions_;
monitor::subject monitor_subject_;
- bool paused_ = true;
- bool removed_ = false;
- bool going_to_mark_ = false;
-
- impl(int width, int height, const video_format_desc& format_desc)
- : pixel_constraints_(width, height)
+ bool paused_ = true;
+ bool removed_ = false;
+ bool going_to_mark_ = false;
+
+ impl(
+ std::wstring producer_name,
+ std::wstring template_name,
+ int width,
+ int height,
+ const video_format_desc& format_desc)
+ : producer_name_(std::move(producer_name))
+ , template_name_(std::move(template_name))
, format_desc_(format_desc)
, aggregator_([=] (double x, double y) { return collission_detect(x, y); })
{
auto speed_variable = std::make_shared<core::variable_impl<double>>(L"1.0", true, 1.0);
store_variable(L"scene_speed", speed_variable);
speed_ = speed_variable->value();
- auto frame_variable = std::make_shared<core::variable_impl<int64_t>>(L"-1", true, -1);
+
+ auto frame_variable = std::make_shared<core::variable_impl<double>>(L"-1", true, -1);
store_variable(L"frame", frame_variable);
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);
+ store_variable(L"fps", fps_variable);
+
+ auto timeline_frame_variable = std::make_shared<core::variable_impl<int64_t>>(L"-1", false, -1);
+ store_variable(L"timeline_frame", timeline_frame_variable);
+ timeline_frame_number_ = timeline_frame_variable->value();
+
+ auto mouse_x_variable = std::make_shared<core::variable_impl<int64_t>>(L"0", false, 0);
+ auto mouse_y_variable = std::make_shared<core::variable_impl<int64_t>>(L"0", false, 0);
+ store_variable(L"mouse_x", mouse_x_variable);
+ store_variable(L"mouse_y", mouse_y_variable);
+ mouse_x_ = mouse_x_variable->value();
+ mouse_y_ = mouse_y_variable->value();
+ 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);
+ store_variable(L"scene_width", scene_width);
+ store_variable(L"scene_height", scene_height);
+ pixel_constraints_.width = scene_width->value();
+ pixel_constraints_.height = scene_height->value();
}
layer& create_layer(
layer.position.x.set(x);
layer.position.y.set(y);
+ layer.clip.lower_right.x.bind(pixel_constraints_.width);
+ layer.clip.lower_right.y.bind(pixel_constraints_.height);
layers_.push_back(layer);
return layers_.back();
}
+ void reverse_layers() {
+ layers_.reverse();
+ }
+
+ layer& get_layer(const std::wstring& name)
+ {
+ for (auto& layer : layers_)
+ if (layer.name.get() == name)
+ return layer;
+
+ CASPAR_THROW_EXCEPTION(user_error() << msg_info(name + L" not found in scene"));
+ }
+
void store_keyframe(void* timeline_identity, const keyframe& k)
{
timelines_[timeline_identity].keyframes.insert(std::make_pair(k.destination_frame, k));
markers_by_frame_.insert(std::make_pair(frame, marker(action, label)));
}
+ void add_task(binding<bool> when, std::function<void ()> task)
+ {
+ auto subscription = when.on_change([=]
+ {
+ if (when.get())
+ {
+ try
+ {
+ task();
+ }
+ catch (...)
+ {
+ CASPAR_LOG_CURRENT_EXCEPTION_AT_LEVEL(debug);
+ CASPAR_LOG(error) << print() << " Error when invoking scene task. Turn on log level debug for stacktrace.";
+ }
+ }
+ });
+
+ task_subscriptions_.push_back(std::move(subscription));
+ }
+
core::variable& get_variable(const std::wstring& name)
{
auto found = variables_.find(name);
if (found == variables_.end())
- CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(name + L" not found in scene"));
+ CASPAR_THROW_EXCEPTION(user_error() << msg_info(name + L" not found in scene"));
return *found->second;
}
return variable_names_;
}
- binding<int64_t> frame()
+ binding<int64_t> timeline_frame()
{
- return frame_number_;
+ return timeline_frame_number_;
}
frame_transform get_transform(const layer& layer) const
auto& anchor = transform.image_transform.anchor;
auto& pos = transform.image_transform.fill_translation;
auto& scale = transform.image_transform.fill_scale;
+ auto& clip_pos = transform.image_transform.clip_translation;
+ auto& clip_scale = transform.image_transform.clip_scale;
auto& angle = transform.image_transform.angle;
auto& crop = transform.image_transform.crop;
auto& pers = transform.image_transform.perspective;
-
- anchor[0] = layer.anchor.x.get() / layer.producer.get()->pixel_constraints().width.get();
- anchor[1] = layer.anchor.y.get() / layer.producer.get()->pixel_constraints().height.get();
- pos[0] = layer.position.x.get() / pixel_constraints_.width.get();
- pos[1] = layer.position.y.get() / pixel_constraints_.height.get();
- scale[0] = layer.producer.get()->pixel_constraints().width.get() / pixel_constraints_.width.get();
- scale[1] = layer.producer.get()->pixel_constraints().height.get() / pixel_constraints_.height.get();
- crop.ul[0] = layer.crop.upper_left.x.get() / layer.producer.get()->pixel_constraints().width.get();
- crop.ul[1] = layer.crop.upper_left.y.get() / layer.producer.get()->pixel_constraints().height.get();
- crop.lr[0] = layer.crop.lower_right.x.get() / layer.producer.get()->pixel_constraints().width.get();
- crop.lr[1] = layer.crop.lower_right.y.get() / layer.producer.get()->pixel_constraints().height.get();
- pers.ul[0] = layer.perspective.upper_left.x.get() / layer.producer.get()->pixel_constraints().width.get();
- pers.ul[1] = layer.perspective.upper_left.y.get() / layer.producer.get()->pixel_constraints().height.get();
- pers.ur[0] = layer.perspective.upper_right.x.get() / layer.producer.get()->pixel_constraints().width.get();
- pers.ur[1] = layer.perspective.upper_right.y.get() / layer.producer.get()->pixel_constraints().height.get();
- pers.lr[0] = layer.perspective.lower_right.x.get() / layer.producer.get()->pixel_constraints().width.get();
- pers.lr[1] = layer.perspective.lower_right.y.get() / layer.producer.get()->pixel_constraints().height.get();
- pers.ll[0] = layer.perspective.lower_left.x.get() / layer.producer.get()->pixel_constraints().width.get();
- pers.ll[1] = layer.perspective.lower_left.y.get() / layer.producer.get()->pixel_constraints().height.get();
+ auto& levels = transform.image_transform.levels;
+
+ anchor[0] = layer.anchor.x.get() / layer.producer.get()->pixel_constraints().width.get();
+ anchor[1] = layer.anchor.y.get() / layer.producer.get()->pixel_constraints().height.get();
+
+ pos[0] = layer.position.x.get() / pixel_constraints_.width.get();
+ pos[1] = layer.position.y.get() / pixel_constraints_.height.get();
+ scale[0] = layer.producer.get()->pixel_constraints().width.get() / pixel_constraints_.width.get();
+ scale[1] = layer.producer.get()->pixel_constraints().height.get() / pixel_constraints_.height.get();
+
+ clip_pos[0] = layer.clip.upper_left.x.get() / pixel_constraints_.width.get();
+ clip_pos[1] = layer.clip.upper_left.y.get() / pixel_constraints_.height.get();
+ clip_scale[0] = layer.clip.lower_right.x.get() / pixel_constraints_.width.get() - clip_pos[0];
+ clip_scale[1] = layer.clip.lower_right.y.get() / pixel_constraints_.height.get() - clip_pos[1];
+
+ crop.ul[0] = layer.crop.upper_left.x.get() / layer.producer.get()->pixel_constraints().width.get();
+ crop.ul[1] = layer.crop.upper_left.y.get() / layer.producer.get()->pixel_constraints().height.get();
+ crop.lr[0] = layer.crop.lower_right.x.get() / layer.producer.get()->pixel_constraints().width.get();
+ crop.lr[1] = layer.crop.lower_right.y.get() / layer.producer.get()->pixel_constraints().height.get();
+
+ pers.ul[0] = layer.perspective.upper_left.x.get() / layer.producer.get()->pixel_constraints().width.get();
+ pers.ul[1] = layer.perspective.upper_left.y.get() / layer.producer.get()->pixel_constraints().height.get();
+ pers.ur[0] = layer.perspective.upper_right.x.get() / layer.producer.get()->pixel_constraints().width.get();
+ pers.ur[1] = layer.perspective.upper_right.y.get() / layer.producer.get()->pixel_constraints().height.get();
+ pers.lr[0] = layer.perspective.lower_right.x.get() / layer.producer.get()->pixel_constraints().width.get();
+ pers.lr[1] = layer.perspective.lower_right.y.get() / layer.producer.get()->pixel_constraints().height.get();
+ pers.ll[0] = layer.perspective.lower_left.x.get() / layer.producer.get()->pixel_constraints().width.get();
+ pers.ll[1] = layer.perspective.lower_left.y.get() / layer.producer.get()->pixel_constraints().height.get();
static const double PI = 3.141592653589793;
- angle = layer.rotation.get() * PI / 180.0;
-
- transform.image_transform.opacity = layer.adjustments.opacity.get();
- transform.image_transform.is_key = layer.is_key.get();
- transform.image_transform.use_mipmap = layer.use_mipmap.get();
- transform.image_transform.blend_mode = layer.blend_mode.get();
- transform.image_transform.chroma.key = layer.chroma_key.key.get();
- transform.image_transform.chroma.threshold = layer.chroma_key.threshold.get();
- transform.image_transform.chroma.softness = layer.chroma_key.softness.get();
- transform.image_transform.chroma.spill = layer.chroma_key.spill.get();
+ angle = layer.rotation.get() * PI / 180.0;
+
+ levels.min_input = layer.levels.min_input.get();
+ levels.max_input = layer.levels.max_input.get();
+ levels.gamma = layer.levels.gamma.get();
+ levels.min_output = layer.levels.min_output.get();
+ levels.max_output = layer.levels.max_output.get();
+
+ transform.image_transform.opacity = layer.adjustments.opacity.get();
+ transform.image_transform.contrast = layer.adjustments.contrast.get();
+ transform.image_transform.saturation = layer.adjustments.saturation.get();
+ transform.image_transform.brightness = layer.adjustments.brightness.get();
+ transform.image_transform.is_key = layer.is_key.get();
+ transform.image_transform.use_mipmap = layer.use_mipmap.get();
+ transform.image_transform.blend_mode = layer.blend_mode.get();
+
+ transform.image_transform.chroma.enable = layer.chroma_key.enable.get();
+ transform.image_transform.chroma.target_hue = layer.chroma_key.target_hue.get();
+ transform.image_transform.chroma.hue_width = layer.chroma_key.hue_width.get();
+ transform.image_transform.chroma.min_saturation = layer.chroma_key.min_saturation.get();
+ transform.image_transform.chroma.min_brightness = layer.chroma_key.min_brightness.get();
+ transform.image_transform.chroma.softness = layer.chroma_key.softness.get();
+ transform.image_transform.chroma.spill_suppress = layer.chroma_key.spill_suppress.get();
+ transform.image_transform.chroma.spill_suppress_saturation = layer.chroma_key.spill_suppress_saturation.get();
+
+ transform.audio_transform.volume = layer.volume.get();
// Mark as sublayer, so it will be composited separately by the mixer.
transform.image_transform.layer_depth = 1;
auto action = iter->second.action;
if (action == mark_action::stop || action == mark_action::jump_to || action == mark_action::remove)
- return *iter;
+ return std::make_pair(iter->first, iter->second);
}
return boost::none;
auto action = iter->second.action;
if (action == mark_action::start)
- return *iter;
+ return std::make_pair(iter->first, iter->second);
}
return boost::none;
{
prec_timer timer;
timer.tick_millis(0);
-
+
auto field1 = render_progressive_frame();
-
+
timer.tick(0.5 / format_desc_.fps);
auto field2 = render_progressive_frame();
if (std::abs(frame_fraction_) >= 1.0)
{
int64_t delta = static_cast<int64_t>(frame_fraction_);
- auto previous_frame = frame_number_.get();
- auto next_frame = frame_number_.get() + delta;
+ auto previous_frame = timeline_frame_number_.get();
+ auto next_frame = timeline_frame_number_.get() + delta;
auto marker = find_first_stop_or_jump_or_remove(previous_frame + 1, next_frame);
if (marker && marker->second.action == mark_action::remove)
{
if (marker->second.action == mark_action::stop)
{
- frame_number_.set(marker->first);
+ timeline_frame_number_.set(marker->first);
frame_fraction_ = 0.0;
paused_ = true;
}
}
else
{
- frame_number_.set(next_frame);
+ timeline_frame_number_.set(next_frame);
frame_fraction_ -= delta;
}
if (removed_)
return draw_frame::empty();
+ mouse_x_.set(m_x_);
+ mouse_y_.set(m_y_);
+
if (!paused_)
advance();
+ frame_number_.set(frame_number_.get() + speed_.get());
+
for (auto& timeline : timelines_)
- timeline.second.on_frame(frame_number_.get());
+ timeline.second.on_frame(timeline_frame_number_.get());
std::vector<draw_frame> frames;
bool collides(double x, double y) const
{
+ m_x_ = static_cast<int64_t>(x * pixel_constraints_.width.get());
+ m_y_ = static_cast<int64_t>(y * pixel_constraints_.height.get());
+
return static_cast<bool>((collission_detect(x, y)));
}
return boost::optional<interaction_target>();
}
- std::future<std::wstring> call(const std::vector<std::wstring>& params)
+ std::future<std::wstring> call(const std::vector<std::wstring>& params)
{
if (!params.empty() && boost::ends_with(params.at(0), L"()"))
return make_ready_future(handle_call(params));
{
for (int i = 0; i + 1 < params.size(); i += 2)
{
- auto found = variables_.find(boost::to_lower_copy(params[i]));
+ auto found = variables_.find(boost::to_lower_copy(params.at(i)));
if (found != variables_.end() && found->second->is_public())
- found->second->from_string(params[i + 1]);
+ found->second->from_string(params.at(i + 1));
}
return L"";
else if (call == L"next()")
next();
else
- CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(L"Unknown call " + call));
+ CASPAR_THROW_EXCEPTION(user_error() << msg_info(L"Unknown call " + call));
return L"";
}
void next()
{
- auto marker = find_first_start(frame_number_.get() + 1);
+ auto marker = find_first_start(timeline_frame_number_.get() + 1);
if (marker)
{
- frame_number_.set(marker->first - 1);
+ timeline_frame_number_.set(marker->first - 1);
frame_fraction_ = 0.0;
paused_ = false;
going_to_mark_ = true;
{
if (marker.second.label_argument == marker_name && marker.second.action == mark_action::start)
{
- frame_number_.set(marker.first + offset);
+ timeline_frame_number_.set(marker.first + offset);
frame_fraction_ = 0.0;
paused_ = false;
going_to_mark_ = true;
if (marker_name == L"intro")
{
- frame_number_.set(offset);
+ timeline_frame_number_.set(offset);
frame_fraction_ = 0.0;
paused_ = false;
going_to_mark_ = true;
std::wstring print() const
{
- return L"scene[]";
+ return L"scene[type=" + name() + L" template=" + template_name_ + L"]";
}
std::wstring name() const
{
- return L"scene";
+ return producer_name_;
}
-
+
boost::property_tree::wptree info() const
{
boost::property_tree::wptree info;
info.add(L"type", L"scene");
+ info.add(L"producer-name", name());
+ info.add(L"template-name", template_name_);
+ info.add(L"frame-number", frame_number_.get());
+ info.add(L"timeline-frame-number", timeline_frame_number_.get());
+
+ for (auto& var : variables_)
+ {
+ boost::property_tree::wptree variable_info;
+
+ variable_info.add(L"name", var.first);
+ variable_info.add(L"public", var.second->is_public());
+ variable_info.add(L"value", var.second->to_string());
+
+ info.add_child(L"variables.variable", variable_info);
+ }
+
+ for (auto& layer : layers_)
+ {
+ boost::property_tree::wptree layer_info;
+
+ layer_info.add(L"name", layer.name.get());
+ layer_info.add_child(L"producer", layer.producer.get()->info());
+ layer_info.add(L"x", layer.position.x.get());
+ layer_info.add(L"y", layer.position.y.get());
+ layer_info.add(L"width", layer.producer.get()->pixel_constraints().width.get());
+ layer_info.add(L"height", layer.producer.get()->pixel_constraints().height.get());
+
+ info.add_child(L"layers.layer", layer_info);
+ }
+
return info;
}
}
};
-scene_producer::scene_producer(int width, int height, const video_format_desc& format_desc)
- : impl_(new impl(width, height, format_desc))
+scene_producer::scene_producer(std::wstring producer_name, std::wstring template_name, int width, int height, const video_format_desc& format_desc)
+ : impl_(new impl(std::move(producer_name), std::move(template_name), width, height, format_desc))
{
}
return impl_->create_layer(producer, 0, 0, name);
}
-binding<int64_t> scene_producer::frame()
+void scene_producer::reverse_layers()
+{
+ impl_->reverse_layers();
+}
+
+layer& scene_producer::get_layer(const std::wstring& name)
+{
+ return impl_->get_layer(name);
+}
+
+binding<int64_t> scene_producer::timeline_frame()
{
- return impl_->frame();
+ return impl_->timeline_frame();
}
draw_frame scene_producer::receive_impl()
return impl_->info();
}
-std::future<std::wstring> scene_producer::call(const std::vector<std::wstring>& params)
+std::future<std::wstring> scene_producer::call(const std::vector<std::wstring>& params)
{
return impl_->call(params);
}
impl_->add_mark(frame, action, label);
}
+void scene_producer::add_task(binding<bool> when, std::function<void ()> task)
+{
+ impl_->add_task(std::move(when), std::move(task));
+}
+
core::variable& scene_producer::get_variable(const std::wstring& name)
{
return impl_->get_variable(name);
return impl_->get_variables();
}
-spl::shared_ptr<core::frame_producer> create_dummy_scene_producer(const spl::shared_ptr<core::frame_factory>& frame_factory, const video_format_desc& format_desc, const std::vector<std::wstring>& params)
-{
- if (params.size() < 1 || !boost::iequals(params.at(0), L"[SCENE]"))
- return core::frame_producer::empty();
-
- auto scene = spl::make_shared<scene_producer>(format_desc.width, format_desc.height, format_desc);
-
- text::text_info text_info;
- text_info.font = L"ArialMT";
- text_info.size = 62;
- text_info.color.r = 1;
- text_info.color.g = 1;
- text_info.color.b = 1;
- text_info.color.a = 0.5;
- auto text_area = text_producer::create(frame_factory, 0, 0, L"a", text_info, 1280, 720, false);
-
- auto text_width = text_area->pixel_constraints().width;
- binding<double> padding(1.0);
- binding<double> panel_width = padding + text_width + padding;
- binding<double> panel_height = padding + text_area->pixel_constraints().height + padding;
-
- auto subscription = panel_width.on_change([&]
- {
- CASPAR_LOG(info) << "Panel width: " << panel_width.get();
- });
-
- padding.set(2);
-
- auto create_param = [](std::wstring elem) -> std::vector<std::wstring>
- {
- std::vector<std::wstring> result;
- result.push_back(elem);
- return result;
- };
-
- auto& car_layer = scene->create_layer(create_producer(frame_factory, format_desc, create_param(L"car")), L"car");
- car_layer.adjustments.opacity.set(0.5);
- //car_layer.hidden = scene->frame() % 50 > 25 || !(scene->frame() < 1000);
- std::vector<std::wstring> sub_params;
- sub_params.push_back(L"[FREEHAND]");
- sub_params.push_back(L"640");
- sub_params.push_back(L"360");
- scene->create_layer(create_producer(frame_factory, format_desc, sub_params), 10, 10, L"freehand");
- sub_params.clear();
-
- auto& color_layer = scene->create_layer(create_producer(frame_factory, format_desc, create_param(L"RED")), 110, 10, L"color");
- color_layer.producer.get()->pixel_constraints().width.set(1000);
- color_layer.producer.get()->pixel_constraints().height.set(550);
-
- //scene->create_layer(create_producer(frame_factory, format_desc, create_param(L"SP")), 50, 50);
-
- auto& upper_left = scene->create_layer(create_producer(frame_factory, format_desc, create_param(L"scene/upper_left")), L"upper_left");
- auto& upper_right = scene->create_layer(create_producer(frame_factory, format_desc, create_param(L"scene/upper_right")), L"upper_right");
- auto& lower_left = scene->create_layer(create_producer(frame_factory, format_desc, create_param(L"scene/lower_left")), L"lower_left");
- auto& lower_right = scene->create_layer(create_producer(frame_factory, format_desc, create_param(L"scene/lower_right")), L"lower_right");
- auto& text_layer = scene->create_layer(text_area, L"text_area");
- upper_left.adjustments.opacity.bind(text_layer.adjustments.opacity);
- upper_right.adjustments.opacity.bind(text_layer.adjustments.opacity);
- lower_left.adjustments.opacity.bind(text_layer.adjustments.opacity);
- lower_right.adjustments.opacity.bind(text_layer.adjustments.opacity);
-
- /*
- binding<double> panel_x = (scene->frame()
- .as<double>()
- .transformed([](double v) { return std::sin(v / 20.0); })
- * 20.0
- + 40.0)
- .transformed([](double v) { return std::floor(v); }); // snap to pixels instead of subpixels
- */
- tweener tween(L"easeoutbounce");
- binding<double> panel_x(0.0);
-
- scene->add_keyframe(panel_x, -panel_width, 0);
- scene->add_keyframe(panel_x, 300.0, 50, L"easeinoutsine");
- scene->add_keyframe(panel_x, 300.0, 50 * 4);
- scene->add_keyframe(panel_x, 1000.0, 50 * 5, L"easeinoutsine");
- //panel_x = delay(panel_x, add_tween(panel_x, scene->frame(), 200.0, int64_t(50), L"linear"), scene->frame(), int64_t(100));
- /*binding<double> panel_x = when(scene->frame() < 50)
- .then(scene->frame().as<double>().transformed([tween](double t) { return tween(t, 0.0, 200, 50); }))
- .otherwise(200.0);*/
- //binding<double> panel_y = when(car_layer.hidden).then(500.0).otherwise(-panel_x + 300);
- binding<double> panel_y(500.0);
- scene->add_keyframe(panel_y, panel_y.get(), 50 * 4);
- scene->add_keyframe(panel_y, 720.0, 50 * 5, L"easeinexpo");
-
- scene->add_keyframe(text_layer.adjustments.opacity, 1.0, 100);
- scene->add_keyframe(text_layer.adjustments.opacity, 0.0, 125, L"linear");
- scene->add_keyframe(text_layer.adjustments.opacity, 1.0, 150, L"linear");
-
- upper_left.position.x = panel_x;
- upper_left.position.y = panel_y;
- upper_right.position.x = upper_left.position.x + upper_left.producer.get()->pixel_constraints().width + panel_width;
- upper_right.position.y = upper_left.position.y;
- lower_left.position.x = upper_left.position.x;
- lower_left.position.y = upper_left.position.y + upper_left.producer.get()->pixel_constraints().height + panel_height;
- lower_right.position.x = upper_right.position.x;
- lower_right.position.y = lower_left.position.y;
- text_layer.position.x = upper_left.position.x + upper_left.producer.get()->pixel_constraints().width + padding;
- text_layer.position.y = upper_left.position.y + upper_left.producer.get()->pixel_constraints().height + padding + text_area->current_bearing_y().as<double>();
-
- text_area->text().bind(scene->create_variable<std::wstring>(L"text", true));
-
- auto params2 = params;
- params2.erase(params2.begin());
-
- scene->call(params2);
-
- return scene;
-}
-
}}}