X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmwindow.C;h=af743cc730bf2192fddaa853db6803a052d5ca13;hp=263bbd989621bdfa7e3195084801d4e36939f515;hb=2a56d102d9db53017b306f2a61a2382f29a75783;hpb=3d7a882d0808f456957f823454bd84ff8317a51a diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 263bbd98..af743cc7 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -102,6 +102,7 @@ #include "savefile.inc" #include "samplescroll.h" #include "sha1.h" +#include "shuttle.h" #include "sighandler.h" #include "splashgui.h" #include "statusbar.h" @@ -237,6 +238,7 @@ MWindow::MWindow() in_destructor = 0; speed_edl = 0; proxy_beep = 0; + shuttle = 0; } @@ -254,6 +256,7 @@ MWindow::~MWindow() delete proxy_beep; delete create_bd; create_bd = 0; delete create_dvd; create_dvd = 0; + delete shuttle; shuttle = 0; delete batch_render; batch_render = 0; delete render; render = 0; commit_commercial(); @@ -1582,6 +1585,17 @@ void MWindow::init_exportedl() exportedl = new ExportEDL(this); } +void MWindow::init_shuttle() +{ +#ifdef HAVE_SHUTTLE + const char *dev_name = Shuttle::probe(); + if( dev_name ) { + shuttle = new Shuttle(this); + shuttle->start(dev_name); + } +#endif +} + void MWindow::init_brender() { if(preferences->use_brender && !brender) @@ -2021,6 +2035,8 @@ if(debug) printf("MWindow::load_filenames %d\n", __LINE__); 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)); @@ -2029,6 +2045,8 @@ if(debug) printf("MWindow::load_filenames %d\n", __LINE__); 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__); @@ -2616,6 +2634,7 @@ void MWindow::create_objects(int want_gui, init_render(); if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); + init_shuttle(); init_brender(); init_exportedl(); init_commercials(); @@ -3307,6 +3326,11 @@ int MWindow::get_hash_color(Edit *edit) 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; @@ -3319,14 +3343,32 @@ int MWindow::get_hash_color(Edit *edit) 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; + unsigned color = edit->color & 0xffffff; + unsigned alpha = (~edit->color>>24) & 0xff; if( !color ) { - if( !preferences->autocolor_assets ) return 0; - color = get_hash_color(edit); + if( edit->group_id ) + color = get_group_color(edit->group_id); + else if( preferences->autocolor_assets ) + color = get_hash_color(edit); + else + return 0; } - unsigned alpha = (~edit->color>>24) & 0xff; if( alpha == 0xff ) alpha = session->title_bar_alpha*255; return color | (~alpha<<24);