detect missing transitions, dont draw transitions if show off, obey audio transition...
authorGood Guy <[email protected]>
Sat, 3 Oct 2020 00:44:26 +0000 (18:44 -0600)
committerGood Guy <[email protected]>
Sat, 3 Oct 2020 00:44:26 +0000 (18:44 -0600)
cinelerra-5.1/cinelerra/amodule.C
cinelerra-5.1/cinelerra/module.C
cinelerra-5.1/cinelerra/trackcanvas.C
cinelerra-5.1/cinelerra/vmodule.C

index 5de58f4e3a49d21e45ea620fe0fed9e84204cf40..d8fb4396437ecea793686c20b5d55539880bdfd6 100644 (file)
@@ -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)
index c6990275851b087474cc839214c18ce7cd144dec..68d2785d5826dbbd8a1cc7e26dfb24c3b06c1564 100644 (file)
@@ -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());
+                       }
                }
        }
 }
index c0fea44a35d82970fa662baf7f558a5e07a00a24..098090a693c4d419f0ebfbf17b26ebd76fef2981 100644 (file)
@@ -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;
index 0829999f6435da42094053d5e38df4f361e9e7a7..ce7ecadc59529194233ade5524569f8218d4ab90 100644 (file)
@@ -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