#include <common/concurrency/executor.h>\r
\r
#include <boost/timer.hpp>\r
+#include <boost/range/algorithm.hpp>\r
\r
#include <tbb/parallel_for.h>\r
\r
std::map<int, safe_ptr<basic_frame>> frames;\r
\r
// Allocate placeholders.\r
- std::for_each(layers_.begin(), layers_.end(), [&](layer_t& layer)\r
- {\r
+ BOOST_FOREACH(auto layer, layers_)\r
frames[layer.first] = basic_frame::empty();\r
- });\r
\r
// Render layers\r
tbb::parallel_for_each(layers_.begin(), layers_.end(), [&](layer_t& layer)\r
std::transform(layers_.begin(), layers_.end(), inserter, sel_first);\r
std::transform(other.impl_->layers_.begin(), other.impl_->layers_.end(), inserter, sel_first);\r
\r
- std::for_each(indices.begin(), indices.end(), [&](int index)\r
- {\r
+ BOOST_FOREACH(auto index, indices)\r
layers_[index].swap(other.impl_->layers_[index]);\r
- }); \r
};\r
\r
channel_.execution.invoke([&]{other.impl_->channel_.execution.invoke(func);});\r
{ \r
background_ = producer;\r
\r
- if(preview) \r
- {\r
- // Play the first frame and pause.\r
+ if(preview) // Play the first frame and pause.\r
+ { \r
play();\r
receive();\r
pause();\r
\r
void stop()\r
{\r
- pause();\r
foreground_ = frame_producer::empty();\r
}\r
\r