]> git.sesse.net Git - casparcg/commitdiff
[scene] Added fps variable that is always accessible from scenes to be able to calcul...
authorHelge Norberg <helge.norberg@svt.se>
Tue, 21 Feb 2017 18:18:15 +0000 (19:18 +0100)
committerHelge Norberg <helge.norberg@svt.se>
Tue, 21 Feb 2017 18:18:15 +0000 (19:18 +0100)
core/producer/scene/scene_producer.cpp

index efcfa3516460e6f94b8149be1a0a8d44fc663b53..1d2538f946990f0f21f7627b1594f5defad0f47f 100644 (file)
@@ -161,6 +161,10 @@ struct scene_producer::impl
                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();