From: Good Guy Date: Sat, 29 Sep 2018 03:15:33 +0000 (-0600) Subject: fix yscale range, fix ffmpeg plugin param scroll pos, add shft lmb to overlay window X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=commitdiff_plain;h=255afe5bf50d8e2d10075c0b8ab0f88efbe91570 fix yscale range, fix ffmpeg plugin param scroll pos, add shft lmb to overlay window --- diff --git a/cinelerra-5.1/cinelerra/gwindowgui.C b/cinelerra-5.1/cinelerra/gwindowgui.C index e2345968..70bfca1e 100644 --- a/cinelerra-5.1/cinelerra/gwindowgui.C +++ b/cinelerra-5.1/cinelerra/gwindowgui.C @@ -438,7 +438,10 @@ void GWindowGUI::update_mwindow(int toggles, int overlays) void GWindowGUI::update_toggles(int use_lock) { - if(use_lock) lock_window("GWindowGUI::update_toggles"); + if(use_lock) { + lock_window("GWindowGUI::update_toggles"); + set_cool(0); + } for( int i=0; i<(int)(sizeof(toggle_order)/sizeof(toggle_order[0])); ++i ) { if( toggles[i] ) toggles[i]->update(); @@ -554,6 +557,7 @@ GWindowToggle::GWindowToggle(GWindowGUI *gui, int x, int y, this->info = info; this->color = color; this->color_button = 0; + hot = hot_value = 0; } GWindowToggle::~GWindowToggle() @@ -564,6 +568,18 @@ GWindowToggle::~GWindowToggle() int GWindowToggle::handle_event() { int value = get_value(); + if( shift_down() ) { + if( !hot ) { + gui->set_hot(this); + value = 1; + } + else { + gui->set_cool(1); + value = hot_value; + } + } + else + gui->set_cool(0); if( info->isauto >= 0 ) { *gui->get_main_value(info) = value; switch( info->ref ) { @@ -598,21 +614,9 @@ int GWindowToggle::handle_event() unlock_window(); MWindow *mwindow = gui->mwindow; mwindow->gui->lock_window("GWindowToggle::handle_event"); - if( !info->isauto ) { - switch( info->ref ) { - case NON_AUTOMATION_ASSETS: - case NON_AUTOMATION_TITLES: - mwindow->gui->update(1, 1, 0, 0, 1, 0, 0); - break; - case NON_AUTOMATION_TRANSITIONS: - case NON_AUTOMATION_PLUGIN_AUTOS: - mwindow->gui->draw_overlays(1); - break; - } - } - else - mwindow->gui->draw_overlays(1); + mwindow->gui->update(1, 1, 0, 0, 1, 0, 0); + mwindow->gui->draw_overlays(1); if( value && info->isauto > 0 ) { int autogroup_type = -1; @@ -661,3 +665,50 @@ void GWindowToggle::update_gui(int color) draw_face(1,0); } +int GWindowToggle::draw_face(int flash, int flush) +{ + int ret = BC_Toggle::draw_face(flash, flush); + if( hot ) { + set_color(color); + set_opaque(); + draw_rectangle(text_x-1, text_y-1, text_w+1, text_h+1); + if( flash ) this->flash(0); + if( flush ) this->flush(); + } + return ret; +} + +void GWindowGUI::set_cool(int reset, int all) +{ + for( int i=0; i<(int)(sizeof(toggles)/sizeof(toggles[0])); ++i ) { + GWindowToggle* toggle = toggles[i]; + if( !toggle ) continue; + int *vp = get_main_value(toggle->info); + if( !vp ) continue; + if( toggle->hot ) { + toggle->hot = 0; + toggle->draw_face(1, 0); + } + if( reset > 0 ) + *vp = toggle->hot_value; + else { + toggle->hot_value = *vp; + if( reset < 0 ) { + if ( all || toggle->info->isauto > 0 ) + *vp = 0; + } + } + } + if( reset ) + update_toggles(0); +} + +void GWindowGUI::set_hot(GWindowToggle *toggle) +{ + int *vp = get_main_value(toggle->info); + if( !vp ) return; + set_cool(-1, !toggle->info->isauto ? 1 : 0); + toggle->hot = 1; + toggle->set_value(*vp = 1); +} + diff --git a/cinelerra-5.1/cinelerra/gwindowgui.h b/cinelerra-5.1/cinelerra/gwindowgui.h index 3b47b958..f243a228 100644 --- a/cinelerra-5.1/cinelerra/gwindowgui.h +++ b/cinelerra-5.1/cinelerra/gwindowgui.h @@ -66,6 +66,8 @@ public: int *get_main_value(toggleinfo *info); int check_xyz(int group); void xyz_check(int group, int v); + void set_cool(int reset, int all=0); + void set_hot(GWindowToggle *toggle); static const char *non_auto_text[]; static const char *auto_text[]; @@ -90,8 +92,10 @@ public: int handle_event(); void update(); void update_gui(int color); + int draw_face(int flash, int flush); int color; + int hot, hot_value; toggleinfo *info; GWindowGUI *gui; GWindowColorButton *color_button; diff --git a/cinelerra-5.1/cinelerra/pluginfclient.C b/cinelerra-5.1/cinelerra/pluginfclient.C index c5d02db8..6ffcc1ed 100644 --- a/cinelerra-5.1/cinelerra/pluginfclient.C +++ b/cinelerra-5.1/cinelerra/pluginfclient.C @@ -524,7 +524,8 @@ int PluginFClient_OptPanel::update() const char *cols[] = { "option", "value", }; const int col1_w = 150; int wids[] = { col1_w, get_w()-col1_w }; - BC_ListBox::update(&items[0], &cols[0], &wids[0], sizeof(items)/sizeof(items[0])); + BC_ListBox::update(&items[0], &cols[0], &wids[0], sizeof(items)/sizeof(items[0]), + get_xposition(), get_yposition(), get_highlighted_item()); return 0; } diff --git a/cinelerra-5.1/cinelerra/trackcanvas.C b/cinelerra-5.1/cinelerra/trackcanvas.C index 76b69aab..700e10cd 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.C +++ b/cinelerra-5.1/cinelerra/trackcanvas.C @@ -1394,16 +1394,15 @@ void TrackCanvas::get_transition_coords(Edit *edit, int transition_w = 30, transition_h = 30; int has_titles = edit->track->show_titles(); int has_assets = edit->track->show_assets(); - int title_bg_h = mwindow->theme->get_image("title_bg_data")->get_h(); - int asset_h2 = resource_h() / 2; - - int iy = has_titles ? - ( has_assets ? title_bg_h + asset_h2 : title_bg_h/2 ) : - ( has_assets ? asset_h2 : 0) ; - int title_h2 = mwindow->theme->title_h / 2; - if( iy < title_h2 ) - iy = title_h2; - y += iy; + double title_bg_h = mwindow->theme->get_image("title_bg_data")->get_h(); + double asset_h = resource_h(); + double ys = has_assets ? asset_h : has_titles ? title_bg_h : 0; + double dy = has_titles ? + ( has_assets ? title_bg_h + asset_h/2 : title_bg_h/2 ) : + ( has_assets ? asset_h/2 : 0) ; + double title_h = mwindow->theme->title_h; + if( dy < title_h / 2 ) { ys = title_h; dy = ys / 2; } + y += dy; x -= transition_w / 2; y -= transition_h / 2; @@ -2857,6 +2856,7 @@ void TrackCanvas::calculate_viewport(Track *track, double &zoom_sample, double &zoom_units) { + view_start = (double)mwindow->edl->local_session->view_start[pane->number] * mwindow->edl->local_session->zoom_sample / mwindow->edl->session->sample_rate; @@ -2866,15 +2866,23 @@ void TrackCanvas::calculate_viewport(Track *track, mwindow->edl->local_session->zoom_sample / mwindow->edl->session->sample_rate; unit_end = track->to_doubleunits(view_end); - yscale = resource_h(); - center_pixel = track->y_pixel + + int y = track->y_pixel - mwindow->edl->local_session->track_start[pane->number]; - if( track->show_assets() ) - center_pixel += yscale / 2; - if( track->show_titles() ) - center_pixel += mwindow->theme->get_image("title_bg_data")->get_h(); - zoom_sample = mwindow->edl->local_session->zoom_sample; + int has_titles = track->show_titles(); + int has_assets = track->show_assets(); + double title_bg_h = mwindow->theme->get_image("title_bg_data")->get_h(); + double asset_h = resource_h(); + double title_h = mwindow->theme->title_h; + double ys = has_assets ? asset_h : has_titles ? title_bg_h : 0; + double dy = has_titles ? + ( has_assets ? title_bg_h + asset_h/2 : title_bg_h/2) : + ( has_assets ? asset_h/2 : 0) ; + if( dy < title_h/2 ) { ys = title_h; dy = ys / 2; } + yscale = ys; + center_pixel = y + dy; + zoom_sample = mwindow->edl->local_session->zoom_sample; zoom_units = track->to_doubleunits(zoom_sample / mwindow->edl->session->sample_rate); }