From 702161ddaf384a773831f1643fca0a54133625b2 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Thu, 11 Oct 2018 15:23:08 -0600 Subject: [PATCH] splashgui text clr, faders/speed keyframe popup slider rework, reticle rework --- cinelerra-5.1/cinelerra/apatchgui.C | 143 +++++++++-------- cinelerra-5.1/cinelerra/apatchgui.h | 35 +++-- cinelerra-5.1/cinelerra/apatchgui.inc | 5 +- cinelerra-5.1/cinelerra/keyframepopup.C | 135 +++++++++++----- cinelerra-5.1/cinelerra/keyframepopup.h | 42 +++-- cinelerra-5.1/cinelerra/keyframepopup.inc | 4 +- cinelerra-5.1/cinelerra/mwindowgui.C | 9 -- cinelerra-5.1/cinelerra/mwindowgui.h | 1 - cinelerra-5.1/cinelerra/patchgui.C | 10 -- cinelerra-5.1/cinelerra/splashgui.C | 2 +- cinelerra-5.1/cinelerra/trackcanvas.C | 56 +++++-- cinelerra-5.1/cinelerra/trackcanvas.h | 2 +- cinelerra-5.1/cinelerra/vpatchgui.C | 145 +++++++++--------- cinelerra-5.1/cinelerra/vpatchgui.h | 38 +++-- cinelerra-5.1/cinelerra/vpatchgui.inc | 7 +- .../plugins/theme_blond/blondtheme.C | 1 + .../plugins/theme_blond/data/lok.png | Bin 0 -> 439 bytes .../plugins/theme_blond_cv/blondcvtheme.C | 1 + .../plugins/theme_blond_cv/data/lok.png | Bin 0 -> 439 bytes cinelerra-5.1/plugins/theme_blue/bluetheme.C | 1 + cinelerra-5.1/plugins/theme_blue/data/lok.png | Bin 0 -> 439 bytes .../plugins/theme_blue_dot/bluedottheme.C | 1 + .../plugins/theme_blue_dot/data/lok.png | Bin 0 -> 439 bytes .../plugins/theme_bright/brighttheme.C | 1 + .../plugins/theme_bright/data/lok.png | Bin 0 -> 439 bytes cinelerra-5.1/plugins/theme_hulk/data/lok.png | Bin 0 -> 439 bytes cinelerra-5.1/plugins/theme_hulk/hulktheme.C | 1 + .../plugins/theme_neophyte/data/lok.png | Bin 0 -> 439 bytes .../plugins/theme_neophyte/neophyte.C | 3 + .../plugins/theme_pinklady/data/lok.png | Bin 0 -> 439 bytes .../plugins/theme_pinklady/pinkladytheme.C | 1 + cinelerra-5.1/plugins/theme_suv/data/lok.png | Bin 0 -> 439 bytes cinelerra-5.1/plugins/theme_suv/suv.C | 1 + .../plugins/theme_unflat/data/lok.png | Bin 0 -> 439 bytes .../plugins/theme_unflat/unflattheme.C | 1 + 35 files changed, 400 insertions(+), 246 deletions(-) create mode 100644 cinelerra-5.1/plugins/theme_blond/data/lok.png create mode 100644 cinelerra-5.1/plugins/theme_blond_cv/data/lok.png create mode 100644 cinelerra-5.1/plugins/theme_blue/data/lok.png create mode 100644 cinelerra-5.1/plugins/theme_blue_dot/data/lok.png create mode 100644 cinelerra-5.1/plugins/theme_bright/data/lok.png create mode 100644 cinelerra-5.1/plugins/theme_hulk/data/lok.png create mode 100644 cinelerra-5.1/plugins/theme_neophyte/data/lok.png create mode 100644 cinelerra-5.1/plugins/theme_pinklady/data/lok.png create mode 100644 cinelerra-5.1/plugins/theme_suv/data/lok.png create mode 100644 cinelerra-5.1/plugins/theme_unflat/data/lok.png diff --git a/cinelerra-5.1/cinelerra/apatchgui.C b/cinelerra-5.1/cinelerra/apatchgui.C index abfe57cd..f46e4ab7 100644 --- a/cinelerra-5.1/cinelerra/apatchgui.C +++ b/cinelerra-5.1/cinelerra/apatchgui.C @@ -30,6 +30,7 @@ #include "gwindowgui.h" #include "intauto.h" #include "intautos.h" +#include "keys.h" #include "language.h" #include "localsession.h" #include "mainsession.h" @@ -112,8 +113,9 @@ int APatchGUI::update(int x, int y) } } else if( h >= y2 ) { - patchbay->add_subwindow(fade = new AFadePatch(mwindow, this, x1+x, y1+y, - patchbay->get_w() - 10)); + float v = mwindow->get_float_auto(this, AUTOMATION_FADE)->get_value(); + patchbay->add_subwindow(fade = new AFadePatch(this, x1+x, y1+y, + patchbay->get_w() - 10, v)); } y1 = y2; @@ -171,43 +173,40 @@ int APatchGUI::update(int x, int y) return y1; } -void APatchGUI::synchronize_fade(float value_change) +void APatchGUI::update_faders(float v) { - if( fade && !change_source ) { - fade->update(fade->get_value() + value_change); - fade->update_edl(); - } -} - - - -AFadePatch::AFadePatch(MWindow *mwindow, APatchGUI *patch, int x, int y, int w) - : BC_FSlider(x, y, 0, w, w, - mwindow->edl->local_session->automation_mins[AUTOGROUPTYPE_AUDIO_FADE], - mwindow->edl->local_session->automation_maxs[AUTOGROUPTYPE_AUDIO_FADE], - mwindow->get_float_auto(patch, AUTOMATION_FADE)->get_value()) -{ - this->mwindow = mwindow; - this->patch = patch; -} + if( fade ) + fade->update(v); -float AFadePatch::update_edl() -{ - FloatAuto *current; + change_source = 1; double position = mwindow->edl->local_session->get_selectionstart(1); - Autos *fade_autos = patch->atrack->automation->autos[AUTOMATION_FADE]; + Autos *fade_autos = atrack->automation->autos[AUTOMATION_FADE]; int need_undo = !fade_autos->auto_exists_for_editing(position); mwindow->undo->update_undo_before(_("fade"), need_undo ? 0 : this); + FloatAuto *current = (FloatAuto*)fade_autos->get_auto_for_editing(position); + float change = v - current->get_value(); + current->set_value(v); - current = (FloatAuto*)fade_autos->get_auto_for_editing(position); + if( track->gang && track->record ) + patchbay->synchronize_faders(change, TRACK_AUDIO, track); + mwindow->undo->update_undo_after(_("fade"), LOAD_AUTOMATION); + change_source = 0; - float result = get_value() - current->get_value(); - current->set_value(this->get_value()); + mwindow->sync_parameters(CHANGE_PARAMS); - mwindow->undo->update_undo_after(_("fade"), LOAD_AUTOMATION); + if( mwindow->edl->session->auto_conf->autos[AUTOMATION_FADE] ) { + mwindow->gui->draw_overlays(1); + } +} - return result; +AFadePatch::AFadePatch(APatchGUI *patch, int x, int y, int w, float v) + : BC_FSlider(x, y, 0, w, w, + patch->mwindow->edl->local_session->automation_mins[AUTOGROUPTYPE_AUDIO_FADE], + patch->mwindow->edl->local_session->automation_maxs[AUTOGROUPTYPE_AUDIO_FADE], + v) +{ + this->patch = patch; } @@ -217,24 +216,12 @@ int AFadePatch::handle_event() update(0.0); set_tooltip(get_caption()); } - - patch->change_source = 1; - float change = update_edl(); - if( patch->track->gang && patch->track->record ) - patch->patchbay->synchronize_faders(change, TRACK_AUDIO, patch->track); - patch->change_source = 0; - - mwindow->sync_parameters(CHANGE_PARAMS); - - if( mwindow->edl->session->auto_conf->autos[AUTOMATION_FADE] ) { - mwindow->gui->draw_overlays(1); - } + patch->update_faders(get_value()); return 1; } AKeyFadePatch::AKeyFadePatch(MWindow *mwindow, APatchGUI *patch, int x, int y) - : BC_SubWindow(x,y, patch->patchbay->get_w(),20, - GWindowGUI::auto_colors[AUTOMATION_FADE]) + : BC_SubWindow(x,y, 200,20, GWindowGUI::auto_colors[AUTOMATION_FADE]) { this->mwindow = mwindow; this->patch = patch; @@ -242,33 +229,65 @@ AKeyFadePatch::AKeyFadePatch(MWindow *mwindow, APatchGUI *patch, int x, int y) void AKeyFadePatch::create_objects() { - akey_fade_value = new AKeyFadeValue(this); - add_subwindow(akey_fade_value); - akey_fade_value->activate(); + int x = 0, y = 0; + float v = mwindow->get_float_auto(patch, AUTOMATION_FADE)->get_value(); + add_subwindow(akey_fade_text = new AKeyFadeText(this, x, y, 64, v)); + x += akey_fade_text->get_w(); + VFrame **lok_images = mwindow->theme->get_image_set("lok"); + int w1 = get_w() - x - lok_images[0]->get_w(); + add_subwindow(akey_fade_slider = new AKeyFadeSlider(this, x, y, w1, v)); + x += akey_fade_slider->get_w(); + add_subwindow(akey_fade_ok = new AKeyFadeOK(this, x, y, lok_images)); + activate(); show_window(); } -AKeyFadeValue::AKeyFadeValue(AKeyFadePatch *akey_fade_patch) - : AFadePatch(akey_fade_patch->mwindow, akey_fade_patch->patch, - 0,0, akey_fade_patch->get_w()) +void AKeyFadePatch::update(float v) +{ + akey_fade_text->update(v); + akey_fade_slider->update(v); + patch->update_faders(v); +} + +AKeyFadeOK::AKeyFadeOK(AKeyFadePatch *akey_fade_patch, int x, int y, VFrame **images) + : BC_Button(x, y, images) { this->akey_fade_patch = akey_fade_patch; } -int AKeyFadeValue::button_release_event() +int AKeyFadeOK::handle_event() { - AFadePatch::button_release_event(); - return 0; + MWindowGUI *mgui = akey_fade_patch->mwindow->gui; + delete mgui->keyvalue_popup; + mgui->keyvalue_popup = 0; + return 1; } -int AKeyFadeValue::handle_event() +AKeyFadeText::AKeyFadeText(AKeyFadePatch *akey_fade_patch, int x, int y, int w, float v) + : BC_TextBox(x, y, w, 1, v, 1, MEDIUMFONT, 2) { - APatchGUI *patch = akey_fade_patch->patch; - int ret = AFadePatch::handle_event(); - AFadePatch *fade = patch->fade; - if( fade ) - fade->update(get_value()); - return ret; + this->akey_fade_patch = akey_fade_patch; +} + +int AKeyFadeText::handle_event() +{ + float v = atof(get_text()); + akey_fade_patch->update(v); + return get_keypress() != RETURN ? 1 : + akey_fade_patch->akey_fade_ok->handle_event(); +} + +AKeyFadeSlider::AKeyFadeSlider(AKeyFadePatch *akey_fade_patch, int x, int y, int w, float v) + : AFadePatch(akey_fade_patch->patch, x, y, w, v) +{ + this->akey_fade_patch = akey_fade_patch; +} + +int AKeyFadeSlider::handle_event() +{ + float v = get_value(); + akey_fade_patch->update(v); + return 1; } @@ -315,12 +334,6 @@ AKeyPanPatch::AKeyPanPatch(MWindow *mwindow, APatchGUI *patch) { } -int AKeyPanPatch::button_release_event() -{ - APanPatch::button_release_event(); - return 0; -} - int AKeyPanPatch::handle_event() { int ret = APanPatch::handle_event(); diff --git a/cinelerra-5.1/cinelerra/apatchgui.h b/cinelerra-5.1/cinelerra/apatchgui.h index c8342057..5b8411a4 100644 --- a/cinelerra-5.1/cinelerra/apatchgui.h +++ b/cinelerra-5.1/cinelerra/apatchgui.h @@ -39,7 +39,7 @@ public: void create_objects(); int reposition(int x, int y); int update(int x, int y); - void synchronize_fade(float value_change); + void update_faders(float v); ATrack *atrack; AFadePatch *fade; @@ -50,11 +50,9 @@ public: class AFadePatch : public BC_FSlider { public: - AFadePatch(MWindow *mwindow, APatchGUI *patch, int x, int y, int w); + AFadePatch(APatchGUI *patch, int x, int y, int w, float v); static FloatAuto* get_keyframe(MWindow *mwindow, APatchGUI *patch); virtual int handle_event(); - float update_edl(); - MWindow *mwindow; APatchGUI *patch; }; @@ -63,17 +61,37 @@ class AKeyFadePatch : public BC_SubWindow public: AKeyFadePatch(MWindow *mwindow, APatchGUI *patch, int x, int y); void create_objects(); + void update(float v); MWindow *mwindow; APatchGUI *patch; - AKeyFadeValue *akey_fade_value; + AKeyFadeOK *akey_fade_ok; + AKeyFadeText *akey_fade_text; + AKeyFadeSlider *akey_fade_slider; +}; + +class AKeyFadeOK : public BC_Button +{ +public: + AKeyFadeOK(AKeyFadePatch *akey_fade_patch, int x, int y, VFrame **images); + int handle_event(); + + AKeyFadePatch *akey_fade_patch; +}; + +class AKeyFadeText : public BC_TextBox +{ +public: + AKeyFadeText(AKeyFadePatch *akey_fade_patch, int x, int y, int w, float v); + int handle_event(); + + AKeyFadePatch *akey_fade_patch; }; -class AKeyFadeValue : public AFadePatch +class AKeyFadeSlider : public AFadePatch { public: - AKeyFadeValue(AKeyFadePatch *akey_fade_patch); - int button_release_event(); + AKeyFadeSlider(AKeyFadePatch *akey_fade_patch, int x, int y, int w, float v); int handle_event(); AKeyFadePatch *akey_fade_patch; @@ -94,7 +112,6 @@ class AKeyPanPatch : public APanPatch { public: AKeyPanPatch(MWindow *mwindow, APatchGUI *patch); - int button_release_event(); int handle_event(); }; diff --git a/cinelerra-5.1/cinelerra/apatchgui.inc b/cinelerra-5.1/cinelerra/apatchgui.inc index 986bce4d..866a167d 100644 --- a/cinelerra-5.1/cinelerra/apatchgui.inc +++ b/cinelerra-5.1/cinelerra/apatchgui.inc @@ -29,9 +29,12 @@ class APatchGUI; class AFadePatch; class AKeyFadePatch; -class AKeyFadeValue; +class AKeyFadeOK; +class AKeyFadeText; +class AKeyFadeSlider; class APanPatch; class AKeyPanPatch; class AMeterPatch; +class AMixPatch; #endif diff --git a/cinelerra-5.1/cinelerra/keyframepopup.C b/cinelerra-5.1/cinelerra/keyframepopup.C index cef8b270..362e51e8 100644 --- a/cinelerra-5.1/cinelerra/keyframepopup.C +++ b/cinelerra-5.1/cinelerra/keyframepopup.C @@ -34,6 +34,7 @@ #include "gwindow.h" #include "gwindowgui.h" #include "intauto.h" +#include "keys.h" #include "keyframe.h" #include "keyframepopup.h" #include "language.h" @@ -45,6 +46,7 @@ #include "mwindow.h" #include "patchbay.h" #include "patchgui.h" +#include "theme.h" #include "timelinepane.h" #include "track.h" #include "vtrack.h" @@ -571,13 +573,18 @@ KeyMuteValue::KeyMuteValue(KeyMutePatch *key_mute_patch) int KeyMuteValue::button_release_event() { BC_CheckBox::button_release_event(); - return 0; + MWindowGUI *mgui = key_mute_patch->mwindow->gui; + delete mgui->keyvalue_popup; + mgui->keyvalue_popup = 0; + return 1; } -void KeyMuteValue::update_edl() +int KeyMuteValue::handle_event() { MWindow *mwindow = key_mute_patch->mwindow; PatchGUI *patch = key_mute_patch->patch; + + patch->change_source = 1; double position = mwindow->edl->local_session->get_selectionstart(1); Autos *mute_autos = patch->track->automation->autos[AUTOMATION_MUTE]; int need_undo = !mute_autos->auto_exists_for_editing(position); @@ -585,17 +592,10 @@ void KeyMuteValue::update_edl() IntAuto *current = (IntAuto*)mute_autos->get_auto_for_editing(position); current->value = this->get_value(); mwindow->undo->update_undo_after(_("mute"), LOAD_AUTOMATION); -} - -int KeyMuteValue::handle_event() -{ - MWindow *mwindow = key_mute_patch->mwindow; - PatchGUI *patch = key_mute_patch->patch; - patch->change_source = 1; - update_edl(); patch->change_source = 0; + mwindow->sync_parameters(CHANGE_PARAMS); - if(mwindow->edl->session->auto_conf->autos[AUTOMATION_MUTE]) { + if( mwindow->edl->session->auto_conf->autos[AUTOMATION_MUTE] ) { mwindow->gui->update_patchbay(); mwindow->gui->draw_overlays(1); } @@ -611,64 +611,115 @@ KeySpeedPatch::KeySpeedPatch(MWindow *mwindow, PatchGUI *patch, int x, int y) void KeySpeedPatch::create_objects() { - key_speed_slider = new KeySpeedValue(this); - add_subwindow(key_speed_slider); - key_speed_slider->activate(); + int x = 0, y = 0; + float v = mwindow->get_float_auto(patch, AUTOMATION_SPEED)->get_value(); + add_subwindow(key_speed_text = new KeySpeedText(this, x, y, 64, v)); + x += key_speed_text->get_w(); + VFrame **lok_images = mwindow->theme->get_image_set("lok"); + int w1 = get_w() - x - lok_images[0]->get_w(); + add_subwindow(key_speed_slider = new KeySpeedSlider(this, x, y, w1, v)); + x += key_speed_slider->get_w(); + add_subwindow(key_speed_ok = new KeySpeedOK(this, x, y, lok_images)); + activate(); show_window(); } -KeySpeedValue::KeySpeedValue(KeySpeedPatch *key_speed_patch) - : BC_FSlider(0,0, 0, key_speed_patch->get_w(), key_speed_patch->get_w(), - key_speed_patch->mwindow->edl->local_session->automation_mins[AUTOGROUPTYPE_SPEED], - key_speed_patch->mwindow->edl->local_session->automation_maxs[AUTOGROUPTYPE_SPEED], - key_speed_patch->mwindow->get_float_auto(key_speed_patch->patch, AUTOMATION_SPEED)->get_value()) +int KeySpeedPatch::cursor_enter_event() { - this->key_speed_patch = key_speed_patch; - key_speed_patch->mwindow->speed_before(); - set_precision(0.01); + if( is_event_win() ) + mwindow->speed_before(); + return 1; } -KeySpeedValue::~KeySpeedValue() +int KeySpeedPatch::cursor_leave_event() { + if( is_event_win() ) { + mwindow->speed_after(1); + mwindow->resync_guis(); + } + return 1; } -int KeySpeedValue::button_release_event() +void KeySpeedPatch::update(float v) { - BC_FSlider::button_release_event(); - key_speed_patch->mwindow->speed_after(1); - key_speed_patch->mwindow->resync_guis(); - return 0; + key_speed_text->update(v); + key_speed_slider->update(v); + update_speed(v); } -void KeySpeedValue::update_edl() +void KeySpeedPatch::update_speed(float v) { - MWindow *mwindow = key_speed_patch->mwindow; - PatchGUI *patch = key_speed_patch->patch; + patch->change_source = 1; double position = mwindow->edl->local_session->get_selectionstart(1); Autos *speed_autos = patch->track->automation->autos[AUTOMATION_SPEED]; int need_undo = !speed_autos->auto_exists_for_editing(position); + mwindow->undo->update_undo_before(_("speed"), need_undo ? 0 : this); FloatAuto *current = (FloatAuto*)speed_autos->get_auto_for_editing(position); - current->set_value(get_value()); + current->set_value(v); mwindow->undo->update_undo_after(_("speed"), LOAD_AUTOMATION+LOAD_EDITS); + patch->change_source = 0; + + mwindow->sync_parameters(CHANGE_PARAMS); + if(mwindow->edl->session->auto_conf->autos[AUTOMATION_SPEED]) { + mwindow->gui->draw_overlays(1); + } } -int KeySpeedValue::handle_event() +KeySpeedOK::KeySpeedOK(KeySpeedPatch *key_speed_patch, int x, int y, VFrame **images) + : BC_Button(x, y, images) +{ + this->key_speed_patch = key_speed_patch; +} + +int KeySpeedOK::handle_event() { MWindow *mwindow = key_speed_patch->mwindow; - PatchGUI *patch = key_speed_patch->patch; + mwindow->speed_after(1); + mwindow->resync_guis(); + MWindowGUI *mgui = mwindow->gui; + delete mgui->keyvalue_popup; + mgui->keyvalue_popup = 0; + return 1; +} + +KeySpeedText::KeySpeedText(KeySpeedPatch *key_speed_patch, int x, int y, int w, float v) + : BC_TextBox(x, y, w, 1, v, 1, MEDIUMFONT, 2) +{ + this->key_speed_patch = key_speed_patch; +} + +int KeySpeedText::handle_event() +{ + float v = atof(get_text()); + key_speed_patch->update(v); + return get_keypress() != RETURN ? 1 : + key_speed_patch->key_speed_ok->handle_event(); +} + +KeySpeedSlider::KeySpeedSlider(KeySpeedPatch *key_speed_patch, + int x, int y, int w, float v) + : BC_FSlider(x, y, 0, w, w, + key_speed_patch->mwindow->edl->local_session->automation_mins[AUTOGROUPTYPE_SPEED], + key_speed_patch->mwindow->edl->local_session->automation_maxs[AUTOGROUPTYPE_SPEED], + v) +{ + this->key_speed_patch = key_speed_patch; + key_speed_patch->mwindow->speed_before(); + set_precision(0.01); +} + +KeySpeedSlider::~KeySpeedSlider() +{ +} + +int KeySpeedSlider::handle_event() +{ if( shift_down() ) { update(1.0); set_tooltip(get_caption()); } - - patch->change_source = 1; - update_edl(); - patch->change_source = 0; - mwindow->sync_parameters(CHANGE_PARAMS); - if(mwindow->edl->session->auto_conf->autos[AUTOMATION_SPEED]) { - mwindow->gui->draw_overlays(1); - } + key_speed_patch->update(get_value()); return 1; } diff --git a/cinelerra-5.1/cinelerra/keyframepopup.h b/cinelerra-5.1/cinelerra/keyframepopup.h index 99220c94..22d014af 100644 --- a/cinelerra-5.1/cinelerra/keyframepopup.h +++ b/cinelerra-5.1/cinelerra/keyframepopup.h @@ -147,10 +147,10 @@ public: class KeyframeHidePopup : public BC_PopupMenu { public: - KeyframeHidePopup(MWindow *mwindow, MWindowGUI *gui); - ~KeyframeHidePopup(); + KeyframeHidePopup(MWindow *mwindow, MWindowGUI *gui); + ~KeyframeHidePopup(); - void create_objects(); + void create_objects(); int update(Autos *autos); MWindow *mwindow; @@ -183,7 +183,6 @@ class KeyMuteValue : public BC_CheckBox { public: KeyMuteValue(KeyMutePatch *key_mute_patch); - void update_edl(); int button_release_event(); int handle_event(); @@ -195,21 +194,44 @@ class KeySpeedPatch : public BC_SubWindow public: KeySpeedPatch(MWindow *mwindow, PatchGUI *patch, int x, int y); void create_objects(); + void update(float v); + void update_speed(float v); + int cursor_enter_event(); + int cursor_leave_event(); MWindow *mwindow; PatchGUI *patch; - KeySpeedValue *key_speed_slider; + KeySpeedSlider *key_speed_slider; + KeySpeedText *key_speed_text; + KeySpeedOK *key_speed_ok; }; -class KeySpeedValue : public BC_FSlider +class KeySpeedOK : public BC_Button { public: - KeySpeedValue(KeySpeedPatch *key_speed_patch); - ~KeySpeedValue(); + KeySpeedOK(KeySpeedPatch *key_speed_patch, int x, int y, VFrame **images); + int handle_event(); + + KeySpeedPatch *key_speed_patch; +}; + +class KeySpeedText : public BC_TextBox +{ +public: + KeySpeedText(KeySpeedPatch *key_speed_patch, int x, int y, int w, float v); + int handle_event(); + + KeySpeedPatch *key_speed_patch; +}; + +class KeySpeedSlider : public BC_FSlider +{ +public: + KeySpeedSlider(KeySpeedPatch *key_speed_patch, + int x, int y, int w, float v); + ~KeySpeedSlider(); - void update_edl(); int handle_event(); - int button_release_event(); KeySpeedPatch *key_speed_patch; }; diff --git a/cinelerra-5.1/cinelerra/keyframepopup.inc b/cinelerra-5.1/cinelerra/keyframepopup.inc index e594a73f..55856e01 100644 --- a/cinelerra-5.1/cinelerra/keyframepopup.inc +++ b/cinelerra-5.1/cinelerra/keyframepopup.inc @@ -34,6 +34,8 @@ class KeyframeHideItem; class KeyMutePatch; class KeyMuteValue; class KeySpeedPatch; -class KeySpeedValue; +class KeySpeedOK; +class KeySpeedText; +class KeySpeedSlider; #endif diff --git a/cinelerra-5.1/cinelerra/mwindowgui.C b/cinelerra-5.1/cinelerra/mwindowgui.C index 66f11871..70c4808a 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.C +++ b/cinelerra-5.1/cinelerra/mwindowgui.C @@ -1144,15 +1144,6 @@ void MWindowGUI::default_positions() } -int MWindowGUI::button_release_event() -{ - if( keyvalue_popup ) { - delete keyvalue_popup; keyvalue_popup = 0; - } - return 0; -} - - int MWindowGUI::repeat_event(int64_t duration) { // if(duration == 100) diff --git a/cinelerra-5.1/cinelerra/mwindowgui.h b/cinelerra-5.1/cinelerra/mwindowgui.h index 00aeb606..ee920186 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.h +++ b/cinelerra-5.1/cinelerra/mwindowgui.h @@ -150,7 +150,6 @@ public: int translation_event(); int resize_event(int w, int h); // handle a resize event - int button_release_event(); int keypress_event(); int keyboard_listener(BC_WindowBase *wp); int key_listener(int key); diff --git a/cinelerra-5.1/cinelerra/patchgui.C b/cinelerra-5.1/cinelerra/patchgui.C index 9d527f11..f7f4c7e2 100644 --- a/cinelerra-5.1/cinelerra/patchgui.C +++ b/cinelerra-5.1/cinelerra/patchgui.C @@ -302,16 +302,6 @@ int64_t PatchGUI::calculate_nudge(const char *string) } - - - - - - - - - - PlayPatch::PlayPatch(MWindow *mwindow, PatchGUI *patch, int x, int y) : BC_Toggle(x, y, diff --git a/cinelerra-5.1/cinelerra/splashgui.C b/cinelerra-5.1/cinelerra/splashgui.C index e91d640d..e9e1840a 100644 --- a/cinelerra-5.1/cinelerra/splashgui.C +++ b/cinelerra-5.1/cinelerra/splashgui.C @@ -49,7 +49,7 @@ void SplashGUI::create_objects() show_window(); operation = new BC_Title(5, get_h() - get_text_height(MEDIUMFONT) - 5, - _("Loading...")); + _("Loading..."), MEDIUMFONT, GREEN); add_subwindow(operation); unlock_window(); } diff --git a/cinelerra-5.1/cinelerra/trackcanvas.C b/cinelerra-5.1/cinelerra/trackcanvas.C index 8ff10d20..5b283ff6 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.C +++ b/cinelerra-5.1/cinelerra/trackcanvas.C @@ -2177,34 +2177,37 @@ void TrackCanvas::draw_keyframe_reticle() int current_op = mwindow->session->current_operation, dragging = 0; for( int i=0; !dragging && isession->drag_auto ) dragging = 0; - if( keyframe_hairline == HAIRLINE_DRAGGING && dragging ) { - if( mwindow->session->drag_auto && get_buttonpress() == 1 ) { - draw_hairline(mwindow->session->drag_auto, RED); - return; - } + int autoidx = dragging && keyframe_hairline != HAIRLINE_ALWAYS ? + mwindow->session->drag_auto->autos->autoidx : -1; + + if( get_buttonpress() == 1 && dragging && + keyframe_hairline == HAIRLINE_DRAGGING ) { + draw_hairline(mwindow->session->drag_auto, RED, 1); + return; } if( keyframe_hairline == HAIRLINE_ALWAYS || ( get_buttonpress() == 2 && keyframe_hairline == HAIRLINE_DRAGGING && dragging ) ) { - for( Track *track = mwindow->edl->tracks->first; track; - track=track->next ) { + int show = dragging || keyframe_hairline == HAIRLINE_ALWAYS ? 1 : 0; + for( Track *track = mwindow->edl->tracks->first; track; track=track->next ) { Automation *automation = track->automation; for( int i=0; iedl->session->auto_conf->autos[i] ) continue; // automation visible Autos *autos = automation->autos[i]; if( !autos ) continue; + if( autoidx >= 0 && autos->autoidx != autoidx ) continue; for( Auto *auto_keyframe=autos->first; auto_keyframe; auto_keyframe = auto_keyframe->next ) { - draw_hairline(auto_keyframe, BLUE); + draw_hairline(auto_keyframe, BLUE, show); } } - - if( dragging && mwindow->session->drag_auto ) { - draw_hairline(mwindow->session->drag_auto, RED); - } } + + if( dragging ) + draw_hairline(mwindow->session->drag_auto, RED, 1); } } @@ -3458,10 +3461,10 @@ int TrackCanvas::do_plugin_autos(Track *track, int cursor_x, int cursor_y, return result; } -int TrackCanvas::draw_hairline(Auto *auto_keyframe, int color) +int TrackCanvas::draw_hairline(Auto *auto_keyframe, int color, int show) { Track *track = auto_keyframe->autos->track; - int autogrouptype = auto_keyframe->autos->get_type(); + int autogrouptype = auto_keyframe->autos->autogrouptype; int center_pixel; double view_start, unit_start; @@ -3477,6 +3480,31 @@ int TrackCanvas::draw_hairline(Auto *auto_keyframe, int color) set_color(color); draw_line(ax, 0, ax, get_h()); + + if( show ) { + char text[BCSTRLEN]; + if( auto_keyframe->is_floatauto() ) { + FloatAuto *float_auto = (FloatAuto *)auto_keyframe; + sprintf(text, "%0.2f", float_auto->get_value()); + } + else { + IntAuto *int_auto = (IntAuto *)auto_keyframe; + sprintf(text, "%d", int_auto->value); + } + int font = MEDIUMFONT; + int tw = get_text_width(font, text) + TOOLTIP_MARGIN * 2; + int th = get_text_height(font, text) + TOOLTIP_MARGIN * 2; + set_color(get_resources()->tooltip_bg_color); + ax += HANDLE_W/2; + ay += center_pixel + HANDLE_W/2; + draw_box(ax, ay, tw, th); + set_color(BLACK); + draw_rectangle(ax, ay, tw, th); + set_font(font); + ax += TOOLTIP_MARGIN; + ay += TOOLTIP_MARGIN + get_text_ascent(font); + draw_text(ax, ay, text); + } return 0; } diff --git a/cinelerra-5.1/cinelerra/trackcanvas.h b/cinelerra-5.1/cinelerra/trackcanvas.h index 59f58c30..bb261ad7 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.h +++ b/cinelerra-5.1/cinelerra/trackcanvas.h @@ -77,7 +77,7 @@ public: void draw_playback_cursor(); void draw_highlighting(); void draw_keyframe_reticle(); - int draw_hairline(Auto *auto_keyframe, int color); + int draw_hairline(Auto *auto_keyframe, int color, int show); // User can either call draw or draw_overlays to copy a fresh // canvas and just draw the overlays over it diff --git a/cinelerra-5.1/cinelerra/vpatchgui.C b/cinelerra-5.1/cinelerra/vpatchgui.C index 1095238f..5fa6eb94 100644 --- a/cinelerra-5.1/cinelerra/vpatchgui.C +++ b/cinelerra-5.1/cinelerra/vpatchgui.C @@ -28,6 +28,7 @@ #include "gwindowgui.h" #include "intauto.h" #include "intautos.h" +#include "keys.h" #include "language.h" #include "localsession.h" #include "mainsession.h" @@ -101,8 +102,9 @@ int VPatchGUI::update(int x, int y) } } else if( h >= y2 ) { - patchbay->add_subwindow(fade = new VFadePatch(mwindow, this, x1+x, y1+y, - patchbay->get_w() - 10)); + int64_t v = mwindow->get_float_auto(this, AUTOMATION_FADE)->get_value(); + patchbay->add_subwindow(fade = new VFadePatch(this, x1+x, y1+y, + patchbay->get_w() - 10, v)); } y1 = y2; @@ -136,43 +138,40 @@ int VPatchGUI::update(int x, int y) return y1; } - -void VPatchGUI::synchronize_fade(float value_change) -{ - if( fade && !change_source ) { - fade->update(Units::to_int64(fade->get_value() + value_change)); - fade->update_edl(); - } -} - - -VFadePatch::VFadePatch(MWindow *mwindow, VPatchGUI *patch, int x, int y, int w) +VFadePatch::VFadePatch(VPatchGUI *patch, int x, int y, int w, int64_t v) : BC_ISlider(x, y, 0, w, w, - mwindow->edl->local_session->automation_mins[AUTOGROUPTYPE_VIDEO_FADE], - mwindow->edl->local_session->automation_maxs[AUTOGROUPTYPE_VIDEO_FADE], - (int64_t)mwindow->get_float_auto(patch,AUTOMATION_FADE)->get_value()) + patch->mwindow->edl->local_session->automation_mins[AUTOGROUPTYPE_VIDEO_FADE], + patch->mwindow->edl->local_session->automation_maxs[AUTOGROUPTYPE_VIDEO_FADE], + v) { - this->mwindow = mwindow; this->patch = patch; } -float VFadePatch::update_edl() +void VPatchGUI::update_faders(float v) { - FloatAuto *current; + if( fade ) + fade->update(v); + + change_source = 1; double position = mwindow->edl->local_session->get_selectionstart(1); - Autos *fade_autos = patch->vtrack->automation->autos[AUTOMATION_FADE]; + Autos *fade_autos = vtrack->automation->autos[AUTOMATION_FADE]; int need_undo = !fade_autos->auto_exists_for_editing(position); mwindow->undo->update_undo_before(_("fade"), need_undo ? 0 : this); + FloatAuto *current = (FloatAuto*)fade_autos->get_auto_for_editing(position); + float change = v - current->get_value(); + current->set_value(v); - current = (FloatAuto*)fade_autos->get_auto_for_editing(position); - - float result = get_value() - current->get_value(); - current->set_value(get_value()); - + if( track->gang && track->record ) + patchbay->synchronize_faders(change, TRACK_AUDIO, track); mwindow->undo->update_undo_after(_("fade"), LOAD_AUTOMATION); + change_source = 0; + + mwindow->sync_parameters(CHANGE_PARAMS); - return result; + if( mwindow->edl->session->auto_conf->autos[AUTOMATION_FADE] ) { + mwindow->gui->draw_overlays(1); + } } int VFadePatch::handle_event() @@ -181,31 +180,12 @@ int VFadePatch::handle_event() update(100); set_tooltip(get_caption()); } - - patch->change_source = 1; - - float change = update_edl(); - - if( patch->track->gang && patch->track->record ) - patch->patchbay->synchronize_faders(change, TRACK_VIDEO, patch->track); - - patch->change_source = 0; - - - mwindow->gui->unlock_window(); - mwindow->restart_brender(); - mwindow->sync_parameters(CHANGE_PARAMS); - mwindow->gui->lock_window("VFadePatch::handle_event"); - if( mwindow->edl->session->auto_conf->autos[AUTOMATION_FADE] ) { - mwindow->gui->draw_overlays(1); - } + patch->update_faders(get_value()); return 1; } - VKeyFadePatch::VKeyFadePatch(MWindow *mwindow, VPatchGUI *patch, int x, int y) - : BC_SubWindow(x,y, patch->patchbay->get_w(),20, - GWindowGUI::auto_colors[AUTOMATION_FADE]) + : BC_SubWindow(x,y, 200,20, GWindowGUI::auto_colors[AUTOMATION_FADE]) { this->mwindow = mwindow; this->patch = patch; @@ -213,33 +193,66 @@ VKeyFadePatch::VKeyFadePatch(MWindow *mwindow, VPatchGUI *patch, int x, int y) void VKeyFadePatch::create_objects() { - vkey_fade_value = new VKeyFadeValue(this); - add_subwindow(vkey_fade_value); - vkey_fade_value->activate(); + int x = 0, y = 0; + int64_t v = mwindow->get_float_auto(patch, AUTOMATION_FADE)->get_value(); + add_subwindow(vkey_fade_text = new VKeyFadeText(this, x, y, 64, v)); + x += vkey_fade_text->get_w(); + VFrame **lok_images = mwindow->theme->get_image_set("lok"); + int w1 = get_w() - x - lok_images[0]->get_w(); + add_subwindow(vkey_fade_slider = new VKeyFadeSlider(this, x, y, w1, v)); + x += vkey_fade_slider->get_w(); + add_subwindow(vkey_fade_ok = new VKeyFadeOK(this, x, y, lok_images)); + activate(); show_window(); } -VKeyFadeValue::VKeyFadeValue(VKeyFadePatch *vkey_fade_patch) - : VFadePatch(vkey_fade_patch->mwindow, vkey_fade_patch->patch, - 0,0, vkey_fade_patch->get_w()) +void VKeyFadePatch::update(int64_t v) +{ + vkey_fade_text->update(v); + vkey_fade_slider->update(v); + patch->update_faders(v); +} + +VKeyFadeOK::VKeyFadeOK(VKeyFadePatch *vkey_fade_patch, int x, int y, VFrame **images) + : BC_Button(x, y, images) { this->vkey_fade_patch = vkey_fade_patch; } -int VKeyFadeValue::button_release_event() +int VKeyFadeOK::handle_event() { - VFadePatch::button_release_event(); - return 0; + MWindowGUI *mgui = vkey_fade_patch->mwindow->gui; + delete mgui->keyvalue_popup; + mgui->keyvalue_popup = 0; + return 1; } -int VKeyFadeValue::handle_event() +VKeyFadeText::VKeyFadeText(VKeyFadePatch *vkey_fade_patch, int x, int y, int w, int64_t v) + : BC_TextBox(x, y, w, 1, v, 1, MEDIUMFONT) { - VPatchGUI *patch = vkey_fade_patch->patch; - int ret = VFadePatch::handle_event(); - VFadePatch *fade = patch->fade; - if( fade ) - fade->update(get_value()); - return ret; + this->vkey_fade_patch = vkey_fade_patch; +} + +int VKeyFadeText::handle_event() +{ + int64_t v = atoi(get_text()); + vkey_fade_patch->update(v); + return get_keypress() != RETURN ? 1 : + vkey_fade_patch->vkey_fade_ok->handle_event(); +} + +VKeyFadeSlider::VKeyFadeSlider(VKeyFadePatch *vkey_fade_patch, + int x, int y, int w, int64_t v) + : VFadePatch(vkey_fade_patch->patch, x,y, w, v) +{ + this->vkey_fade_patch = vkey_fade_patch; +} + +int VKeyFadeSlider::handle_event() +{ + int64_t v = get_value(); + vkey_fade_patch->update(v); + return 1; } @@ -451,12 +464,6 @@ VKeyModePatch::VKeyModePatch(MWindow *mwindow, VPatchGUI *patch) { } -int VKeyModePatch::button_release_event() -{ - VModePatch::button_release_event(); - return 0; -} - int VKeyModePatch::handle_event() { int ret = VModePatch::handle_event(); diff --git a/cinelerra-5.1/cinelerra/vpatchgui.h b/cinelerra-5.1/cinelerra/vpatchgui.h index d071fb00..76140a41 100644 --- a/cinelerra-5.1/cinelerra/vpatchgui.h +++ b/cinelerra-5.1/cinelerra/vpatchgui.h @@ -30,9 +30,6 @@ #include "vpatchgui.inc" #include "vtrack.inc" -class VFadePatch; -class VModePatch; - class VPatchGUI : public PatchGUI { public: @@ -46,7 +43,7 @@ public: void create_objects(); int reposition(int x, int y); int update(int x, int y); - void synchronize_fade(float value_change); + void update_faders(float v); VTrack *vtrack; VModePatch *mode; @@ -56,10 +53,8 @@ public: class VFadePatch : public BC_ISlider { public: - VFadePatch(MWindow *mwindow, VPatchGUI *patch, int x, int y, int w); + VFadePatch(VPatchGUI *patch, int x, int y, int w, int64_t v); int handle_event(); - float update_edl(); - MWindow *mwindow; VPatchGUI *patch; }; @@ -68,17 +63,37 @@ class VKeyFadePatch : public BC_SubWindow public: VKeyFadePatch(MWindow *mwindow, VPatchGUI *patch, int x, int y); void create_objects(); + void update(int64_t v); MWindow *mwindow; VPatchGUI *patch; - VKeyFadeValue *vkey_fade_value; + VKeyFadeOK *vkey_fade_ok; + VKeyFadeText *vkey_fade_text; + VKeyFadeSlider *vkey_fade_slider; +}; + +class VKeyFadeOK : public BC_Button +{ +public: + VKeyFadeOK(VKeyFadePatch *vkey_fade_patch, int x, int y, VFrame **images); + int handle_event(); + + VKeyFadePatch *vkey_fade_patch; +}; + +class VKeyFadeText : public BC_TextBox +{ +public: + VKeyFadeText(VKeyFadePatch *vkey_fade_patch, int x, int y, int w, int64_t v); + int handle_event(); + + VKeyFadePatch *vkey_fade_patch; }; -class VKeyFadeValue : public VFadePatch +class VKeyFadeSlider : public VFadePatch { public: - VKeyFadeValue(VKeyFadePatch *vkey_fade_patch); - int button_release_event(); + VKeyFadeSlider(VKeyFadePatch *akey_fade_patch, int x, int y, int w, int64_t v); int handle_event(); VKeyFadePatch *vkey_fade_patch; @@ -134,7 +149,6 @@ class VKeyModePatch : public VModePatch { public: VKeyModePatch(MWindow *mwindow, VPatchGUI *patch); - int button_release_event(); int handle_event(); }; diff --git a/cinelerra-5.1/cinelerra/vpatchgui.inc b/cinelerra-5.1/cinelerra/vpatchgui.inc index f9af5277..94b9a3e0 100644 --- a/cinelerra-5.1/cinelerra/vpatchgui.inc +++ b/cinelerra-5.1/cinelerra/vpatchgui.inc @@ -25,10 +25,15 @@ class VPatchGUI; class VFadePatch; class VKeyFadePatch; -class VKeyFadeValue; +class VKeyFadeOK; +class VKeyFadeText; +class VKeyFadeSlider; class VModePatch; class VModePatchItem; +class VModePatchSubMenu; +class VModeSubMenuItem; class VKeyModePatch; +class VMixPatch; #define MAX_VIDEO_FADE 100 diff --git a/cinelerra-5.1/plugins/theme_blond/blondtheme.C b/cinelerra-5.1/plugins/theme_blond/blondtheme.C index 90dfa4ee..ce13c51f 100644 --- a/cinelerra-5.1/plugins/theme_blond/blondtheme.C +++ b/cinelerra-5.1/plugins/theme_blond/blondtheme.C @@ -672,6 +672,7 @@ void BlondTheme::initialize() new_button("bottom_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "bottom_justify"); new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "center_justify"); new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn, "channel"); + new_button("lok.png", editpanel_up, editpanel_hi, editpanel_dn, "lok"); new_toggle("histogram_toggle.png", editpanel_up, diff --git a/cinelerra-5.1/plugins/theme_blond/data/lok.png b/cinelerra-5.1/plugins/theme_blond/data/lok.png new file mode 100644 index 0000000000000000000000000000000000000000..e64e5a9aca61b8c9357ff488a1245e4b5b735829 GIT binary patch literal 439 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)4%caKYZ?lYt_f1s;*b z3=DinK$vl=HlH+5kiEpy*OmPd7nhKc^r=To`9LAr%#er@=ltB<)VvZPmw~~#C^fMp zHASI3vm`^o-P1Q9MK6_|fq_xl)5S5w+mG z^oj#1+?BG@cTaR{Wyl`gYVw?Y+mG z^oj#1+?BG@cTaR{Wyl`gYVw?Y+mG z^oj#1+?BG@cTaR{Wyl`gYVw?Y+mG z^oj#1+?BG@cTaR{Wyl`gYVw?Y+mG z^oj#1+?BG@cTaR{Wyl`gYVw?Y+mG z^oj#1+?BG@cTaR{Wyl`gYVw?Y+mG z^oj#1+?BG@cTaR{Wyl`gYVw?Y+mG z^oj#1+?BG@cTaR{Wyl`gYVw?Y+mG z^oj#1+?BG@cTaR{Wyl`gYVw?Y+mG z^oj#1+?BG@cTaR{Wyl`gYVw?Y