EDL *nested_edl = new EDL;
nested_edl->create_objects();
nested_edl->load_xml(&xml_file, LOAD_ALL);
+ int groups = nested_edl->regroup(session->group_number);
+ session->group_number += groups;
//printf("MWindow::load_filenames %p %s\n", nested_edl, nested_edl->project_path);
new_edl->create_nested(nested_edl);
new_edl->set_path(filenames->get(i));
else {
// Load EDL for pasting
new_edl->load_xml(&xml_file, LOAD_ALL);
+ int groups = new_edl->regroup(session->group_number);
+ session->group_number += groups;
if(debug) printf("MWindow::load_filenames %d\n", __LINE__);
test_plugins(new_edl, filenames->get(i));
if(debug) printf("MWindow::load_filenames %d\n", __LINE__);
keyframe_gui_lock->unlock();
}
+int MWindow::get_hash_color(Edit *edit)
+{
+ Indexable *idxbl = edit->asset ?
+ (Indexable*)edit->asset : (Indexable*)edit->nested_edl;
+ if( !idxbl ) return 0;
+ char path[BCTEXTLEN];
+ if( !edit->asset || edit->track->data_type != TRACK_VIDEO ||
+ edl->session->proxy_scale == 1 ||
+ ProxyRender::from_proxy_path(path, idxbl, edl->session->proxy_scale) )
+ strcpy(path, idxbl->path);
+ char *cp = strrchr(path, '/');
+ cp = !cp ? path : cp+1;
+ uint8_t *bp = (uint8_t*)cp;
+ int v = 0;
+ while( *bp ) v += *bp++;
+ return get_hash_color(v);
+}
+
+int MWindow::get_hash_color(int v)
+{
+ int hash = 0x303030;
+ if( v & 0x01 ) hash ^= 0x000040;
+ if( v & 0x02 ) hash ^= 0x004000;
+ if( v & 0x04 ) hash ^= 0x400000;
+ if( v & 0x08 ) hash ^= 0x080000;
+ if( v & 0x10 ) hash ^= 0x000800;
+ if( v & 0x20 ) hash ^= 0x000008;
+ if( v & 0x40 ) hash ^= 0x404040;
+ if( v & 0x80 ) hash ^= 0x080808;
+ return hash;
+}
+
+int MWindow::get_group_color(int v)
+{
+ int color = 0x606060;
+ if( v & 0x01 ) color ^= 0x000080;
+ if( v & 0x02 ) color ^= 0x008000;
+ if( v & 0x04 ) color ^= 0x800000;
+ if( v & 0x08 ) color ^= 0x100000;
+ if( v & 0x10 ) color ^= 0x001000;
+ if( v & 0x20 ) color ^= 0x000010;
+ if( v & 0x40 ) color ^= 0x080808;
+ if( v & 0x80 ) color ^= 0x909090;
+ return color;
+}
+
+int MWindow::get_title_color(Edit *edit)
+{
+ unsigned color = edit->color & 0xffffff;
+ unsigned alpha = (~edit->color>>24) & 0xff;
+ if( !color ) {
+ if( edit->group_id )
+ color = get_group_color(edit->group_id);
+ else if( preferences->autocolor_assets )
+ color = get_hash_color(edit);
+ else
+ return 0;
+ }
+ if( !alpha )
+ alpha = session->title_bar_alpha*255;
+ return color | (~alpha<<24);
+}
+
void MWindow::update_keyframe_guis()
{
// Send new configuration to keyframe GUI's
void MWindow::remove_assets_from_project(int push_undo, int redraw,
ArrayList<Indexable*> *drag_assets, ArrayList<EDL*> *drag_clips)
{
- awindow->gui->vicon_thread->stop_drawing();
- awindow->gui->vicon_thread->drawing_started(); // waits for draw lock
- awindow->gui->vicon_thread->drawing_stopped();
+ awindow->gui->close_view_popup();
for(int i = 0; i < drag_assets->total; i++) {
Indexable *indexable = drag_assets->get(i);
void MWindow::remove_assets_from_disk()
{
+ remove_assets_from_project(1,
+ 1,
+ session->drag_assets,
+ session->drag_clips);
+
// Remove from disk
for(int i = 0; i < session->drag_assets->total; i++)
{
remove(session->drag_assets->get(i)->path);
}
-
- remove_assets_from_project(1,
- 1,
- session->drag_assets,
- session->drag_clips);
}
void MWindow::dump_plugins(FILE *fp)