libsndfile-devel libtheora-devel linux-firmware ivtv-firmware \
libvorbis-devel texinfo xz-devel lzma-devel cmake udftools git \
autoconf automake rpm-build jbigkit-devel libvdpau-devel libva-devel \
- alsa-lib-devel gtk2-devel pulseaudio-libs-devel
+ alsa-lib-devel gtk2-devel pulseaudio-libs-devel libtool
yasm=yasm-1.3.0-3.fc24.x86_64.rpm
release=http://archives.fedoraproject.org/pub/fedora/linux/releases/24
url=$release/Everything/x86_64/os/Packages/y/$yasm
ctags patch gcc-c++ perl-XML-XPath libtiff-devel python dvdauthor \
gettext-devel inkscape udftools autoconf automake numactl-devel \
jbigkit-devel libvdpau-devel libva-devel gtk2-devel mesa-vdpau-drivers \
- pulseaudio-libs-devel
+ pulseaudio-libs-devel libtool
;;
"suse" | "leap" | "tumbleweed")
zypper -n install nasm gcc gcc-c++ zlib-devel texinfo libpng16-devel \
ilmbase-devel fftw3-devel libsndfile-devel libtheora-devel flac-devel \
libtiff-devel inkscape cmake patch libnuma-devel lzma-devel udftools git \
yasm autoconf automake rpm-build libjbig-devel libvdpau-devel libva-devel \
- gtk2-devel libusb-1_0-devel libpulse-devel
+ gtk2-devel libusb-1_0-devel libpulse-devel libtool
if [ ! -f /usr/lib64/libtermcap.so ]; then
ln -s libtermcap.so.2 /usr/lib64/libtermcap.so
fi
libdc1394-22-dev libiec61883-dev libflac-dev libjbig-dev libusb-1.0-0-dev \
libvdpau-dev libva-dev libsndfile1-dev libtheora-dev cmake udftools \
libxml2-utils git inkscape autoconf automake debhelper libgtk2.0-dev \
- libpulse-dev
+ libpulse-dev libtool
;;
*)
echo "unknown os: $dir"
#include "theme.h"
#include "transition.h"
#include "transportque.h"
+#include "tracks.h"
#include <string.h>
// Clamp to end of transition
int64_t transition_len = 0;
-
- if(transition &&
- previous_edit)
- {
- transition_len = transition->length *
- sample_rate /
- edl_rate;
+ Plugin *transition = get_edl()->tracks->plugin_exists(transition_id);
+ if( transition && previous_edit ) {
+ transition_len = transition->length * sample_rate / edl_rate;
if(direction == PLAY_FORWARD &&
start_position < edit_startproject + transition_len &&
start_position + fragment_len > edit_startproject + transition_len)
{
reset_parameters();
this->plugin = plugin;
- this->plugin_id = plugin->id;
+ this->plugin_id = plugin->orig_id;
this->renderengine = renderengine;
this->data_type = data_type;
plugin_server = MWindow::scan_plugindb(plugin->title,
this->track = track;
if(track) this->edits = track->edits;
id = EDL::next_id();
+ orig_id = id;
}
Edit::Edit(EDL *edl, Edits *edits)
this->edits = edits;
if(edits) this->track = edits->track;
id = EDL::next_id();
+ orig_id = id;
}
Edit::~Edit()
void Edit::copy_from(Edit *edit)
{
+ this->orig_id = edit->orig_id;
this->nested_edl = edl->nested_edls.get_nested(edit->nested_edl);
this->asset = edl->assets->update(edit->asset);
this->startsource = edit->startsource;
int64_t length;
// Channel or layer of source
int channel;
-// ID for resource pixmaps
- int id;
+// ID for resource pixmaps, plugins
+ int id, orig_id;
// ID for selection groups
int group_id;
// User defined title for timeline
Plugin *new_plugin = dst_plugin_set->insert_plugin(plugin->title,
start, end-start, plugin->plugin_type, &plugin->shared_location,
(KeyFrame*)plugin->keyframes->default_auto, 0);
+ new_plugin->on = plugin->on;
KeyFrame *keyframe = (KeyFrame*)plugin->keyframes->first;
for( ; keyframe; keyframe=(KeyFrame*)keyframe->next ) {
int64_t keyframe_pos = pos + keyframe->position;
fmt_ctx->url);
return -1;
}
-
+ if( !strcmp(file_format, "image2") ) {
+ Asset *asset = file_base->asset;
+ const char *filename = asset->path;
+ FILE *fp = fopen(filename,"w");
+ if( !fp ) {
+ eprintf(_("Cant write image2 header file: %s\n %m"), filename);
+ return 1;
+ }
+ fprintf(fp, "IMAGE2\n");
+ fprintf(fp, "# Frame rate: %f\n", asset->frame_rate);
+ fprintf(fp, "# Width: %d\n", asset->width);
+ fprintf(fp, "# Height: %d\n", asset->height);
+ fclose(fp);
+ }
int prog_id = 1;
AVProgram *prog = av_new_program(fmt_ctx, prog_id);
for( int i=0; i< ffvideo.size(); ++i )
: BC_DialogThread()
{
this->mwindow = mwindow;
- plugin = 0;
+ plugin_id = -1;
keyframe = 0;
keyframe_data = new ArrayList<BC_ListBoxItem*>[KEYFRAME_COLUMNS];
plugin_title[0] = 0;
// Must lock main window to read keyframe
mwindow->gui->lock_window("KeyFrameThread::update_values");
- if( !plugin || !mwindow->edl->tracks->plugin_exists(plugin) ) {
+ Plugin *plugin = mwindow->edl->tracks->plugin_exists(plugin_id);
+ if( !plugin ) {
mwindow->gui->unlock_window();
return;
}
{
if( !BC_DialogThread::is_running() ) {
- if( !mwindow->edl->tracks->plugin_exists(plugin) ) return;
+ if( !mwindow->edl->tracks->plugin_exists(plugin->orig_id) ) return;
this->keyframe = keyframe;
- this->plugin = plugin;
+ this->plugin_id = plugin->orig_id;
this->preset_text[0] = 0;
plugin->calculate_title(plugin_title, 0);
sprintf(window_title, _("%s: %s Keyframe"), _(PROGRAM_NAME), plugin_title);
void KeyFrameThread::handle_close_event(int result)
{
- plugin = 0;
+ plugin_id = -1;
keyframe = 0;
}
mwindow->gui->lock_window("KeyFrameThread::save_preset");
// Test EDL for plugin existence
- if( !mwindow->edl->tracks->plugin_exists(plugin) ) {
+ Plugin *plugin = mwindow->edl->tracks->plugin_exists(plugin_id);
+ if( !plugin ) {
mwindow->gui->unlock_window();
get_gui()->lock_window("KeyFrameThread::save_preset 2");
return;
mwindow->gui->lock_window("KeyFrameThread::save_preset");
// Test EDL for plugin existence
- if( !mwindow->edl->tracks->plugin_exists(plugin) ) {
+ Plugin *plugin = mwindow->edl->tracks->plugin_exists(plugin_id);
+ if( !plugin ) {
mwindow->gui->unlock_window();
get_gui()->lock_window("KeyFrameThread::delete_preset 1");
return;
mwindow->gui->lock_window("KeyFrameThread::apply_preset");
// Test EDL for plugin existence
- if( !mwindow->edl->tracks->plugin_exists(plugin) ) {
+ Plugin *plugin = mwindow->edl->tracks->plugin_exists(plugin_id);
+ if( !plugin ) {
mwindow->gui->unlock_window();
get_gui()->lock_window("KeyFrameThread::apply_preset 1");
return;
get_gui()->unlock_window();
mwindow->gui->lock_window("KeyFrameThread::apply_value");
- if( plugin && mwindow->edl->tracks->plugin_exists(plugin) ) {
+ Plugin *plugin = mwindow->edl->tracks->plugin_exists(plugin_id);
+ if( plugin ) {
mwindow->undo->update_undo_before();
if( mwindow->session->keyframedialog_all ) {
// Search for all keyframes in selection but don't create a new one.
void close_window();
ArrayList<BC_ListBoxItem*> *keyframe_data;
- Plugin *plugin;
+ int plugin_id;
KeyFrame *keyframe;
MWindow *mwindow;
char window_title[BCTEXTLEN];
this->commonrender = commonrender;
this->plugin_array = plugin_array;
this->track = track;
- transition = 0;
+ transition_id = -1;
transition_server = 0;
attachments = 0;
total_attachments = 0;
void Module::update_transition(int64_t current_position,
int direction)
{
- transition = track->get_current_transition(current_position,
+ Plugin *transition = track->get_current_transition(current_position,
direction, 0, 0);
+ transition_id = transition ? transition->orig_id : -1;
// For situations where we had a transition but not anymore,
// keep the server open.
// If the current transition differs from the previous transition, delete the
// server.
if (transition && transition_server) {
- if (strcmp(transition->title, transition_server->plugin->title)) {
+ Plugin *plugin = transition->edl->tracks->plugin_exists(transition_server->plugin_id);
+ if (!plugin || strcmp(transition->title, plugin->title)) {
transition_server->close_plugin();
delete transition_server;
transition_server = 0;
}
else {
- transition_server->plugin = transition;
+ transition_server->plugin_id = transition_id;
}
}
// TRACK_AUDIO or TRACK_VIDEO
int data_type;
-// Pointer to transition in EDL
- Plugin *transition;
+// transition in EDL
+ int transition_id;
// PluginServer for transition
PluginServer *transition_server;
{
keyframe_gui_lock->lock("MWindow::show_keyframe_gui");
// Find existing thread
- for(int i = 0; i < keyframe_threads->size(); i++)
- {
- if(keyframe_threads->get(i)->plugin == plugin)
- {
+ for( int i=0; i<keyframe_threads->size(); ++i ) {
+ int plugin_id = keyframe_threads->get(i)->plugin_id;
+ if( plugin_id == plugin->orig_id ) {
keyframe_threads->get(i)->start_window(plugin, 0);
keyframe_gui_lock->unlock();
return;
}
// Find unused thread
- for(int i = 0; i < keyframe_threads->size(); i++)
- {
- if(!keyframe_threads->get(i)->plugin)
- {
+ for( int i=0; i<keyframe_threads->size(); ++i ) {
+ if( keyframe_threads->get(i)->plugin_id < 0 ) {
keyframe_threads->get(i)->start_window(plugin, 0);
keyframe_gui_lock->unlock();
return;
KeyFrameThread *thread = new KeyFrameThread(this);
keyframe_threads->append(thread);
thread->start_window(plugin, 0);
-
keyframe_gui_lock->unlock();
}
//printf("MWindow::show_plugin %d\n", __LINE__);
SET_TRACE
-
plugin_gui_lock->lock("MWindow::show_plugin");
- for(int i = 0; i < plugin_guis->total; i++)
- {
-// Pointer comparison
- if(plugin_guis->get(i)->plugin == plugin)
- {
- plugin_guis->get(i)->raise_window();
+ for( int i=0; i<plugin_guis->total; ++i ) {
+// Pointer/id comparison
+ PluginServer *plugin_gui = plugin_guis->get(i);
+ if( plugin_gui->plugin_id == plugin->orig_id ) {
+ plugin_gui->raise_window();
done = 1;
break;
}
void MWindow::hide_plugin(Plugin *plugin, int lock)
{
plugin->show = 0;
+ return hide_plugin(plugin->orig_id, lock);
+}
+
+void MWindow::hide_plugin(int plugin_id, int lock)
+{
// Update the toggle
gui->lock_window("MWindow::hide_plugin");
gui->update(0, NORMAL_DRAW, 0, 0, 0, 0, 0);
gui->unlock_window();
if(lock) plugin_gui_lock->lock("MWindow::hide_plugin");
- for(int i = 0; i < plugin_guis->total; i++)
- {
- if(plugin_guis->get(i)->plugin == plugin)
- {
- PluginServer *ptr = plugin_guis->get(i);
- plugin_guis->remove(ptr);
+ for( int i=0; i<plugin_guis->total; ++i ) {
+ PluginServer *plugin_gui = plugin_guis->get(i);
+ if( plugin_gui->plugin_id == plugin_id ) {
+ plugin_guis->remove(plugin_gui);
if(lock) plugin_gui_lock->unlock();
// Last command executed in client side close
// Schedule for deletion
- ptr->hide_gui();
- delete_plugin(ptr);
+ plugin_gui->hide_gui();
+ delete_plugin(plugin_gui);
//sleep(1);
return;
}
void MWindow::hide_keyframe_gui(Plugin *plugin)
{
keyframe_gui_lock->lock("MWindow::hide_keyframe_gui");
- for(int i = 0; i < keyframe_threads->size(); i++)
- {
- if(keyframe_threads->get(i)->plugin == plugin)
- {
- keyframe_threads->get(i)->close_window();
+ for( int i = 0; i < keyframe_threads->size(); i++) {
+ KeyFrameThread *keyframe_gui = keyframe_threads->get(i);
+ if( keyframe_gui->plugin_id == plugin->orig_id ) {
+ keyframe_gui->close_window();
break;
}
}
{
// Send new configuration to keyframe GUI's
keyframe_gui_lock->lock("MWindow::update_keyframe_guis");
- for(int i = 0; i < keyframe_threads->size(); i++)
- {
- KeyFrameThread *ptr = keyframe_threads->get(i);
- if(edl->tracks->plugin_exists(ptr->plugin))
- ptr->update_gui(1);
+ for( int i=0; i<keyframe_threads->size(); ++i ) {
+ KeyFrameThread *keyframe_gui = keyframe_threads->get(i);
+ Plugin *plugin = edl->tracks->plugin_exists(keyframe_gui->plugin_id);
+ if( plugin )
+ keyframe_gui->update_gui(1);
else
- {
- ptr->close_window();
- }
+ keyframe_gui->close_window();
}
keyframe_gui_lock->unlock();
}
// Send new configuration to plugin GUI's
plugin_gui_lock->lock("MWindow::update_plugin_guis");
- for(int i = 0; i < plugin_guis->size(); i++)
- {
- PluginServer *ptr = plugin_guis->get(i);
- if(edl->tracks->plugin_exists(ptr->plugin))
- ptr->update_gui();
- else
- {
-// Schedule for deletion if no plugin
- plugin_guis->remove_number(i);
- i--;
-
- ptr->hide_gui();
- delete_plugin(ptr);
+ for( int i=0; i<plugin_guis->size(); ++i ) {
+ PluginServer *plugin_gui = plugin_guis->get(i);
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_gui->plugin_id);
+ if( plugin && plugin->show )
+ plugin_gui->update_gui();
+ else {
+// Schedule for deletion if no plugin or not shown
+ plugin_guis->remove_number(i--);
+ plugin_gui->hide_gui();
+ delete_plugin(plugin_gui);
}
}
// Change plugin variable if not visible
Track *track = edl->tracks->first;
- while(track)
- {
- for(int i = 0; i < track->plugin_set.size(); i++)
- {
+ for( ; track; track=track->next ) {
+ for( int i=0; i < track->plugin_set.size(); ++i ) {
Plugin *plugin = (Plugin*)track->plugin_set[i]->first;
- while(plugin)
- {
+ for( ; plugin; plugin = (Plugin*)plugin->next ) {
int got_it = 0;
- for(int i = 0; i < plugin_guis->size(); i++)
- {
+ for( int i=0; i<plugin_guis->size(); ++i ) {
PluginServer *server = plugin_guis->get(i);
- if(server->plugin == plugin)
- {
+ if( server->plugin_id == plugin->orig_id ) {
got_it = 1;
break;
}
}
-
- if(!got_it) plugin->show = 0;
- plugin = (Plugin*)plugin->next;
+ if( !got_it ) plugin->show = 0;
}
}
-
- track = track->next;
}
plugin_gui_lock->unlock();
-
-
- if(do_keyframe_guis) update_keyframe_guis();
+ if( do_keyframe_guis )
+ update_keyframe_guis();
}
void MWindow::stop_plugin_guis()
plugin_gui_lock->lock("MWindow::stop_plugin_guis");
for( int i=0; i<plugin_guis->size(); ++i ) {
- PluginServer *ptr = plugin_guis->get(i);
- if( edl->tracks->plugin_exists(ptr->plugin) ) {
- ptr->render_stop();
- }
+ PluginServer *plugin_gui = plugin_guis->get(i);
+ plugin_gui->render_stop();
}
plugin_gui_lock->unlock();
}
void MWindow::update_plugin_states()
{
plugin_gui_lock->lock("MWindow::update_plugin_states");
- for(int i = 0; i < plugin_guis->total; i++)
- {
- int result = 0;
+ for( int i=0; i<plugin_guis->total; ++i ) {
// Get a plugin GUI
- Plugin *src_plugin = plugin_guis->get(i)->plugin;
PluginServer *src_plugingui = plugin_guis->get(i);
-
-// Search for plugin in EDL. Only the master EDL shows plugin GUIs.
- for(Track *track = edl->tracks->first;
- track && !result;
- track = track->next)
- {
- for(int j = 0;
- j < track->plugin_set.total && !result;
- j++)
- {
- PluginSet *plugin_set = track->plugin_set[j];
- for(Plugin *plugin = (Plugin*)plugin_set->first;
- plugin && !result;
- plugin = (Plugin*)plugin->next)
- {
- if(plugin == src_plugin &&
- !strcmp(plugin->title, src_plugingui->title)) result = 1;
- }
- }
- }
-
-
+ int plugin_id = src_plugingui->plugin_id;
+ Plugin *src_plugin = edl->tracks->plugin_exists(plugin_id);
// Doesn't exist anymore
- if(!result)
- {
- hide_plugin(src_plugin, 0);
- i--;
+ if( !src_plugin ) {
+ hide_plugin(plugin_id, 0);
+ --i;
}
}
plugin_gui_lock->unlock();
void MWindow::update_plugin_titles()
{
- for(int i = 0; i < plugin_guis->total; i++)
- {
+ for( int i=0; i<plugin_guis->total; ++i )
plugin_guis->get(i)->update_title();
- }
}
int MWindow::asset_to_edl(EDL *new_edl,
void load_backup();
void show_plugin(Plugin *plugin);
void hide_plugin(Plugin *plugin, int lock);
+ void hide_plugin(int plugin_id, int lock);
void hide_plugins();
void delete_plugin(PluginServer *plugin);
// Update plugins with configuration changes.
this->startsource = edit->startsource;
this->startproject = edit->startproject;
this->length = edit->length;
-
+ this->orig_id = edit->orig_id;
this->plugin_type = plugin->plugin_type;
this->in = plugin->in;
#include "preferences.h"
#include "renderengine.h"
#include "track.h"
+#include "tracks.h"
#include "transportque.h"
#include <stdio.h>
PluginClientThread::~PluginClientThread()
{
- join();
delete window;
delete init_complete;
}
window->lock_window("PluginClientThread::run");
//printf("PluginClientThread::run %p %d\n", this, __LINE__);
window->hide_window(1);
+ client->save_defaults_xml(); // needs window lock
window->unlock_window();
window->done_event(result);
-// Can't save defaults in the destructor because it's not called immediately
-// after closing.
- /* if(client->defaults) */ client->save_defaults_xml();
/* This is needed when the GUI is closed from itself */
if(result) client->client_side_close();
}
{
if(thread && thread->window)
{
-//printf("PluginClient::delete_thread %d\n", __LINE__);
-/* This is needed when the GUI is closed from elsewhere than itself */
-/* Since we now use autodelete, this is all that has to be done, thread will take care of itself ... */
-/* Thread join will wait if this was not called from the thread itself or go on if it was */
thread->window->lock_window("PluginClient::hide_gui");
thread->window->set_done(0);
-//printf("PluginClient::hide_gui %d thread->window=%p\n", __LINE__, thread->window);
thread->window->unlock_window();
}
}
const char *PluginClient::get_source_path()
{
- if( server->plugin ) return 0;
- int64_t source_position = server->plugin->startproject;
- Edit *edit = server->plugin->track->edits->editof(source_position,PLAY_FORWARD,0);
+ EDL *edl = get_edl();
+ Plugin *plugin = edl->tracks->plugin_exists(server->plugin_id);
+ int64_t source_position = plugin->startproject;
+ Edit *edit = plugin->track->edits->editof(source_position,PLAY_FORWARD,0);
Indexable *indexable = edit ? edit->get_source() : 0;
return indexable ? indexable->path : 0;
}
EDL *edl = get_edl();
projector_x += edl->session->output_w / 2;
projector_y += edl->session->output_h / 2;
- Track *track = server->plugin ? server->plugin->track : 0;
+ Plugin *plugin = edl->tracks->plugin_exists(server->plugin_id);
+ Track *track = plugin ? plugin->track : 0;
int track_w = track ? track->track_w : edl->session->output_w;
int track_h = track ? track->track_h : edl->session->output_h;
tx = (ox - projector_x) / projector_z + track_w / 2;
EDL *edl = get_edl();
projector_x += edl->session->output_w / 2;
projector_y += edl->session->output_h / 2;
- Track *track = server->plugin ? server->plugin->track : 0;
+ Plugin *plugin = edl->tracks->plugin_exists(server->plugin_id);
+ Track *track = plugin ? plugin->track : 0;
int track_w = track ? track->track_w : edl->session->output_w;
int track_h = track ? track->track_h : edl->session->output_h;
ox = (tx - track_w / 2) * projector_z + projector_x;
: BC_DialogThread()
{
this->mwindow = mwindow;
- this->plugin = 0;
+ this->plugin_id = -1;
this->plugin_type = PLUGIN_NONE;
}
// mwindow->gui->lock_window("PluginDialogThread::start_window");
this->track = track;
this->data_type = data_type;
- this->plugin = plugin;
this->is_mainmenu = is_mainmenu;
single_standalone = mwindow->edl->session->single_standalone;
plugin->calculate_title(plugin_title, 0);
this->shared_location = plugin->shared_location;
this->plugin_type = plugin->plugin_type;
+ this->plugin_id = plugin->orig_id;
}
else
{
this->shared_location.plugin = -1;
this->shared_location.module = -1;
this->plugin_type = PLUGIN_NONE;
+ this->plugin_id = -1;
}
strcpy(this->window_title, title);
selected_available = -1;
selected_shared = -1;
selected_modules = -1;
- thread->plugin = 0;
+ thread->plugin_id = -1;
thread->plugin_type = PLUGIN_NONE;
}
data_type, plugin_type, single_standalone);
}
else {
+ Plugin *plugin = mwindow->edl->tracks->plugin_exists(plugin_id);
if( plugin ) {
- if( mwindow->edl->tracks->plugin_exists(plugin) ) {
- plugin->change_plugin(plugin_title,
- &shared_location, plugin_type);
- }
+ plugin->change_plugin(plugin_title,
+ &shared_location, plugin_type);
}
- else {
- if( mwindow->edl->tracks->track_exists(track) ) {
+ else if( mwindow->edl->tracks->track_exists(track) ) {
mwindow->insert_effect(plugin_title, &shared_location,
- track, 0, 0, 0, plugin_type);
- }
+ track, 0, 0, 0, plugin_type);
}
}
mwindow->gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0);
mwindow->gui->unlock_window();
}
- plugin = 0;
+ plugin_id = -1;
}
PluginDialogApply::PluginDialogApply(PluginDialog *dialog, int x, int y)
int data_type;
Transition *transition;
// Plugin being modified if there is one
- Plugin *plugin;
+ int plugin_id;
char window_title[BCTEXTLEN];
// If attaching from main menu
int is_mainmenu;
#include "pluginset.h"
#include "samples.h"
#include "track.h"
+#include "tracks.h"
#include <ctype.h>
#include <string.h>
return ui;
}
-PluginLV2ParentUI *PluginLV2UIs::search_ui(Plugin *plugin)
+PluginLV2ParentUI *PluginLV2UIs::search_ui(int plugin_id)
{
- int64_t position = plugin->startproject;
- PluginSet *plugin_set = plugin->plugin_set;
- int set_no = plugin_set->get_number();
- int track_no = plugin_set->track->number_of();
-
PluginLV2ParentUI *ui = 0;
for( int i=size(); !ui && --i>=0; ) {
PluginLV2ParentUI *parent_ui = get(i);
- if( parent_ui->position != position ) continue;
- if( parent_ui->set_no != set_no ) continue;
- if( parent_ui->track_no == track_no ) ui = parent_ui;
+ if( parent_ui->plugin_id == plugin_id )
+ ui = parent_ui;
}
return ui;
}
-PluginLV2ParentUI *PluginLV2UIs::find_ui(Plugin *plugin)
+PluginLV2ParentUI *PluginLV2UIs::find_ui(int plugin_id)
{
- if( !plugin ) return 0;
+ if( plugin_id < 0 ) return 0;
lock("PluginLV2UIs::find_ui");
- PluginLV2ParentUI *ui = search_ui(plugin);
+ PluginLV2ParentUI *ui = search_ui(plugin_id);
unlock();
return ui;
}
PluginLV2ParentUI *PluginLV2Client::find_ui()
{
- return PluginLV2ParentUI::plugin_lv2.find_ui(server->plugin);
+ return PluginLV2ParentUI::plugin_lv2.find_ui(server->plugin_id);
}
PluginLV2ParentUI *PluginLV2ClientWindow::find_ui()
{
- return PluginLV2ParentUI::plugin_lv2.find_ui(client->server->plugin);
+ return PluginLV2ParentUI::plugin_lv2.find_ui(client->server->plugin_id);
}
PluginLV2ParentUI *PluginLV2UIs::get_ui(PluginLV2Client *client)
{
lock("PluginLV2UIs::get_ui");
- Plugin *plugin = client->server->plugin;
- PluginLV2ParentUI *ui = search_ui(plugin);
- if( !ui ) ui = add_ui(new PluginLV2ParentUI(plugin), client);
+ int plugin_id = client->server->plugin_id;
+ PluginLV2ParentUI *ui = plugin_id >= 0 ? search_ui(plugin_id) : 0;
+ if( !ui ) ui = add_ui(new PluginLV2ParentUI(plugin_id), client);
unlock();
return ui;
}
if( !input.tag.title_is(name) ) continue;
for( int i=0; i<config.size(); ++i ) {
PluginLV2Client_Opt *opt = config[i];
- float value = input.tag.get_property(opt->get_symbol(), 0.);
- opt->set_value(value);
+ float v = opt->get_value();
+ float value = input.tag.get_property(opt->get_symbol(), v);
+ if( value != v )
+ opt->set_value(value);
}
}
}
return 0;
}
-PluginLV2ParentUI::PluginLV2ParentUI(Plugin *plugin)
+PluginLV2ParentUI::PluginLV2ParentUI(int plugin_id)
{
- this->position = plugin->startproject;
- PluginSet *plugin_set = plugin->plugin_set;
- if( plugin_set ) {
- this->set_no = plugin_set->get_number();
- this->track_no = plugin_set->track->number_of();
- }
- else
- this->track_no = this->set_no = -1;
-
+ this->plugin_id = plugin_id;
output_bfr = new Condition(0, "PluginLV2ParentUI::output_bfr", 1);
client = 0;
gui = 0;
PluginLV2ParentUI *del_ui(PluginLV2Client *client);
PluginLV2ParentUI *del_ui(PluginLV2ClientWindow *gui);
PluginLV2ParentUI *add_ui(PluginLV2ParentUI *ui, PluginLV2Client *client);
- PluginLV2ParentUI *search_ui(Plugin *plugin);
- PluginLV2ParentUI *find_ui(Plugin *plugin);
+ PluginLV2ParentUI *search_ui(int plugin_id);
+ PluginLV2ParentUI *find_ui(int plugin_id);
PluginLV2ParentUI *get_ui(PluginLV2Client *client);
};
class PluginLV2ParentUI : public ForkParent
{
public:
- PluginLV2ParentUI(Plugin *plugin);
+ PluginLV2ParentUI(int plugin_id);
~PluginLV2ParentUI();
ForkChild* new_fork();
void start_parent(PluginLV2Client *client);
PluginLV2Client *client;
PluginLV2ClientWindow *gui;
+ int plugin_id;
int hidden;
int show();
int hide();
-//from Plugin::identitical_location
- int64_t position;
- int set_no;
- int track_no;
-
static PluginLV2UIs plugin_lv2;
};
#include "mainsession.h"
#include "theme.h"
#include "trackcanvas.h"
+#include "tracks.h"
#include "transportque.h"
#include "vdevicex11.h"
#include "vframe.h"
nodes = new ArrayList<VirtualNode*>;
tip = 0;
gui_id = -1;
+ plugin_id = -1;
}
PluginServer::PluginServer()
new_buffers = 0;
written_samples = written_frames = 0;
gui_on = 0;
- plugin = 0;
+ plugin_id = -1;
plugin_open = 0;
return 0;
}
else
BC_Resources::encode(BC_Resources::encoding, 0,
_(title),strlen(title)+1, ltitle,BCTEXTLEN);
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_id);
if( plugin && plugin->track )
sprintf(string, "%s: %s", plugin->track->title, ltitle);
else
if( plugin_open ) return 0;
this->preferences = preferences;
- this->plugin = plugin;
+ this->plugin_id = plugin ? plugin->orig_id : -1;
this->edl = edl;
if( !is_ffmpeg() && !is_lv2() && !is_executable() && !load_obj() ) {
// If the load failed, can't use error string to detect executable
int PluginServer::close_plugin()
{
if( !plugin_open ) return 0;
-
- if( client ) {
-// Defaults are saved in the thread.
-// if( client->defaults ) client->save_defaults();
- delete client;
- }
-
-// shared object is persistent since plugin deletion would unlink its own object
+ delete client;
plugin_open = 0;
cleanup_plugin();
return 0;
void PluginServer::client_side_close()
{
// Last command executed in client thread
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_id);
if( plugin )
mwindow->hide_plugin(plugin, 1);
- else
- if( prompt ) {
+ else if( prompt ) {
prompt->lock_window();
prompt->set_done(1);
prompt->unlock_window();
vclient->output[i] = frame[i];
}
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_id);
if( plugin ) {
vclient->source_start = (int64_t)plugin->startproject *
frame_rate / vclient->project_frame_rate;
aclient->in_buffer_size = aclient->out_buffer_size = fragment_size;
aclient->output_buffers = buffer;
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_id);
if( plugin )
aclient->source_start = plugin->startproject *
sample_rate /
void PluginServer::reset_gui_frames()
{
- mwindow->reset_plugin_gui_frames(plugin);
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_id);
+ if( plugin )
+ mwindow->reset_plugin_gui_frames(plugin);
}
void PluginServer::reset_plugin_gui_frames()
void PluginServer::render_gui_frames(PluginClientFrames *frames)
{
- mwindow->render_plugin_gui_frames(frames, plugin);
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_id);
+ if( plugin )
+ mwindow->render_plugin_gui_frames(frames, plugin);
}
void PluginServer::render_plugin_gui_frames(PluginClientFrames *frames)
// Called by client
int PluginServer::get_gui_status()
{
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_id);
if( plugin )
return plugin->show ? GUI_ON : GUI_OFF;
else
void PluginServer::show_gui()
{
if( !plugin_open ) return;
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_id);
if( plugin ) {
plugin->gui_id = gui_id;
client->total_len = plugin->length;
void PluginServer::hide_gui()
{
if( !plugin_open ) return;
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_id);
if( plugin ) plugin->gui_id = -1;
if( client->defaults ) client->save_defaults();
client->hide_gui();
void PluginServer::update_gui()
{
- if( !plugin_open || !plugin ) return;
+ if( !plugin_open ) return;
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_id);
+ if( !plugin ) return;
client->total_len = plugin->length;
client->source_start = plugin->startproject;
void PluginServer::get_defaults_path(char *path)
{
-// Get plugin name from path
- char *ptr1 = strrchr(get_path(), '/');
- char *ptr2 = strrchr(get_path(), '.');
- if( !ptr1 ) ptr1 = get_path();
- if( !ptr2 ) ptr2 = get_path() + strlen(get_path());
- char string2[BCTEXTLEN], *ptr3 = string2;
- while( ptr1 < ptr2 ) *ptr3++ = *ptr1++;
- *ptr3 = 0;
+ char string2[BCTEXTLEN];
+ switch( plugin_type ) {
+ case PLUGIN_TYPE_FFMPEG:
+ case PLUGIN_TYPE_LV2:
+ strcpy(string2, client->plugin_title());
+ break;
+ case PLUGIN_TYPE_BUILTIN:
+ case PLUGIN_TYPE_LADSPA:
+ default: { // Get plugin name from path
+ char *ptr1 = strrchr(get_path(), '/');
+ char *ptr2 = strrchr(get_path(), '.');
+ if( !ptr1 ) ptr1 = get_path();
+ if( !ptr2 ) ptr2 = get_path() + strlen(get_path());
+ char *ptr3 = string2;
+ while( ptr1 < ptr2 ) *ptr3++ = *ptr1++;
+ *ptr3 = 0;
+ break; }
+ }
sprintf(path, "%s/%s.xml", File::get_config_path(), string2);
}
KeyFrame* PluginServer::get_prev_keyframe(int64_t position)
{
KeyFrame *result = 0;
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_id);
if( plugin )
result = plugin->get_prev_keyframe(position, client->direction);
else
KeyFrame* PluginServer::get_next_keyframe(int64_t position)
{
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_id);
KeyFrame *result = !plugin ? 0 :
plugin->get_next_keyframe(position, client->direction);
return result;
// Called for
KeyFrame* PluginServer::get_keyframe()
{
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_id);
if( plugin )
// Realtime plugin case
return plugin->get_keyframe();
void PluginServer::apply_keyframe(KeyFrame *src)
{
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_id);
if( !plugin )
keyframe->copy_data(src);
else
void PluginServer::get_camera(float *x, float *y, float *z,
int64_t position, int direction)
{
- plugin->track->automation->get_camera(x, y, z, position, direction);
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_id);
+ if( plugin )
+ plugin->track->automation->get_camera(x, y, z, position, direction);
}
void PluginServer::get_projector(float *x, float *y, float *z,
int64_t position, int direction)
{
- plugin->track->automation->get_projector(x, y, z, position, direction);
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_id);
+ if( plugin )
+ plugin->track->automation->get_projector(x, y, z, position, direction);
}
int PluginServer::get_interpolation_type()
{
- return plugin->edl->session->interpolation_type;
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_id);
+ if( plugin )
+ return plugin->edl->session->interpolation_type;
+ return NEAREST_NEIGHBOR;
}
Theme* PluginServer::new_theme()
int64_t PluginServer::get_startproject()
{
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_id);
return !plugin ? -1 : plugin->startproject;
}
int64_t PluginServer::get_endproject()
{
+ Plugin *plugin = edl->tracks->plugin_exists(plugin_id);
return !plugin ? -1 : plugin->startproject + plugin->length;
}
// client origin
int plugin_type;
+ int plugin_id;
// buffers
int64_t out_buffer_size; // size of a send buffer to the plugin
// Pointer to keyframe when plugin is not available
KeyFrame *keyframe;
AttachmentPoint *attachment;
-// Storage of keyframes and GUI status
- Plugin *plugin;
// Storage of session parameters
EDL *edl;
return position;
}
-int Track::plugin_exists(Plugin *plugin)
-{
- for(int number = 0; number < plugin_set.size(); number++)
- {
- PluginSet *ptr = plugin_set.get(number);
- for(Plugin *current_plugin = (Plugin*)ptr->first;
- current_plugin;
- current_plugin = (Plugin*)current_plugin->next)
- {
- if(current_plugin == plugin) return 1;
+Plugin *Track::plugin_exists(int plugin_id)
+{
+ for( int i=0; i<plugin_set.size(); ++i ) {
+ PluginSet *set = plugin_set.get(i);
+ Plugin *plugin = (Plugin*)set->first;
+ for( ; plugin; plugin=(Plugin*)plugin->next ) {
+ if( plugin->orig_id == plugin_id )
+ return plugin;
}
}
-
- for(Edit *current = edits->first; current; current = NEXT)
- {
- if(current->transition &&
- (Plugin*)current->transition == plugin) return 1;
+ for( Edit *current=edits->first; current; current=NEXT ) {
+ Plugin *plugin = (Plugin *)current->transition;
+ if( plugin && plugin->orig_id == plugin_id )
+ return plugin;
}
-
-
return 0;
}
void shift_effects(int64_t position, int64_t length, int edit_autos, Edits *trim_edits);
void change_plugins(SharedLocation &old_location, SharedLocation &new_location, int do_swap);
void change_modules(int old_location, int new_location, int do_swap);
- int plugin_exists(Plugin *plugin);
+ Plugin *plugin_exists(int plugin_id);
EDL *edl;
Tracks *tracks;
return result;
}
-int Tracks::plugin_exists(Plugin *plugin)
+Plugin *Tracks::plugin_exists(int plugin_id)
{
- for(Track *track = first; track; track = track->next)
- {
- if(track->plugin_exists(plugin)) return 1;
+ if( plugin_id < 0 ) return 0;
+ Plugin *plugin = 0;
+ for( Track *track=first; !plugin && track; track=track->next ) {
+ plugin = track->plugin_exists(plugin_id);
}
- return 0;
+ return plugin;
}
int Tracks::track_exists(Track *track)
void paste_video_transition(PluginServer *server, int first_track = 0);
// Only tests effects
- int plugin_exists(Plugin *plugin);
+ Plugin *plugin_exists(int plugin_id);
int track_exists(Track *track);
void paste_transition(PluginServer *server, Edit *dest_edit);
void TransitionLengthThread::handle_close_event(int result)
{
+ if( mwindow->in_destructor ) return;
if( !result ) {
if( transition )
mwindow->set_transition_length(transition, new_length);
VEdit* previous_edit = 0;
//printf("VModule::render %d %p %ld %d\n", __LINE__, current_edit, start_position_project, direction);
+ Plugin *transition = get_edl()->tracks->plugin_exists(transition_id);
if( debug_render )
printf(" VModule::render %d %d %jd %s transition=%p opengl=%d current_edit=%p output=%p\n",
__LINE__, use_nudge, start_position_project, track->title,
#include <math.h>
#include "bcdisplayinfo.h"
#include "bcsignals.h"
+#include "brender.h"
#include "cursors.h"
-#include "bluebanana.h"
-#include "bluebananaconfig.h"
-#include "bluebananaslider.h"
-#include "bluebananawindow.h"
+#include "edl.h"
#include "keys.h"
#include "language.h"
#include "plugin.h"
-#include "brender.h"
+#include "tracks.h"
+#include "bluebanana.h"
+#include "bluebananaconfig.h"
+#include "bluebananaslider.h"
+#include "bluebananawindow.h"
#include "bluebananacolor.c"
if(config_consume!=config_produce)
flush_config_change();
}
- if(!plugin->server->plugin) return 0;
- if(!plugin->server->plugin->on) return 0;
+ PluginServer *server = plugin->server;
+ int plugin_id = server->plugin_id;
+ Plugin *gui_plugin = server->edl->tracks->plugin_exists(plugin_id);
+ if(!gui_plugin || !gui_plugin->on) return 0;
if(d==207){
/* if background render is active and we're showing the zebra, mark
#include "affine.h"
#include "bccolors.h"
#include "clip.h"
+#include "edl.h"
+#include "edlsession.h"
#include "filexml.h"
#include "language.h"
#include "findobj.h"
#include "plugin.h"
#include "pluginserver.h"
#include "track.h"
+#include "tracks.h"
#include <errno.h>
#include <exception>
config.boundaries();
}
+Track *FindObjMain::get_plugin_track()
+{
+ int plugin_id = server->plugin_id;
+ Plugin *plugin = server->edl->tracks->plugin_exists(plugin_id);
+ return !plugin ? 0 : plugin->track;
+}
+
void FindObjMain::draw_line(VFrame *vframe, int x1, int y1, int x2, int y2)
{
vframe->draw_line(x1, y1, x2, y2);
object_layer = config.object_layer;
scene_layer = config.scene_layer;
replace_layer = config.replace_layer;
- Track *track = server->plugin->track;
- w = track->track_w;
- h = track->track_h;
+ Track *track = get_plugin_track();
+ w = track ? track->track_w : get_edl()->session->output_w;
+ h = track ? track->track_h : get_edl()->session->output_h;
int max_layer = PluginClient::get_total_buffers() - 1;
object_layer = bclip(config.object_layer, 0, max_layer);
#include "findobj.inc"
#include "overlayframe.inc"
#include "pluginvclient.h"
+#include "track.inc"
#include "vframe.inc"
#define Mutex CvMutex
void save_data(KeyFrame *keyframe);
void read_data(KeyFrame *keyframe);
void update_gui();
+ Track *get_plugin_track();
PLUGIN_CLASS_MEMBERS2(FindObjConfig)
y1 = y;
add_subwindow(title = new BC_Title(x1, y + ys10, _("Scene X:")));
- Track *track = plugin->server->plugin->track;
- int trk_w = track->track_w, trk_h = track->track_h;
+ Track *track = plugin->get_plugin_track();
+ int trk_w = track ? track->track_w : plugin->get_edl()->session->output_w;
+ int trk_h = track ? track->track_h : plugin->get_edl()->session->output_h;
float drag_w = trk_w * plugin->config.scene_w / 100.;
float drag_h = trk_h * plugin->config.scene_h / 100.;
float ctr_x = trk_w * plugin->config.scene_x / 100.;
plugin->send_configure_change();
return ret;
}
+
Track *FindObjDragScene::get_drag_track()
{
- return !plugin->server->plugin ? 0 :
- plugin->server->plugin->track;
+ return plugin->get_plugin_track();
}
+
int64_t FindObjDragScene::get_drag_position()
{
return plugin->get_source_position();
}
+
void FindObjDragScene::update_gui()
{
bound();
plugin->send_configure_change();
return ret;
}
+
Track *FindObjDragObject::get_drag_track()
{
- return !plugin->server->plugin ? 0 :
- plugin->server->plugin->track;
+ return plugin->get_plugin_track();
}
+
int64_t FindObjDragObject::get_drag_position()
{
return plugin->get_source_position();
}
+
void FindObjDragObject::update_gui()
{
bound();
}
Track *FindObjDragReplace::get_drag_track()
{
- return !plugin->server->plugin ? 0 :
- plugin->server->plugin->track;
+ return plugin->get_plugin_track();
}
+
int64_t FindObjDragReplace::get_drag_position()
{
return plugin->get_source_position();
}
+
void FindObjDragReplace::update_gui()
{
bound();
void PuzzleObjWindow::create_objects()
{
- int xs10 = xS(10), xs50 = xS(50), xs80 = xS(80), xs180 = xS(180);
+ int xs10 = xS(10), xs80 = xS(80), xs180 = xS(180);
int ys10 = yS(10);
int x = xs10, y = ys10;
BC_Title *title = new BC_Title(x, y, _("PuzzleObj"));
#include "pluginserver.h"
#include "theme.h"
#include "track.h"
+#include "tracks.h"
#include "titlerwindow.h"
#include "bcfontentry.h"
Track *TitleDrag::get_drag_track()
{
- return !client->server->plugin ? 0 :
- client->server->plugin->track;
+ PluginServer *server = client->server;
+ int plugin_id = server->plugin_id;
+ Plugin *plugin = server->edl->tracks->plugin_exists(plugin_id);
+ return !plugin ? 0 : plugin->track;
}
int64_t TitleDrag::get_drag_position()
{