4 #include "overlayframe.h"
11 REGISTER_PLUGIN(CrossfadeMain)
16 CrossfadeMain::CrossfadeMain(PluginServer *server)
17 : PluginAClient(server)
21 CrossfadeMain::~CrossfadeMain()
25 char* CrossfadeMain::plugin_title() { return N_("Crossfade"); }
26 int CrossfadeMain::is_transition() { return 1; }
27 int CrossfadeMain::uses_gui() { return 0; }
29 NEW_PICON_MACRO(CrossfadeMain)
32 int CrossfadeMain::process_realtime(int64_t size,
36 double intercept = (double)PluginClient::get_source_position() /
37 PluginClient::get_total_len();
38 double slope = (double)1 / PluginClient::get_total_len();
40 //printf("CrossfadeMain::process_realtime %f %f\n", intercept, slope);
41 for(int i = 0; i < size; i++)
43 incoming[i] = outgoing[i] * ((double)1 - (slope * i + intercept)) +
44 incoming[i] * (slope * i + intercept);