From: Good Guy Date: Sat, 3 Oct 2020 00:44:26 +0000 (-0600) Subject: detect missing transitions, dont draw transitions if show off, obey audio transition... X-Git-Tag: 2020-10~11 X-Git-Url: https://cinelerra-gg.org/git/?a=commitdiff_plain;h=13a039ef755e81e65c9479b4b615fd89bfe3e038;p=goodguy%2Fcinelerra.git detect missing transitions, dont draw transitions if show off, obey audio transition on flag --- diff --git a/cinelerra-5.1/cinelerra/amodule.C b/cinelerra-5.1/cinelerra/amodule.C index 5de58f4e..d8fb4396 100644 --- a/cinelerra-5.1/cinelerra/amodule.C +++ b/cinelerra-5.1/cinelerra/amodule.C @@ -37,6 +37,7 @@ #include "filexml.h" #include "floatautos.h" #include "language.h" +#include "mainerror.h" #include "module.h" #include "patch.h" #include "plugin.h" @@ -502,7 +503,7 @@ if(debug) printf("AModule::render %d %jd\n", __LINE__, fragment_len); // Clamp to end of transition int64_t transition_len = 0; Plugin *transition = get_edl()->tracks->plugin_exists(transition_id); - if( transition && previous_edit ) { + if( transition && transition->on && previous_edit ) { transition_len = transition->length * sample_rate / edl_rate; if(direction == PLAY_FORWARD && start_position < edit_startproject + transition_len && @@ -534,7 +535,7 @@ if(debug) printf("AModule::render %d\n", __LINE__); // Read transition into temp and render - if(transition && previous_edit) + if(transition && transition->on && previous_edit) { int64_t previous_startproject = previous_edit->startproject * sample_rate / @@ -592,13 +593,13 @@ if(debug) printf("AModule::render %d %jd\n", __LINE__, fragment_len); { current_position = start_position - edit_startproject; } - - transition_server->process_transition( - transition_temp, - &output, - current_position, - transition_fragment_len, - transition->length); + if( transition_server ) { + transition_server->process_transition( + transition_temp, &output, current_position, + transition_fragment_len, transition->length); + } + else + eprintf("missing transition plugin: %s\n", transition->title); // Reverse output buffer here so transitions always render forward. if(direction == PLAY_REVERSE) diff --git a/cinelerra-5.1/cinelerra/module.C b/cinelerra-5.1/cinelerra/module.C index c6990275..68d2785d 100644 --- a/cinelerra-5.1/cinelerra/module.C +++ b/cinelerra-5.1/cinelerra/module.C @@ -309,30 +309,25 @@ void Module::update_transition(int64_t current_position, if(renderengine) { PluginServer *plugin_server = MWindow::scan_plugindb(transition->title, track->data_type); - transition_server = new PluginServer(*plugin_server); - transition_server->open_plugin(0, - get_preferences(), - get_edl(), - transition); - transition_server->init_realtime( - get_edl()->session->real_time_playback && - renderengine->command->realtime, - 1, - get_buffer_size()); + if( plugin_server ) { + transition_server = new PluginServer(*plugin_server); + transition_server->open_plugin(0, get_preferences(), get_edl(), + transition); + transition_server->init_realtime( + get_edl()->session->real_time_playback && + renderengine->command->realtime, 1, get_buffer_size()); + } } else if(plugin_array) { PluginServer *plugin_server = MWindow::scan_plugindb(transition->title, plugin_array->data_type); - transition_server = new PluginServer(*plugin_server); - transition_server->open_plugin(0, - get_preferences(), - get_edl(), - transition); - transition_server->init_realtime( - 0, - 1, - get_buffer_size()); + if( plugin_server ) { + transition_server = new PluginServer(*plugin_server); + transition_server->open_plugin(0, get_preferences(), get_edl(), + transition); + transition_server->init_realtime( 0, 1, get_buffer_size()); + } } } } diff --git a/cinelerra-5.1/cinelerra/trackcanvas.C b/cinelerra-5.1/cinelerra/trackcanvas.C index c0fea44a..098090a6 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.C +++ b/cinelerra-5.1/cinelerra/trackcanvas.C @@ -2051,6 +2051,7 @@ void TrackCanvas::draw_drag_handle() void TrackCanvas::draw_transitions() { int64_t x, y, w, h; + if( !mwindow->edl->session->auto_conf->transitions ) return; for(Track *track = mwindow->edl->tracks->first; track; track = track->next) { if( track->is_hidden() ) continue; diff --git a/cinelerra-5.1/cinelerra/vmodule.C b/cinelerra-5.1/cinelerra/vmodule.C index 0829999f..ce7ecadc 100644 --- a/cinelerra-5.1/cinelerra/vmodule.C +++ b/cinelerra-5.1/cinelerra/vmodule.C @@ -32,6 +32,7 @@ #include "file.h" #include "filexml.h" #include "floatautos.h" +#include "mainerror.h" #include "maskauto.h" #include "maskautos.h" #include "mwindow.h" @@ -280,8 +281,8 @@ int VModule::import_frame(VFrame *output, VEdit *current_edit, pos = Units::to_int64((double)input_position / frame_rate * edl_rate); if( renderengine->preferences->cache_transitions && !use_cache && // cache transitions, not caching and inside transition - vnext && vnext->transition && file->get_video_length() >= 0 && - pos >= vnext->startproject && + vnext && vnext->transition && vnext->transition->on && + file->get_video_length() >= 0 && pos >= vnext->startproject && pos < vnext->startproject + vnext->transition->length ) { file->set_cache_frames(0); file->set_layer(current_edit->channel); @@ -738,14 +739,18 @@ int VModule::render(VFrame *output, // (*transition_input), (*transition_input)->get_pbuffer(), // output, output->get_pbuffer()); + if( transition_server ) { // Execute plugin with transition_input and output here - if( renderengine ) - transition_server->set_use_opengl(use_opengl, renderengine->video); - transition_server->process_transition((*transition_input), output, - (direction == PLAY_FORWARD) ? - (start_position_project - current_edit->startproject) : - (start_position_project - current_edit->startproject - 1), - transition->length); + if( renderengine ) + transition_server->set_use_opengl(use_opengl, renderengine->video); + transition_server->process_transition((*transition_input), output, + (direction == PLAY_FORWARD) ? + (start_position_project - current_edit->startproject) : + (start_position_project - current_edit->startproject - 1), + transition->length); + } + else + eprintf("missing transition plugin: %s\n", transition->title); } else { // Load output buffer