]> git.sesse.net Git - casparcg/blob - core/producer/scene/scene_producer.cpp
[scene_producer] Added possibility to CALL/CG PLAY/CG STOP/CG NEXT/CG INVOKE layers...
[casparcg] / core / producer / scene / scene_producer.cpp
1 /*
2 * Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
3 *
4 * This file is part of CasparCG (www.casparcg.com).
5 *
6 * CasparCG is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * CasparCG is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * Author: Helge Norberg, helge.norberg@svt.se
20 */
21
22 #include "../../StdAfx.h"
23
24 #include <common/future.h>
25 #include <common/prec_timer.h>
26
27 #include <boost/algorithm/string/split.hpp>
28 #include <boost/algorithm/string.hpp>
29
30 #include "scene_producer.h"
31
32 #include "../../frame/draw_frame.h"
33 #include "../../interaction/interaction_aggregator.h"
34 #include "../text/text_producer.h"
35
36 namespace caspar { namespace core { namespace scene {
37
38 layer::layer(const std::wstring& name, const spl::shared_ptr<frame_producer>& producer)
39         : name(name), producer(producer)
40 {
41         crop.lower_right.x.bind(producer.get()->pixel_constraints().width);
42         crop.lower_right.y.bind(producer.get()->pixel_constraints().height);
43         perspective.upper_right.x.bind(producer.get()->pixel_constraints().width);
44         perspective.lower_right.x.bind(producer.get()->pixel_constraints().width);
45         perspective.lower_right.y.bind(producer.get()->pixel_constraints().height);
46         perspective.lower_left.y.bind(producer.get()->pixel_constraints().height);
47 }
48
49 adjustments::adjustments()
50         : opacity(1.0)
51 {
52 }
53
54 struct timeline
55 {
56         std::map<int64_t, keyframe> keyframes;
57
58         void on_frame(int64_t frame)
59         {
60                 auto before = --keyframes.upper_bound(frame);
61                 bool found_before = before != keyframes.end() && before->first < frame;
62                 auto after = keyframes.upper_bound(frame);
63                 bool found_after = after != keyframes.end() && after->first > frame;
64                 auto exact_frame = keyframes.find(frame);
65                 bool found_exact_frame = exact_frame != keyframes.end();
66
67                 if (found_exact_frame)
68                 {
69                         exact_frame->second.on_destination_frame();
70
71                         auto next_frame = ++exact_frame;
72
73                         if (next_frame != keyframes.end() && next_frame->second.on_start_animate)
74                                 next_frame->second.on_start_animate();
75                 }
76                 else if (found_after)
77                 {
78                         int64_t start_frame = 0;
79
80                         if (found_before)
81                         {
82                                 start_frame = before->first;
83                         }
84
85                         if (after->second.on_start_animate && frame == 0)
86                                 after->second.on_start_animate();
87                         else if (after->second.on_animate_to)
88                                 after->second.on_animate_to(start_frame, frame);
89                 }
90         }
91 };
92
93 mark_action get_mark_action(const std::wstring& name)
94 {
95         if (name == L"start")
96                 return mark_action::start;
97         else if (name == L"stop")
98                 return mark_action::stop;
99         else if (name == L"jump_to")
100                 return mark_action::jump_to;
101         else if (name == L"remove")
102                 return mark_action::remove;
103         else
104                 CASPAR_THROW_EXCEPTION(user_error() << msg_info(L"Invalid mark_action " + name));
105 }
106
107 struct marker
108 {
109         mark_action             action;
110         std::wstring    label_argument;
111
112         marker(mark_action action, const std::wstring& label_argument)
113                 : action(action)
114                 , label_argument(label_argument)
115         {
116         }
117 };
118
119 struct scene_producer::impl
120 {
121         std::wstring                                                                                    producer_name_;
122         std::wstring                                                                                    template_name_;
123         constraints                                                                                             pixel_constraints_;
124         video_format_desc                                                                               format_desc_;
125         std::list<layer>                                                                                layers_;
126         interaction_aggregator                                                                  aggregator_;
127         binding<double>                                                                                 frame_number_;
128         binding<int64_t>                                                                                timeline_frame_number_;
129         binding<double>                                                                                 speed_;
130         mutable tbb::atomic<int64_t>                                                    m_x_;
131         mutable tbb::atomic<int64_t>                                                    m_y_;
132         binding<int64_t>                                                                                mouse_x_;
133         binding<int64_t>                                                                                mouse_y_;
134         double                                                                                                  frame_fraction_         = 0.0;
135         std::map<void*, timeline>                                                               timelines_;
136         std::map<std::wstring, std::shared_ptr<core::variable>> variables_;
137         std::vector<std::wstring>                                                               variable_names_;
138         std::multimap<int64_t, marker>                                                  markers_by_frame_;
139         std::vector<std::shared_ptr<void>>                                              task_subscriptions_;
140         monitor::subject                                                                                monitor_subject_;
141         bool                                                                                                    paused_                         = true;
142         bool                                                                                                    removed_                        = false;
143         bool                                                                                                    going_to_mark_          = false;
144
145         impl(
146                         std::wstring producer_name,
147                         std::wstring template_name,
148                         int width,
149                         int height,
150                         const video_format_desc& format_desc)
151                 : producer_name_(std::move(producer_name))
152                 , template_name_(std::move(template_name))
153                 , format_desc_(format_desc)
154                 , aggregator_([=] (double x, double y) { return collission_detect(x, y); })
155         {
156                 auto speed_variable = std::make_shared<core::variable_impl<double>>(L"1.0", true, 1.0);
157                 store_variable(L"scene_speed", speed_variable);
158                 speed_ = speed_variable->value();
159
160                 auto frame_variable = std::make_shared<core::variable_impl<double>>(L"-1", true, -1);
161                 store_variable(L"frame", frame_variable);
162                 frame_number_ = frame_variable->value();
163
164                 auto timeline_frame_variable = std::make_shared<core::variable_impl<int64_t>>(L"-1", false, -1);
165                 store_variable(L"timeline_frame", timeline_frame_variable);
166                 timeline_frame_number_ = timeline_frame_variable->value();
167
168                 auto mouse_x_variable = std::make_shared<core::variable_impl<int64_t>>(L"0", false, 0);
169                 auto mouse_y_variable = std::make_shared<core::variable_impl<int64_t>>(L"0", false, 0);
170                 store_variable(L"mouse_x", mouse_x_variable);
171                 store_variable(L"mouse_y", mouse_y_variable);
172                 mouse_x_ = mouse_x_variable->value();
173                 mouse_y_ = mouse_y_variable->value();
174                 m_x_ = 0;
175                 m_y_ = 0;
176
177                 auto scene_width = std::make_shared<core::variable_impl<double>>(boost::lexical_cast<std::wstring>(width), false, width);
178                 auto scene_height = std::make_shared<core::variable_impl<double>>(boost::lexical_cast<std::wstring>(height), false, height);
179                 store_variable(L"scene_width", scene_width);
180                 store_variable(L"scene_height", scene_height);
181                 pixel_constraints_.width = scene_width->value();
182                 pixel_constraints_.height = scene_height->value();
183         }
184
185         layer& create_layer(
186                         const spl::shared_ptr<frame_producer>& producer, int x, int y, const std::wstring& name)
187         {
188                 layer layer(name, producer);
189
190                 layer.position.x.set(x);
191                 layer.position.y.set(y);
192
193                 layers_.push_back(layer);
194
195                 return layers_.back();
196         }
197
198         void reverse_layers() {
199                 layers_.reverse();
200         }
201
202         layer& get_layer(const std::wstring& name)
203         {
204                 for (auto& layer : layers_)
205                         if (layer.name.get() == name)
206                                 return layer;
207
208                 CASPAR_THROW_EXCEPTION(user_error() << msg_info(name + L" not found in scene"));
209         }
210
211         void store_keyframe(void* timeline_identity, const keyframe& k)
212         {
213                 timelines_[timeline_identity].keyframes.insert(std::make_pair(k.destination_frame, k));
214         }
215
216         void store_variable(
217                         const std::wstring& name, const std::shared_ptr<core::variable>& var)
218         {
219                 variables_.insert(std::make_pair(name, var));
220                 variable_names_.push_back(name);
221         }
222
223         void add_mark(int64_t frame, mark_action action, const std::wstring& label)
224         {
225                 markers_by_frame_.insert(std::make_pair(frame, marker(action, label)));
226         }
227
228         void add_task(binding<bool> when, std::function<void ()> task)
229         {
230                 auto subscription = when.on_change([=]
231                 {
232                         if (when.get())
233                         {
234                                 try
235                                 {
236                                         task();
237                                 }
238                                 catch (...)
239                                 {
240                                         CASPAR_LOG_CURRENT_EXCEPTION_AT_LEVEL(debug);
241                                         CASPAR_LOG(error) << print() << " Error when invoking scene task. Turn on log level debug for stacktrace.";
242                                 }
243                         }
244                 });
245
246                 task_subscriptions_.push_back(std::move(subscription));
247         }
248
249         core::variable& get_variable(const std::wstring& name)
250         {
251                 auto found = variables_.find(name);
252
253                 if (found == variables_.end())
254                         CASPAR_THROW_EXCEPTION(user_error() << msg_info(name + L" not found in scene"));
255
256                 return *found->second;
257         }
258
259         const std::vector<std::wstring>& get_variables() const
260         {
261                 return variable_names_;
262         }
263
264         binding<int64_t> timeline_frame()
265         {
266                 return timeline_frame_number_;
267         }
268
269         frame_transform get_transform(const layer& layer) const
270         {
271                 frame_transform transform;
272
273                 auto& anchor            = transform.image_transform.anchor;
274                 auto& pos                       = transform.image_transform.fill_translation;
275                 auto& scale                     = transform.image_transform.fill_scale;
276                 auto& angle                     = transform.image_transform.angle;
277                 auto& crop                      = transform.image_transform.crop;
278                 auto& pers                      = transform.image_transform.perspective;
279
280                 anchor[0]       = layer.anchor.x.get()                                                                          / layer.producer.get()->pixel_constraints().width.get();
281                 anchor[1]       = layer.anchor.y.get()                                                                          / layer.producer.get()->pixel_constraints().height.get();
282                 pos[0]          = layer.position.x.get()                                                                        / pixel_constraints_.width.get();
283                 pos[1]          = layer.position.y.get()                                                                        / pixel_constraints_.height.get();
284                 scale[0]        = layer.producer.get()->pixel_constraints().width.get()         / pixel_constraints_.width.get();
285                 scale[1]        = layer.producer.get()->pixel_constraints().height.get()        / pixel_constraints_.height.get();
286                 crop.ul[0]      = layer.crop.upper_left.x.get()                                                         / layer.producer.get()->pixel_constraints().width.get();
287                 crop.ul[1]      = layer.crop.upper_left.y.get()                                                         / layer.producer.get()->pixel_constraints().height.get();
288                 crop.lr[0]      = layer.crop.lower_right.x.get()                                                        / layer.producer.get()->pixel_constraints().width.get();
289                 crop.lr[1]      = layer.crop.lower_right.y.get()                                                        / layer.producer.get()->pixel_constraints().height.get();
290                 pers.ul[0]      = layer.perspective.upper_left.x.get()                                          / layer.producer.get()->pixel_constraints().width.get();
291                 pers.ul[1]      = layer.perspective.upper_left.y.get()                                          / layer.producer.get()->pixel_constraints().height.get();
292                 pers.ur[0]      = layer.perspective.upper_right.x.get()                                         / layer.producer.get()->pixel_constraints().width.get();
293                 pers.ur[1]      = layer.perspective.upper_right.y.get()                                         / layer.producer.get()->pixel_constraints().height.get();
294                 pers.lr[0]      = layer.perspective.lower_right.x.get()                                         / layer.producer.get()->pixel_constraints().width.get();
295                 pers.lr[1]      = layer.perspective.lower_right.y.get()                                         / layer.producer.get()->pixel_constraints().height.get();
296                 pers.ll[0]      = layer.perspective.lower_left.x.get()                                          / layer.producer.get()->pixel_constraints().width.get();
297                 pers.ll[1]      = layer.perspective.lower_left.y.get()                                          / layer.producer.get()->pixel_constraints().height.get();
298
299                 static const double PI = 3.141592653589793;
300
301                 angle           = layer.rotation.get() * PI / 180.0;
302
303                 transform.image_transform.opacity                               = layer.adjustments.opacity.get();
304                 transform.image_transform.is_key                                = layer.is_key.get();
305                 transform.image_transform.use_mipmap                    = layer.use_mipmap.get();
306                 transform.image_transform.blend_mode                    = layer.blend_mode.get();
307                 transform.image_transform.chroma.enable                 = layer.chroma_key.enable.get();
308                 transform.image_transform.chroma.target_hue             = layer.chroma_key.target_hue.get();
309                 transform.image_transform.chroma.hue_width              = layer.chroma_key.hue_width.get();
310                 transform.image_transform.chroma.min_saturation = layer.chroma_key.min_saturation.get();
311                 transform.image_transform.chroma.min_brightness = layer.chroma_key.min_brightness.get();
312                 transform.image_transform.chroma.softness               = layer.chroma_key.softness.get();
313                 transform.image_transform.chroma.spill                  = layer.chroma_key.spill.get();
314                 transform.image_transform.chroma.spill_darken   = layer.chroma_key.spill_darken.get();
315
316                 // Mark as sublayer, so it will be composited separately by the mixer.
317                 transform.image_transform.layer_depth = 1;
318
319                 return transform;
320         }
321
322         boost::optional<std::pair<int64_t, marker>> find_first_stop_or_jump_or_remove(int64_t start_frame, int64_t end_frame)
323         {
324                 auto lower = markers_by_frame_.lower_bound(start_frame);
325                 auto upper = markers_by_frame_.upper_bound(end_frame);
326
327                 if (lower == markers_by_frame_.end())
328                         return boost::none;
329
330                 for (auto iter = lower; iter != upper; ++iter)
331                 {
332                         auto action = iter->second.action;
333
334                         if (action == mark_action::stop || action == mark_action::jump_to || action == mark_action::remove)
335                                 return std::make_pair(iter->first, iter->second);
336                 }
337
338                 return boost::none;
339         }
340
341         boost::optional<std::pair<int64_t, marker>> find_first_start(int64_t start_frame)
342         {
343                 auto lower = markers_by_frame_.lower_bound(start_frame);
344
345                 if (lower == markers_by_frame_.end())
346                         return boost::none;
347
348                 for (auto iter = lower; iter != markers_by_frame_.end(); ++iter)
349                 {
350                         auto action = iter->second.action;
351
352                         if (action == mark_action::start)
353                                 return std::make_pair(iter->first, iter->second);
354                 }
355
356                 return boost::none;
357         }
358
359         draw_frame render_frame()
360         {
361                 if (format_desc_.field_count == 1)
362                         return render_progressive_frame();
363                 else
364                 {
365                         prec_timer timer;
366                         timer.tick_millis(0);
367
368                         auto field1 = render_progressive_frame();
369
370                         timer.tick(0.5 / format_desc_.fps);
371
372                         auto field2 = render_progressive_frame();
373
374                         return draw_frame::interlace(field1, field2, format_desc_.field_mode);
375                 }
376         }
377
378         void advance()
379         {
380                 frame_fraction_ += speed_.get();
381
382                 if (std::abs(frame_fraction_) >= 1.0)
383                 {
384                         int64_t delta = static_cast<int64_t>(frame_fraction_);
385                         auto previous_frame = timeline_frame_number_.get();
386                         auto next_frame = timeline_frame_number_.get() + delta;
387                         auto marker = find_first_stop_or_jump_or_remove(previous_frame + 1, next_frame);
388
389                         if (marker && marker->second.action == mark_action::remove)
390                         {
391                                 remove();
392                         }
393                         if (marker && !going_to_mark_)
394                         {
395                                 if (marker->second.action == mark_action::stop)
396                                 {
397                                         timeline_frame_number_.set(marker->first);
398                                         frame_fraction_ = 0.0;
399                                         paused_ = true;
400                                 }
401                                 else if (marker->second.action == mark_action::jump_to)
402                                 {
403                                         go_to_marker(marker->second.label_argument, 0);
404                                 }
405                         }
406                         else
407                         {
408                                 timeline_frame_number_.set(next_frame);
409                                 frame_fraction_ -= delta;
410                         }
411
412                         going_to_mark_ = false;
413                 }
414         }
415
416         draw_frame render_progressive_frame()
417         {
418                 if (removed_)
419                         return draw_frame::empty();
420
421                 mouse_x_.set(m_x_);
422                 mouse_y_.set(m_y_);
423
424                 if (!paused_)
425                         advance();
426
427                 frame_number_.set(frame_number_.get() + speed_.get());
428
429                 for (auto& timeline : timelines_)
430                         timeline.second.on_frame(timeline_frame_number_.get());
431
432                 std::vector<draw_frame> frames;
433
434                 for (auto& layer : layers_)
435                 {
436                         if (layer.hidden.get())
437                                 continue;
438
439                         draw_frame frame(layer.producer.get()->receive());
440                         frame.transform() = get_transform(layer);
441                         frames.push_back(frame);
442                 }
443
444                 return draw_frame(frames);
445         }
446
447         void on_interaction(const interaction_event::ptr& event)
448         {
449                 aggregator_.translate_and_send(event);
450         }
451
452         bool collides(double x, double y) const
453         {
454                 m_x_ = static_cast<int64_t>(x * pixel_constraints_.width.get());
455                 m_y_ = static_cast<int64_t>(y * pixel_constraints_.height.get());
456
457                 return static_cast<bool>((collission_detect(x, y)));
458         }
459
460         boost::optional<interaction_target> collission_detect(double x, double y) const
461         {
462                 for (auto& layer : layers_ | boost::adaptors::reversed)
463                 {
464                         if (layer.hidden.get())
465                                 continue;
466
467                         auto transform = get_transform(layer);
468                         auto translated = translate(x, y, transform);
469
470                         if (translated.first >= 0.0
471                                 && translated.first <= 1.0
472                                 && translated.second >= 0.0
473                                 && translated.second <= 1.0
474                                 && layer.producer.get()->collides(translated.first, translated.second))
475                         {
476                                 return std::make_pair(transform, static_cast<interaction_sink*>(layer.producer.get().get()));
477                         }
478                 }
479
480                 return boost::optional<interaction_target>();
481         }
482
483         std::future<std::wstring> call(const std::vector<std::wstring>& params)
484         {
485                 if (!params.empty() && boost::ends_with(params.at(0), L"()"))
486                         return make_ready_future(handle_call(params));
487                 else
488                         return make_ready_future(handle_variable_set(params));
489         }
490
491         std::wstring handle_variable_set(const std::vector<std::wstring>& params)
492         {
493                 for (int i = 0; i + 1 < params.size(); i += 2)
494                 {
495                         auto found = variables_.find(boost::to_lower_copy(params.at(i)));
496
497                         if (found != variables_.end() && found->second->is_public())
498                                 found->second->from_string(params.at(i + 1));
499                 }
500
501                 return L"";
502         }
503
504         std::wstring handle_call(const std::vector<std::wstring>& params)
505         {
506                 auto call = params.at(0);
507
508                 if (call == L"play()")
509                         go_to_marker(params.at(1), -1);
510                 else if (call == L"remove()")
511                         remove();
512                 else if (call == L"next()")
513                         next();
514                 else
515                         CASPAR_THROW_EXCEPTION(user_error() << msg_info(L"Unknown call " + call));
516
517                 return L"";
518         }
519
520         void remove()
521         {
522                 removed_ = true;
523                 layers_.clear();
524         }
525
526         void next()
527         {
528                 auto marker = find_first_start(timeline_frame_number_.get() + 1);
529
530                 if (marker)
531                 {
532                         timeline_frame_number_.set(marker->first - 1);
533                         frame_fraction_ = 0.0;
534                         paused_ = false;
535                         going_to_mark_ = true;
536                 }
537                 else
538                 {
539                         remove();
540                 }
541         }
542
543         void go_to_marker(const std::wstring& marker_name, int64_t offset)
544         {
545                 for (auto& marker : markers_by_frame_)
546                 {
547                         if (marker.second.label_argument == marker_name && marker.second.action == mark_action::start)
548                         {
549                                 timeline_frame_number_.set(marker.first + offset);
550                                 frame_fraction_ = 0.0;
551                                 paused_ = false;
552                                 going_to_mark_ = true;
553
554                                 return;
555                         }
556                 }
557
558                 if (marker_name == L"intro")
559                 {
560                         timeline_frame_number_.set(offset);
561                         frame_fraction_ = 0.0;
562                         paused_ = false;
563                         going_to_mark_ = true;
564                 }
565                 else if (marker_name == L"outro")
566                 {
567                         remove();
568                 }
569                 else
570                         CASPAR_LOG(info) << print() << L" no marker called " << marker_name << " found";
571         }
572
573         std::wstring print() const
574         {
575                 return L"scene[type=" + name() + L" template=" + template_name_ + L"]";
576         }
577
578         std::wstring name() const
579         {
580                 return producer_name_;
581         }
582
583         boost::property_tree::wptree info() const
584         {
585                 boost::property_tree::wptree info;
586                 info.add(L"type", L"scene");
587                 info.add(L"producer-name", name());
588                 info.add(L"template-name", template_name_);
589                 info.add(L"frame-number", frame_number_.get());
590                 info.add(L"timeline-frame-number", timeline_frame_number_.get());
591
592                 for (auto& var : variables_)
593                 {
594                         boost::property_tree::wptree variable_info;
595
596                         variable_info.add(L"name", var.first);
597                         variable_info.add(L"public", var.second->is_public());
598                         variable_info.add(L"value", var.second->to_string());
599
600                         info.add_child(L"variables.variable", variable_info);
601                 }
602
603                 for (auto& layer : layers_)
604                 {
605                         boost::property_tree::wptree layer_info;
606
607                         layer_info.add(L"name", layer.name.get());
608                         layer_info.add_child(L"producer", layer.producer.get()->info());
609                         layer_info.add(L"x", layer.position.x.get());
610                         layer_info.add(L"y", layer.position.y.get());
611                         layer_info.add(L"width", layer.producer.get()->pixel_constraints().width.get());
612                         layer_info.add(L"height", layer.producer.get()->pixel_constraints().height.get());
613
614                         info.add_child(L"layers.layer", layer_info);
615                 }
616
617                 return info;
618         }
619
620         monitor::subject& monitor_output()
621         {
622                 return monitor_subject_;
623         }
624 };
625
626 scene_producer::scene_producer(std::wstring producer_name, std::wstring template_name, int width, int height, const video_format_desc& format_desc)
627         : impl_(new impl(std::move(producer_name), std::move(template_name), width, height, format_desc))
628 {
629 }
630
631 scene_producer::~scene_producer()
632 {
633 }
634
635 layer& scene_producer::create_layer(
636                 const spl::shared_ptr<frame_producer>& producer, int x, int y, const std::wstring& name)
637 {
638         return impl_->create_layer(producer, x, y, name);
639 }
640
641 layer& scene_producer::create_layer(
642                 const spl::shared_ptr<frame_producer>& producer, const std::wstring& name)
643 {
644         return impl_->create_layer(producer, 0, 0, name);
645 }
646
647 void scene_producer::reverse_layers()
648 {
649         impl_->reverse_layers();
650 }
651
652 layer& scene_producer::get_layer(const std::wstring& name)
653 {
654         return impl_->get_layer(name);
655 }
656
657 binding<int64_t> scene_producer::timeline_frame()
658 {
659         return impl_->timeline_frame();
660 }
661
662 draw_frame scene_producer::receive_impl()
663 {
664         return impl_->render_frame();
665 }
666
667 constraints& scene_producer::pixel_constraints() { return impl_->pixel_constraints_; }
668
669 void scene_producer::on_interaction(const interaction_event::ptr& event)
670 {
671         impl_->on_interaction(event);
672 }
673
674 bool scene_producer::collides(double x, double y) const
675 {
676         return impl_->collides(x, y);
677 }
678
679 std::wstring scene_producer::print() const
680 {
681         return impl_->print();
682 }
683
684 std::wstring scene_producer::name() const
685 {
686         return impl_->name();
687 }
688
689 boost::property_tree::wptree scene_producer::info() const
690 {
691         return impl_->info();
692 }
693
694 std::future<std::wstring> scene_producer::call(const std::vector<std::wstring>& params)
695 {
696         return impl_->call(params);
697 }
698
699 monitor::subject& scene_producer::monitor_output()
700 {
701         return impl_->monitor_output();
702 }
703
704 void scene_producer::store_keyframe(void* timeline_identity, const keyframe& k)
705 {
706         impl_->store_keyframe(timeline_identity, k);
707 }
708
709 void scene_producer::store_variable(
710                 const std::wstring& name, const std::shared_ptr<core::variable>& var)
711 {
712         impl_->store_variable(name, var);
713 }
714
715 void scene_producer::add_mark(int64_t frame, mark_action action, const std::wstring& label)
716 {
717         impl_->add_mark(frame, action, label);
718 }
719
720 void scene_producer::add_task(binding<bool> when, std::function<void ()> task)
721 {
722         impl_->add_task(std::move(when), std::move(task));
723 }
724
725 core::variable& scene_producer::get_variable(const std::wstring& name)
726 {
727         return impl_->get_variable(name);
728 }
729
730 const std::vector<std::wstring>& scene_producer::get_variables() const
731 {
732         return impl_->get_variables();
733 }
734
735 }}}