#include "awindowgui.h"
#include "awindow.h"
#include "batchrender.h"
+#include "bccmodels.h"
#include "bcdisplayinfo.h"
#include "bcprogressbox.h"
#include "bcsignals.h"
#include "channelinfo.h"
#include "clip.h"
#include "clipedls.h"
-#include "bccmodels.h"
#include "commercials.h"
#include "confirmsave.h"
+#include "convert.h"
#include "cplayback.h"
#include "ctimebar.h"
#include "cwindowgui.h"
create_bd = 0;
create_dvd = 0;
batch_render = 0;
+ convert_render = 0;
render = 0;
edl = 0;
gui = 0;
delete create_dvd; create_dvd = 0;
delete shuttle; shuttle = 0;
delete batch_render; batch_render = 0;
+ delete convert_render; convert_render = 0;
delete render; render = 0;
delete mixers_align; mixers_align = 0;
commit_commercial();
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;
}
}
plugin_gui_lock->unlock();
+// update show/gui_id
+ sync_parameters(CHANGE_PARAMS);
//printf("MWindow::show_plugin %d\n", __LINE__);
SET_TRACE
//sleep(1);
}
}
if(lock) plugin_gui_lock->unlock();
+// update show/gui_id
+ sync_parameters(CHANGE_PARAMS);
}
void MWindow::delete_plugin(PluginServer *plugin)
}
if(!got_it) plugin->show = 0;
-
plugin = (Plugin*)plugin->next;
}
}
if(do_keyframe_guis) update_keyframe_guis();
}
-int MWindow::plugin_gui_open(Plugin *plugin)
+void MWindow::stop_plugin_guis()
{
- int result = 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;
+// Send new configuration to plugin GUI's
+ 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();
}
}
+ plugin_gui_lock->unlock();
+}
+
+int MWindow::plugin_gui_open(Plugin *plugin)
+{
+ int gui_id = plugin->gui_id;
+ if( gui_id < 0 ) return 0;
+ plugin_gui_lock->lock("MWindow::plugin_gui_open");
+ 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)
{
- 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;
- }
- }
+ int gui_id = plugin->gui_id;
+ if( gui_id < 0 ) return;
+ plugin_gui_lock->lock("MWindow::render_plugin_gui 0");
+ 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)
{
- 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;
- }
- }
+ int gui_id = plugin->gui_id;
+ if( gui_id < 0 ) return;
+ plugin_gui_lock->lock("MWindow::render_plugin_gui 1");
+ PluginServer *plugin_server = plugin_guis->gui_server(gui_id);
+ if( plugin_server )
+ plugin_server->render_gui(data, size);
plugin_gui_lock->unlock();
}
+void MWindow::reset_plugin_gui_frames(Plugin *plugin)
+{
+ int gui_id = plugin->gui_id;
+ if( gui_id < 0 ) return;
+ plugin_gui_lock->lock("MWindow::reset_plugin_gui_frames");
+ PluginServer *plugin_server = plugin_guis->gui_server(gui_id);
+ if( plugin_server )
+ plugin_server->reset_plugin_gui_frames();
+ plugin_gui_lock->unlock();
+}
+
+void MWindow::render_plugin_gui_frames(PluginClientFrames *frames, Plugin *plugin)
+{
+ int gui_id = plugin->gui_id;
+ if( gui_id < 0 ) return;
+ plugin_gui_lock->lock("MWindow::render_plugin_gui_frames");
+ PluginServer *plugin_server = plugin_guis->gui_server(gui_id);
+ if( plugin_server )
+ plugin_server->render_plugin_gui_frames(frames);
+ plugin_gui_lock->unlock();
+}
+
+double MWindow::get_tracking_position()
+{
+ return edl->local_session->get_selectionstart(1);
+}
+
+int MWindow::get_tracking_direction()
+{
+ return cwindow->playback_engine->get_direction();
+}
void MWindow::update_plugin_states()
{
zwindow->set_title(mixer->title);
zwindow->start();
}
+ cwindow->gui->canvas->set_zoom(edl, 0);
}
update_vwindow();
Track *track = cwindow->calculate_affected_track();
cwindow->mask_track_id = track ? track->get_id() : -1;
cwindow->gui->tool_panel->raise_tool();
+ cwindow->gui->update_canvas(0);
cwindow->gui->unlock_window();
if(debug) PRINT_TRACE
if(debug) PRINT_TRACE
}
+void MWindow::update_preferences(Preferences *prefs)
+{
+ if( prefs != preferences )
+ preferences->copy_from(prefs);
+ if( cwindow->playback_engine )
+ cwindow->playback_engine->preferences->copy_from(prefs);
+ for(int i = 0; i < vwindows.size(); i++) {
+ VWindow *vwindow = vwindows[i];
+ if( !vwindow->is_running() ) continue;
+ if( vwindow->playback_engine )
+ vwindow->playback_engine->preferences->copy_from(prefs);
+ }
+ for(int i = 0; i < zwindows.size(); i++) {
+ ZWindow *zwindow = zwindows[i];
+ if( !zwindow->is_running() ) continue;
+ if( zwindow->zgui->playback_engine )
+ zwindow->zgui->playback_engine->preferences->copy_from(prefs);
+ }
+}
+
void MWindow::update_vwindow()
{
for( int i=0; i<vwindows.size(); ++i ) {
//printf("MWindow::rebuild_indices 1 %s\n", indexable->path);
remove_indexfile(indexable);
// Schedule index build
- IndexState *index_state = indexable->index_state;
- index_state->index_status = INDEX_NOTTESTED;
+ indexable->index_state->remove_user();
+ indexable->index_state = new IndexState;
+ IndexFile::delete_index_files(preferences, indexable);
if( indexable->is_asset ) {
Asset *asset = (Asset *)indexable;
if( asset->format != FILE_PCM ) {
}
mainindexes->add_next_asset(0, indexable);
}
+// still in render engine
+ sync_parameters(CHANGE_ALL);
+ awindow->gui->async_update_assets();
mainindexes->start_build();
}
if( vwindow->playback_engine->video_cache )
vwindow->playback_engine->video_cache->delete_entry(asset);
}
+ for(int i = 0; i < zwindows.size(); i++) {
+ ZWindow *zwindow = zwindows[i];
+ if( !zwindow->is_running() ) continue;
+ if( zwindow->zgui->playback_engine->audio_cache )
+ zwindow->zgui->playback_engine->audio_cache->delete_entry(asset);
+ if( zwindow->zgui->playback_engine->video_cache )
+ zwindow->zgui->playback_engine->video_cache->delete_entry(asset);
+ }
}
-
-void MWindow::remove_assets_from_project(int push_undo, int redraw,
+void MWindow::remove_assets_from_project(int push_undo, int redraw, int delete_indexes,
ArrayList<Indexable*> *drag_assets, ArrayList<EDL*> *drag_clips)
{
awindow->gui->close_view_popup();
- for(int i = 0; i < drag_assets->total; i++) {
- Indexable *indexable = drag_assets->get(i);
- if(indexable->is_asset) remove_asset_from_caches((Asset*)indexable);
- }
-
// Remove from VWindow.
- for(int i = 0; i < session->drag_clips->total; i++) {
- for(int j = 0; j < vwindows.size(); j++) {
- VWindow *vwindow = vwindows[j];
- if( !vwindow->is_running() ) continue;
- if(session->drag_clips->get(i) == vwindow->get_edl()) {
- vwindow->gui->lock_window("MWindow::remove_assets_from_project 1");
- vwindow->delete_source(1, 1);
- vwindow->gui->unlock_window();
+ if( drag_clips ) {
+ for(int i = 0; i < drag_clips->total; i++) {
+ for(int j = 0; j < vwindows.size(); j++) {
+ VWindow *vwindow = vwindows[j];
+ if( !vwindow->is_running() ) continue;
+ if(drag_clips->get(i) == vwindow->get_edl()) {
+ vwindow->gui->lock_window("MWindow::remove_assets_from_project 1");
+ vwindow->delete_source(1, 1);
+ vwindow->gui->unlock_window();
+ }
}
}
}
- for(int i = 0; i < drag_assets->size(); i++) {
- for(int j = 0; j < vwindows.size(); j++) {
- VWindow *vwindow = vwindows[j];
- if( !vwindow->is_running() ) continue;
- if(drag_assets->get(i) == vwindow->get_source()) {
- vwindow->gui->lock_window("MWindow::remove_assets_from_project 2");
- vwindow->delete_source(1, 1);
- vwindow->gui->unlock_window();
+ if( drag_assets ) {
+ for(int i = 0; i < drag_assets->size(); i++) {
+ for(int j = 0; j < vwindows.size(); j++) {
+ VWindow *vwindow = vwindows[j];
+ if( !vwindow->is_running() ) continue;
+ if(drag_assets->get(i) == vwindow->get_source()) {
+ vwindow->gui->lock_window("MWindow::remove_assets_from_project 2");
+ vwindow->delete_source(1, 1);
+ vwindow->gui->unlock_window();
+ }
}
}
- }
- for(int i = 0; i < drag_assets->size(); i++) {
- Indexable *indexable = drag_assets->get(i);
- remove_indexfile(indexable);
+ for(int i = 0; i < drag_assets->total; i++) {
+ Indexable *indexable = drag_assets->get(i);
+ if(indexable->is_asset) remove_asset_from_caches((Asset*)indexable);
+ }
+
+ if( delete_indexes ) {
+ for(int i = 0; i < drag_assets->size(); i++) {
+ Indexable *indexable = drag_assets->get(i);
+ remove_indexfile(indexable);
+ }
+ }
}
//printf("MWindow::rebuild_indices 1 %s\n", indexable->path);
void MWindow::remove_assets_from_disk()
{
- remove_assets_from_project(1,
- 1,
- session->drag_assets,
- session->drag_clips);
+ remove_assets_from_project(1, 1, 1,
+ session->drag_assets, session->drag_clips);
// Remove from disk
for(int i = 0; i < session->drag_assets->total; i++)