\r
gpu_frame_ptr get_frame()\r
{\r
- if(++current_frame_ >= info_.duration)\r
+ if(current_frame_++ >= info_.duration)\r
return nullptr;\r
\r
gpu_frame_ptr source;\r
auto composite = std::make_shared<gpu_composite_frame>();\r
if(src_frame)\r
composite->add(src_frame);\r
- else\r
- src_frame = std::make_shared<gpu_frame>(0, 0);\r
composite->add(dest_frame);\r
\r
- if(info_.type == transition_type::mix)\r
- dest_frame->alpha(alpha); \r
- else if(info_.type == transition_type::slide)\r
+ switch(info_.type)\r
{\r
+ case transition_type::mix: \r
+ dest_frame->alpha(alpha); \r
+ break;\r
+ case transition_type::slide: \r
if(info_.direction == transition_direction::from_left) \r
dest_frame->translate(-1.0+alpha, 0.0); \r
else if(info_.direction == transition_direction::from_right)\r
- dest_frame->translate(1.0-alpha, 0.0); \r
- }\r
- else if(info_.type == transition_type::push)\r
- {\r
+ dest_frame->translate(1.0-alpha, 0.0); \r
+ break;\r
+ case transition_type::push:\r
if(info_.direction == transition_direction::from_left) \r
{\r
dest_frame->translate(-1.0+alpha, 0.0);\r
- src_frame->translate(0.0+alpha, 0.0);\r
+ if(src_frame)\r
+ src_frame->translate(0.0+alpha, 0.0);\r
}\r
else if(info_.direction == transition_direction::from_right)\r
{\r
dest_frame->translate(1.0-alpha, 0.0);\r
- src_frame->translate(0.0-alpha, 0.0);\r
+ if(src_frame)\r
+ src_frame->translate(0.0-alpha, 0.0);\r
}\r
+ break;\r
+ }\r
+\r
+ if(info_.type == transition_type::mix)\r
+ dest_frame->alpha(alpha); \r
+ else if(info_.type == transition_type::slide)\r
+ { \r
+ }\r
+ else if(info_.type == transition_type::push)\r
+ {\r
}\r
else if(info_.type == transition_type::wipe)\r
{\r