3 #include "overlayframe.h"
8 #define _(String) gettext(String)
9 #define gettext_noop(String) String
10 #define N_(String) gettext_noop (String)
14 REGISTER_PLUGIN(CrossfadeMain)
19 CrossfadeMain::CrossfadeMain(PluginServer *server)
20 : PluginAClient(server)
24 CrossfadeMain::~CrossfadeMain()
28 char* CrossfadeMain::plugin_title() { return _("Crossfade"); }
29 int CrossfadeMain::is_transition() { return 1; }
30 int CrossfadeMain::uses_gui() { return 0; }
32 NEW_PICON_MACRO(CrossfadeMain)
35 int CrossfadeMain::process_realtime(int64_t size,
39 double intercept = (double)PluginClient::get_source_position() /
40 PluginClient::get_total_len();
41 double slope = (double)1 / PluginClient::get_total_len();
43 for(int i = 0; i < size; i++)
45 incoming[i] = outgoing[i] * ((double)1 - (slope * i + intercept)) +
46 incoming[i] * (slope * i + intercept);