return it->second;\r
}\r
\r
- void apply_transforms(const std::vector<std::tuple<int, stage::transform_func_t, unsigned int, tweener>>& transforms)\r
+ boost::unique_future<void> apply_transforms(const std::vector<std::tuple<int, stage::transform_func_t, unsigned int, tweener>>& transforms)\r
{\r
- executor_.begin_invoke([=]\r
+ return executor_.begin_invoke([=]\r
{\r
BOOST_FOREACH(auto& transform, transforms)\r
{\r
}, task_priority::high_priority);\r
}\r
\r
- void apply_transform(int index, const stage::transform_func_t& transform, unsigned int mix_duration, const tweener& tween)\r
+ boost::unique_future<void> apply_transform(int index, const stage::transform_func_t& transform, unsigned int mix_duration, const tweener& tween)\r
{\r
- executor_.begin_invoke([=]\r
+ return executor_.begin_invoke([=]\r
{\r
auto src = tweens_[index].fetch();\r
auto dst = transform(src);\r
}, task_priority::high_priority);\r
}\r
\r
- void clear_transforms(int index)\r
+ boost::unique_future<void> clear_transforms(int index)\r
{\r
- executor_.begin_invoke([=]\r
+ return executor_.begin_invoke([=]\r
{\r
tweens_.erase(index);\r
}, task_priority::high_priority);\r
}\r
\r
- void clear_transforms()\r
+ boost::unique_future<void> clear_transforms()\r
{\r
- executor_.begin_invoke([=]\r
+ return executor_.begin_invoke([=]\r
{\r
tweens_.clear();\r
}, task_priority::high_priority);\r
}\r
\r
- void load(int index, const spl::shared_ptr<frame_producer>& producer, bool preview, const boost::optional<int32_t>& auto_play_delta)\r
+ boost::unique_future<void> load(int index, const spl::shared_ptr<frame_producer>& producer, bool preview, const boost::optional<int32_t>& auto_play_delta)\r
{\r
- executor_.begin_invoke([=]\r
+ return executor_.begin_invoke([=]\r
{\r
get_layer(index).load(producer, preview, auto_play_delta); \r
}, task_priority::high_priority);\r
}\r
\r
- void pause(int index)\r
+ boost::unique_future<void> pause(int index)\r
{ \r
- executor_.begin_invoke([=]\r
+ return executor_.begin_invoke([=]\r
{\r
layers_[index].pause();\r
}, task_priority::high_priority);\r
}\r
\r
- void play(int index)\r
+ boost::unique_future<void> play(int index)\r
{ \r
- executor_.begin_invoke([=]\r
+ return executor_.begin_invoke([=]\r
{\r
layers_[index].play();\r
}, task_priority::high_priority);\r
}\r
\r
- void stop(int index)\r
+ boost::unique_future<void> stop(int index)\r
{ \r
- executor_.begin_invoke([=]\r
+ return executor_.begin_invoke([=]\r
{\r
layers_[index].stop();\r
}, task_priority::high_priority);\r
}\r
\r
- void clear(int index)\r
+ boost::unique_future<void> clear(int index)\r
{\r
- executor_.begin_invoke([=]\r
+ return executor_.begin_invoke([=]\r
{\r
layers_.erase(index);\r
}, task_priority::high_priority);\r
}\r
\r
- void clear()\r
+ boost::unique_future<void> clear()\r
{\r
- executor_.begin_invoke([=]\r
+ return executor_.begin_invoke([=]\r
{\r
layers_.clear();\r
}, task_priority::high_priority);\r
} \r
\r
- void swap_layers(stage& other)\r
+ boost::unique_future<void> swap_layers(stage& other)\r
{\r
auto other_impl = other.impl_;\r
\r
if(other_impl.get() == this)\r
- return;\r
+ return async(launch::deferred, []{});\r
\r
auto func = [=]\r
{\r
BOOST_FOREACH(auto& layer, other_layers)\r
layer.subscribe(event_subject_);\r
}; \r
- executor_.begin_invoke([=]\r
+\r
+ return executor_.begin_invoke([=]\r
{\r
other_impl->executor_.invoke(func, task_priority::high_priority);\r
}, task_priority::high_priority);\r
}\r
\r
- void swap_layer(int index, int other_index)\r
+ boost::unique_future<void> swap_layer(int index, int other_index)\r
{\r
- executor_.begin_invoke([=]\r
+ return executor_.begin_invoke([=]\r
{\r
std::swap(layers_[index], layers_[other_index]);\r
}, task_priority::high_priority);\r
}\r
\r
- void swap_layer(int index, int other_index, stage& other)\r
+ boost::unique_future<void> swap_layer(int index, int other_index, stage& other)\r
{\r
auto other_impl = other.impl_;\r
\r
if(other_impl.get() == this)\r
- swap_layer(index, other_index);\r
+ return swap_layer(index, other_index);\r
else\r
{\r
auto func = [=]\r
my_layer.subscribe(event_subject_);\r
other_layer.subscribe(other_impl->event_subject_);\r
}; \r
- executor_.begin_invoke([=]\r
+\r
+ return executor_.begin_invoke([=]\r
{\r
other_impl->executor_.invoke(func, task_priority::high_priority);\r
}, task_priority::high_priority);\r
\r
stage::stage(spl::shared_ptr<diagnostics::graph> graph) : impl_(new impl(std::move(graph))){}\r
boost::unique_future<std::wstring> stage::call(int index, const std::wstring& params){return impl_->call(index, params);}\r
-void stage::apply_transforms(const std::vector<stage::transform_tuple_t>& transforms){impl_->apply_transforms(transforms);}\r
-void stage::apply_transform(int index, const std::function<core::frame_transform(core::frame_transform)>& transform, unsigned int mix_duration, const tweener& tween){impl_->apply_transform(index, transform, mix_duration, tween);}\r
-void stage::clear_transforms(int index){impl_->clear_transforms(index);}\r
-void stage::clear_transforms(){impl_->clear_transforms();}\r
-void stage::load(int index, const spl::shared_ptr<frame_producer>& producer, bool preview, const boost::optional<int32_t>& auto_play_delta){impl_->load(index, producer, preview, auto_play_delta);}\r
-void stage::pause(int index){impl_->pause(index);}\r
-void stage::play(int index){impl_->play(index);}\r
-void stage::stop(int index){impl_->stop(index);}\r
-void stage::clear(int index){impl_->clear(index);}\r
-void stage::clear(){impl_->clear();}\r
-void stage::swap_layers(stage& other){impl_->swap_layers(other);}\r
-void stage::swap_layer(int index, int other_index){impl_->swap_layer(index, other_index);}\r
-void stage::swap_layer(int index, int other_index, stage& other){impl_->swap_layer(index, other_index, other);}\r
+boost::unique_future<void> stage::apply_transforms(const std::vector<stage::transform_tuple_t>& transforms){return impl_->apply_transforms(transforms);}\r
+boost::unique_future<void> stage::apply_transform(int index, const std::function<core::frame_transform(core::frame_transform)>& transform, unsigned int mix_duration, const tweener& tween){return impl_->apply_transform(index, transform, mix_duration, tween);}\r
+boost::unique_future<void> stage::clear_transforms(int index){return impl_->clear_transforms(index);}\r
+boost::unique_future<void> stage::clear_transforms(){return impl_->clear_transforms();}\r
+boost::unique_future<void> stage::load(int index, const spl::shared_ptr<frame_producer>& producer, bool preview, const boost::optional<int32_t>& auto_play_delta){return impl_->load(index, producer, preview, auto_play_delta);}\r
+boost::unique_future<void> stage::pause(int index){return impl_->pause(index);}\r
+boost::unique_future<void> stage::play(int index){return impl_->play(index);}\r
+boost::unique_future<void> stage::stop(int index){return impl_->stop(index);}\r
+boost::unique_future<void> stage::clear(int index){return impl_->clear(index);}\r
+boost::unique_future<void> stage::clear(){return impl_->clear();}\r
+boost::unique_future<void> stage::swap_layers(stage& other){return impl_->swap_layers(other);}\r
+boost::unique_future<void> stage::swap_layer(int index, int other_index){return impl_->swap_layer(index, other_index);}\r
+boost::unique_future<void> stage::swap_layer(int index, int other_index, stage& other){return impl_->swap_layer(index, other_index, other);}\r
boost::unique_future<spl::shared_ptr<frame_producer>> stage::foreground(int index) {return impl_->foreground(index);}\r
boost::unique_future<spl::shared_ptr<frame_producer>> stage::background(int index) {return impl_->background(index);}\r
boost::unique_future<boost::property_tree::wptree> stage::info() const{return impl_->info();}\r
\r
std::map<int, class draw_frame> operator()(const struct video_format_desc& format_desc);\r
\r
- void apply_transforms(const std::vector<transform_tuple_t>& transforms);\r
- void apply_transform(int index, const transform_func_t& transform, unsigned int mix_duration = 0, const tweener& tween = L"linear");\r
- void clear_transforms(int index);\r
- void clear_transforms();\r
- \r
- void load(int index, const spl::shared_ptr<class frame_producer>& producer, bool preview = false, const boost::optional<int32_t>& auto_play_delta = nullptr);\r
- void pause(int index);\r
- void play(int index);\r
- void stop(int index);\r
- void clear(int index);\r
- void clear(); \r
- void swap_layers(stage& other);\r
- void swap_layer(int index, int other_index);\r
- void swap_layer(int index, int other_index, stage& other);\r
- \r
- boost::unique_future<std::wstring> call(int index, const std::wstring& params);\r
+ boost::unique_future<void> apply_transforms(const std::vector<transform_tuple_t>& transforms);\r
+ boost::unique_future<void> apply_transform(int index, const transform_func_t& transform, unsigned int mix_duration = 0, const tweener& tween = L"linear");\r
+ boost::unique_future<void> clear_transforms(int index);\r
+ boost::unique_future<void> clear_transforms(); \r
+ boost::unique_future<void> load(int index, const spl::shared_ptr<class frame_producer>& producer, bool preview = false, const boost::optional<int32_t>& auto_play_delta = nullptr);\r
+ boost::unique_future<void> pause(int index);\r
+ boost::unique_future<void> play(int index);\r
+ boost::unique_future<void> stop(int index);\r
+ boost::unique_future<std::wstring> call(int index, const std::wstring& params);\r
+ boost::unique_future<void> clear(int index);\r
+ boost::unique_future<void> clear(); \r
+ boost::unique_future<void> swap_layers(stage& other);\r
+ boost::unique_future<void> swap_layer(int index, int other_index);\r
+ boost::unique_future<void> swap_layer(int index, int other_index, stage& other); \r
\r
// monitor::observable\r
\r