X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fscopewindow.C;h=e1cfe335d254bbc4248b7adc063505360869c6d7;hb=83b70dd60863377cb281e6be5206304e10373e30;hp=d02a473bf561a8bc96db28991f2d7f1b8b3b8284;hpb=fd310b768dfc78c91a6ddc26b9a25914e5b248d7;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/scopewindow.C b/cinelerra-5.1/cinelerra/scopewindow.C index d02a473b..e1cfe335 100644 --- a/cinelerra-5.1/cinelerra/scopewindow.C +++ b/cinelerra-5.1/cinelerra/scopewindow.C @@ -455,6 +455,7 @@ void ScopeGUI::reset() frame_w = 1; use_smooth = 1; use_refresh = 0; + use_release = 0; use_wave_gain = 5; use_vect_gain = 5; use_hist = 0; @@ -753,6 +754,32 @@ void ScopeGUI::draw_overlays(int overlays, int borders, int flush) waveform->draw_line(0, y, wave_w, y); waveform->draw_rectangle(0, 0, wave_w, wave_h); } + + int y1 = wave_h * 1.8 / WAVEFORM_DIVISIONS; + int text_y1 = y1 + wave_y + get_text_ascent(SMALLFONT) / 2; + CLAMP(text_y1, waveform->get_y() + get_text_ascent(SMALLFONT), waveform->get_y() + waveform->get_h() - 1); + char string1[BCTEXTLEN]; + sprintf( string1, "%d",(int)lround((FLOAT_MAX - + 1.8 * (FLOAT_MAX - FLOAT_MIN ) / WAVEFORM_DIVISIONS ) * 100) ); + int text_x1 = wave_x + get_text_width(SMALLFONT, string1) - margin +wave_w; + set_color(text_color); + draw_text(text_x1, text_y1, string1); + CLAMP(y1, 0, waveform->get_h() - 1); + set_color(dark_color); + waveform->draw_line(0, y1, wave_w, y1); + + int y2 = wave_h * 10.4 / WAVEFORM_DIVISIONS; + int text_y2 = y2 + wave_y + get_text_ascent(SMALLFONT) / 2; + CLAMP(text_y2, waveform->get_y() + get_text_ascent(SMALLFONT), waveform->get_y() + waveform->get_h() - 1); + char string2[BCTEXTLEN]; + sprintf( string2, "%d",(int)lround((FLOAT_MAX - + 10.4 * (FLOAT_MAX - FLOAT_MIN ) / WAVEFORM_DIVISIONS) * 100) ); + set_color(text_color); + draw_text(text_x1, text_y2, string2); + CLAMP(y2, 0, waveform->get_h() - 1); + set_color(dark_color); + waveform->draw_line(0, y2, wave_w, y2); + set_line_dashes(0); waveform->draw_point(); set_line_dashes(1); @@ -919,6 +946,7 @@ void ScopeGUI::process(VFrame *output_frame) void ScopeGUI::update_toggles() { scope_menu->update_toggles(); + settings->update_toggles(); } ScopePanel::ScopePanel(ScopeGUI *gui, int x, int y, int w, int h) @@ -1297,7 +1325,11 @@ int ScopeSettingOn::handle_event() break; case SCOPE_REFRESH: gui->use_refresh = v; + gui->use_release = 0; break; + case SCOPE_RELEASE: + gui->use_release = v; + gui->use_refresh = 0; } gui->toggle_event(); gui->update_toggles(); @@ -1307,9 +1339,11 @@ int ScopeSettingOn::handle_event() } ScopeSettings::ScopeSettings(ScopeGUI *gui, int x, int y) - : BC_PopupMenu(x, y, xS(125), _("Settings")) + : BC_PopupMenu(x, y, xS(150), _("Settings")) { this->gui = gui; + refresh_on = 0; + release_on = 0; } void ScopeSettings::create_objects() @@ -1319,10 +1353,13 @@ void ScopeSettings::create_objects() smooth_on->set_checked(gui->use_smooth); if( gui->use_refresh >= 0 ) { add_item(refresh_on = - new ScopeSettingOn(this, _("Realtime"), SCOPE_REFRESH)); + new ScopeSettingOn(this, _("Refresh on Stop"), SCOPE_REFRESH)); + add_item(release_on = + new ScopeSettingOn(this, _("Refresh on Release"), SCOPE_RELEASE)); refresh_on->set_checked(gui->use_refresh); + release_on->set_checked(gui->use_release); } - add_item(new BC_MenuItem(_("-Graticule-"))); + add_item(new BC_MenuItem(_("-VectorWheel Grids-"))); gui->grat_paths.remove_all_objects(); ScopeGratItem *item; @@ -1346,6 +1383,14 @@ void ScopeSettings::create_objects() } } +void ScopeSettings::update_toggles() +{ + if( refresh_on ) + refresh_on->set_checked(gui->use_refresh); + if( release_on ) + release_on->set_checked(gui->use_release); +} + ScopeGratItem::ScopeGratItem(ScopeSettings *settings, const char *text, int idx) : BC_MenuItem(text) {