if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference());
- plugin_guis = new ArrayList<PluginServer*>;
+ plugin_guis = new PluginGUIs(this);
dead_plugins = new ArrayList<PluginServer*>;
keyframe_threads = new ArrayList<KeyFrameThread*>;
}
-
-
-
void MWindow::show_plugin(Plugin *plugin)
{
int done = 0;
}
if(!got_it) plugin->show = 0;
-
plugin = (Plugin*)plugin->next;
}
}
int MWindow::plugin_gui_open(Plugin *plugin)
{
- int result = 0;
+ int gui_id = plugin->gui_id;
+ if( gui_id < 0 ) return 0;
plugin_gui_lock->lock("MWindow::plugin_gui_open");
- for(int i = 0; i < plugin_guis->total; i++)
- {
- if(plugin_guis->get(i)->plugin->identical_location(plugin))
- {
- result = 1;
- break;
- }
- }
+ PluginServer *plugin_server = plugin_guis->gui_server(gui_id);
+ int result = plugin_server ? 1 : 0;
plugin_gui_lock->unlock();
return result;
}
void MWindow::render_plugin_gui(void *data, Plugin *plugin)
{
+ int gui_id = plugin->gui_id;
+ if( gui_id < 0 ) return;
plugin_gui_lock->lock("MWindow::render_plugin_gui");
- for(int i = 0; i < plugin_guis->total; i++)
- {
- if(plugin_guis->get(i)->plugin->identical_location(plugin))
- {
- plugin_guis->get(i)->render_gui(data);
- break;
- }
- }
+ PluginServer *plugin_server = plugin_guis->gui_server(gui_id);
+ if( plugin_server )
+ plugin_server->render_gui(data);
plugin_gui_lock->unlock();
}
void MWindow::render_plugin_gui(void *data, int size, Plugin *plugin)
{
+ int gui_id = plugin->gui_id;
+ if( gui_id < 0 ) return;
plugin_gui_lock->lock("MWindow::render_plugin_gui");
- for(int i = 0; i < plugin_guis->total; i++)
- {
- if(plugin_guis->get(i)->plugin->identical_location(plugin))
- {
- plugin_guis->get(i)->render_gui(data, size);
- break;
- }
- }
+ PluginServer *plugin_server = plugin_guis->gui_server(gui_id);
+ if( plugin_server )
+ plugin_server->render_gui(data, size);
plugin_gui_lock->unlock();
}
static ArrayList<PluginServer*> *plugindb;
// Currently visible plugins
int64_t plugin_visibility;
- ArrayList<PluginServer*> *plugin_guis;
+ PluginGUIs *plugin_guis;
// GUI Plugins to delete
ArrayList<PluginServer*> *dead_plugins;
// Keyframe editors
out = 1;
show = 0;
on = 1;
+ gui_id = -1;
keyframes = new KeyFrames(edl, track);
keyframes->create_objects();
}
out = 1;
show = 0;
on = 1;
+ gui_id = -1;
keyframes = new KeyFrames(edl, track);
keyframes->create_objects();
}
this->out = plugin->out;
this->show = plugin->show;
this->on = plugin->on;
+ this->gui_id = plugin->gui_id;
// Should reconfigure this based on where the first track is now.
this->shared_location = plugin->shared_location;
strcpy(this->title, plugin->title);
((KeyFrame*)that->keyframes->default_auto)));
}
-int Plugin::identical_location(Plugin *that)
-{
- if(!plugin_set || !plugin_set->track) return 0;
- if(!that->plugin_set || !that->plugin_set->track) return 0;
-
- if(plugin_set->track->number_of() == that->plugin_set->track->number_of() &&
- plugin_set->get_number() == that->plugin_set->get_number() &&
- startproject == that->startproject) return 1;
-
- return 0;
-
-}
-
int Plugin::keyframe_exists(KeyFrame *ptr)
{
for(KeyFrame *current = (KeyFrame*)keyframes->first;
void Plugin::dump(FILE *fp)
{
- fprintf(fp," PLUGIN: type=%d title=\"%s\" on=%d track=%d plugin=%d\n",
- plugin_type, title, on, shared_location.module, shared_location.plugin);
+ fprintf(fp," PLUGIN: type=%d title=\"%s\" on=%d track=%d plugin=%d gui_id=%d\n",
+ plugin_type, title, on, shared_location.module, shared_location.plugin, gui_id);
fprintf(fp," startproject %jd length %jd\n", startproject, length);
keyframes->dump(fp);
// Called by == operators, Edit::equivalent output
// to test title and keyframe of transition.
virtual int identical(Plugin *that);
-// Called by render_gui. Only need the track, position, and pluginset
-// to determine a corresponding GUI.
- int identical_location(Plugin *that);
virtual void synchronize_params(Edit *edit);
// Used by Edits::insert_edits and Plugin::shift to shift plugin keyframes
void shift_keyframes(int64_t position);
int plugin_type;
// In and out aren't used anymore.
int in, out;
- int show, on;
+ int show, on, gui_id;
PluginSet *plugin_set;
// Data for the plugin is stored here. Default keyframe always exists.
modules = new ArrayList<Module*>;
nodes = new ArrayList<VirtualNode*>;
tip = 0;
+ gui_id = -1;
}
PluginServer::PluginServer()
}
+PluginGUIs::PluginGUIs(MWindow *mwindow)
+{
+ this->mwindow = mwindow;
+ this->next_id = 0;
+}
+PluginGUIs::~PluginGUIs()
+{
+}
+
+void PluginGUIs::append(PluginServer *server)
+{
+ server->gui_id = next_id++;
+ ArrayList<PluginServer*>::append(server);
+}
+
+PluginServer *PluginGUIs::gui_server(int gui_id)
+{
+ for( int i=0; i<size(); ++i ) {
+ PluginServer *plugin_server = get(i);
+ if( plugin_server->gui_id == gui_id )
+ return plugin_server;
+ }
+ return 0;
+}
+
+
void PluginServer::send_render_gui(void *data)
{
//printf("PluginServer::send_render_gui 1 %p\n", attachmentpoint);
void PluginServer::show_gui()
{
if(!plugin_open) return;
- if(plugin) client->total_len = plugin->length;
- if(plugin) client->source_start = plugin->startproject;
+ if( plugin ) {
+ plugin->gui_id = gui_id;
+ client->total_len = plugin->length;
+ client->source_start = plugin->startproject;
+ }
if(video)
{
client->source_position = Units::to_int64(
void PluginServer::hide_gui()
{
if(!plugin_open) return;
+ if( plugin ) plugin->gui_id = -1;
if(client->defaults) client->save_defaults();
client->hide_gui();
}
~PluginObj() { if( dlobj ) unload(dlobj); }
};
+class PluginGUIs : public ArrayList<PluginServer*>
+{
+ int next_id;
+ MWindow *mwindow;
+public:
+ PluginGUIs(MWindow *mwindow);
+ ~PluginGUIs();
+
+ void append(PluginServer *server);
+ PluginServer *gui_server(int gui_id);
+};
+
class PluginServer
{
PluginObj *plugin_obj;
EDL *edl;
Preferences *preferences;
MenuEffectPrompt *prompt;
- int gui_on;
+ int gui_on, gui_id;
VFrame *temp_frame;
#define PLUGINSERVER_INC
class PluginObj;
+class PluginGUIs;
class PluginServer;
#define PLUGIN_FFMPEG_ID 0
mov huffyuv
#probesize=100M
#thread_queue_size=512
-#pix_fmt=bgra
pixel_format=bgra
jobs:=-j$(shell echo $$(($(cpus) + $(cpus)/2 +2)))
#opencv4 breaks SIFT/SURF findobj
-#CFLAGS += -I$(opencv_prefix)/include/opencv4
+CFLAGS += -I$(opencv_prefix)/include/opencv4
CFLAGS += -I$(opencv_prefix)/include
ifeq ($(src),git)
LFLAGS += -Wl,--start-group
LFLAGS += $(shell find $(opencv_prefix)/lib* -name "libopencv_*.a" 2> /dev/null)
#opencv4 breaks SIFT/SURF findobj
-#LFLAGS += $(shell find $(opencv_prefix)/lib64/opencv4/3rdparty/lib* -name "lib*.a" 2> /dev/null)
+LFLAGS += $(shell find $(opencv_prefix)/lib64/opencv4/3rdparty/lib* -name "lib*.a" 2> /dev/null)
LFLAGS += $(shell find $(opencv_prefix)/share/OpenCV/3rdparty/lib* -name "lib*.a" 2> /dev/null)
LFLAGS += -Wl,--end-group
else ifeq ($(bld),dyn)
-DOPENCV_EXTRA_MODULES_PATH="$(opencv)_contrib/modules/"
SYSLIB := $(lastword $(wildcard /usr/lib /usrlib32 /usr/lib64))
-CVLIBS := $(dir (shell find $(opencv_prefix) -name libopencv_core.a))
+CVLIBS := $(dir $(shell find $(opencv_prefix) -name libopencv_core.so))
LFLAGS += -L$(CVLIBS) $(patsubst $(CVLIBS)/lib%.so,-l%,$(wildcard $(CVLIBS)/libopencv_*.so))
LFLAGS += $(patsubst $(SYSLIB)/lib%.so,-l%,$(wildcard $(SYSLIB)/lib{Half,Imath,Ilm,Iex}*.so))
static_libs :=
LFLAGS += $(patsubst $(SYSLIB)/lib%.so,-l%,$(wildcard $(SYSLIB)/lib{Half,Imath,Ilm,Iex}*.so))
static_libs :=
static_incs :=
+CFLAGS += -I/usr/include/opencv4
else
$(error bld not sta/dyn/sys)
endif