From 361dbd9de4e6e4143ea0cac5daa89b30685a4c70 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Sun, 25 Sep 2016 14:06:13 -0600 Subject: [PATCH] translation fixes, pref wdw min width, xfer mode ops --- cinelerra-5.1/cinelerra/awindowgui.C | 14 ++-- cinelerra-5.1/cinelerra/edl.inc | 14 ++-- cinelerra-5.1/cinelerra/gwindowgui.C | 34 ++++----- cinelerra-5.1/cinelerra/overlayframe.inc | 77 ++++++++++++++++++++ cinelerra-5.1/cinelerra/preferencesthread.C | 20 +++-- cinelerra-5.1/cinelerra/preferencesthread.h | 3 +- cinelerra-5.1/plugins/cdripper/cdripwindow.C | 8 +- 7 files changed, 125 insertions(+), 45 deletions(-) diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index bee6da43..ba047200 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -536,19 +536,19 @@ SET_TRACE SET_TRACE // Mandatory folders - folders.append(picon = new AssetPicon(mwindow, this, _(AEFFECT_FOLDER))); + folders.append(picon = new AssetPicon(mwindow, this, AEFFECT_FOLDER)); picon->persistent = 1; - folders.append(picon = new AssetPicon(mwindow, this, _(VEFFECT_FOLDER))); + folders.append(picon = new AssetPicon(mwindow, this, VEFFECT_FOLDER)); picon->persistent = 1; - folders.append(picon = new AssetPicon(mwindow, this, _(ATRANSITION_FOLDER))); + folders.append(picon = new AssetPicon(mwindow, this, ATRANSITION_FOLDER)); picon->persistent = 1; - folders.append(picon = new AssetPicon(mwindow, this, _(VTRANSITION_FOLDER))); + folders.append(picon = new AssetPicon(mwindow, this, VTRANSITION_FOLDER)); picon->persistent = 1; - folders.append(picon = new AssetPicon(mwindow, this, _(LABEL_FOLDER))); + folders.append(picon = new AssetPicon(mwindow, this, LABEL_FOLDER)); picon->persistent = 1; - folders.append(picon = new AssetPicon(mwindow, this, _(CLIP_FOLDER))); + folders.append(picon = new AssetPicon(mwindow, this, CLIP_FOLDER)); picon->persistent = 1; - folders.append(picon = new AssetPicon(mwindow, this, _(MEDIA_FOLDER))); + folders.append(picon = new AssetPicon(mwindow, this, MEDIA_FOLDER)); picon->persistent = 1; create_label_folder(); diff --git a/cinelerra-5.1/cinelerra/edl.inc b/cinelerra-5.1/cinelerra/edl.inc index 96ab0e42..07e06c24 100644 --- a/cinelerra-5.1/cinelerra/edl.inc +++ b/cinelerra-5.1/cinelerra/edl.inc @@ -55,16 +55,16 @@ class EDL; // Mandatory folders -#define AEFFECT_FOLDER N_("Audio Effects") -#define VEFFECT_FOLDER N_("Video Effects") -#define ATRANSITION_FOLDER N_("Audio Transitions") -#define VTRANSITION_FOLDER N_("Video Transitions") +#define AEFFECT_FOLDER _("Audio Effects") +#define VEFFECT_FOLDER _("Video Effects") +#define ATRANSITION_FOLDER _("Audio Transitions") +#define VTRANSITION_FOLDER _("Video Transitions") -#define LABEL_FOLDER N_("Labels") +#define LABEL_FOLDER _("Labels") // Default folders -#define CLIP_FOLDER N_("Clips") -#define MEDIA_FOLDER N_("Media") +#define CLIP_FOLDER _("Clips") +#define MEDIA_FOLDER _("Media") diff --git a/cinelerra-5.1/cinelerra/gwindowgui.C b/cinelerra-5.1/cinelerra/gwindowgui.C index b1b8300c..5cf353ca 100644 --- a/cinelerra-5.1/cinelerra/gwindowgui.C +++ b/cinelerra-5.1/cinelerra/gwindowgui.C @@ -68,26 +68,26 @@ void GWindowGUI::start_color_thread(GWindowColorButton *color_button) const char *GWindowGUI::other_text[NON_AUTOMATION_TOTAL] = { - "Assets", - "Titles", - "Transitions", - "Plugin Autos" + N_("Assets"), + N_("Titles"), + N_("Transitions"), + N_("Plugin Autos") }; const char *GWindowGUI::auto_text[AUTOMATION_TOTAL] = { - "Mute", - "Camera X", - "Camera Y", - "Camera Z", - "Projector X", - "Projector Y", - "Projector Z", - "Fade", - "Pan", - "Mode", - "Mask", - "Speed" + N_("Mute"), + N_("Camera X"), + N_("Camera Y"), + N_("Camera Z"), + N_("Projector X"), + N_("Projector Y"), + N_("Projector Z"), + N_("Fade"), + N_("Pan"), + N_("Mode"), + N_("Mask"), + N_("Speed") }; int GWindowGUI::auto_colors[AUTOMATION_TOTAL] = @@ -369,7 +369,7 @@ void GWindowGUI::create_objects() case AUTOMATION_PAN: vframe = mwindow->theme->pankeyframe_data; break; case AUTOMATION_MASK: vframe = mwindow->theme->maskkeyframe_data; break; } - const char *label = tp->isauto ? auto_text[tp->ref] : other_text[tp->ref] ; + const char *label = _(tp->isauto ? auto_text[tp->ref] : other_text[tp->ref]); int color = !tp->isauto ? -1 : auto_colors[tp->ref]; GWindowToggle *toggle = new GWindowToggle(mwindow, this, x, y, label, color, tp); add_tool(toggles[i] = toggle); diff --git a/cinelerra-5.1/cinelerra/overlayframe.inc b/cinelerra-5.1/cinelerra/overlayframe.inc index 05052de1..f29bc572 100644 --- a/cinelerra-5.1/cinelerra/overlayframe.inc +++ b/cinelerra-5.1/cinelerra/overlayframe.inc @@ -24,6 +24,83 @@ // Modes +/* +source +x = porter duff operator +g = good guy +a = android +* = hv 4.6.1 + +cin 5.1 overlayframe TRANSFER_MODEs +x DST [Da, Dc] +x DST_ATOP [Sa, Sc * (1 - Da) + Dc * Sa] +x DST_IN [Da * Sa, Dc * Sa] +x DST_OUT [Da * (1 - Sa), Dc * (1 - Sa)] +x DST_OVER [Sa * (1 - Da) + Da, Sc * (1 - Da) + Dc] +x SRC [Sa, Sc] +x SRC_ATOP [Da, Sc * Da + Dc * (1 - Sa)] +x SRC_IN [Sa * Da, Sc * Da] +x SRC_OUT [Sa * (1 - Da), Sc * (1 - Da)] +x SRC_OVER [Sa + Da * (1 - Sa), Sc + (1 - Sa) * Dc] +g OR [Sa + Da - Sa * Da, Sc + Dc - Sc * Dc] +a XOR [Sa * (1 - Da) + Da * (1 - Sa), Sc * (1 - Da) + Dc * (1 ­ Sa)] +* NORMAL [Sa + Da * (1 - Sa), Sc * Sa + Dc * (1 ­ Sa)]) +* ADDITION [(Sa + Da), (Sc + Dc)] +* SUBTRACT [(Sa - Da), (Sc ­ Dc)] +* MULTIPLY [(Sa * Da), Sc * Dc] +* DIVIDE [(Sa / Da), (Sc / Dc)] +* REPLACE [Sa, Sc] (fade = 1) +* MAX [max(Sa, Da), MAX(Sc, Dc)] +* MIN [min(Sa, Da), MIN(Sc, Dc)] +g AVERAGE [(Sa + Da) * 0.5, (Sc + Dc) * 0.5] +a DARKEN [Sa + Da - Sa*Da, Sc*(1 - Da) + Dc*(1 - Sa) + min(Sc, Dc)] +a LIGHTEN [Sa + Da - Sa*Da, Sc*(1 - Da) + Dc*(1 - Sa) + max(Sc, Dc)] + +https://developer.android.com/reference/android/graphics/PorterDuff.Mode.html + ADD Saturate(S + D) + CLEAR [0, 0] + DARKEN [Sa + Da - Sa*Da, Sc*(1 - Da) + Dc*(1 - Sa) + min(Sc, Dc)] + DST [Da, Dc] + DST_ATOP [Sa, Sa * Dc + Sc * (1 - Da)] + DST_IN [Sa * Da, Sa * Dc] + DST_OUT [Da * (1 - Sa), Dc * (1 - Sa)] + DST_OVER [Sa + (1 - Sa)*Da, Rc = Dc + (1 - Da)*Sc] + LIGHTEN [Sa + Da - Sa*Da, Sc*(1 - Da) + Dc*(1 - Sa) + max(Sc, Dc)] + MULTIPLY [Sa * Da, Sc * Dc] + OVERLAY (defined, but unspecified in android) + SCREEN [Sa + Da - Sa * Da, Sc + Dc - Sc * Dc] + SRC [Sa, Sc] + SRC_ATOP [Da, Sc * Da + (1 - Sa) * Dc] + SRC_IN [Sa * Da, Sc * Da] + SRC_OUT [Sa * (1 - Da), Sc * (1 - Da)] + SRC_OVER [Sa + (1 - Sa)*Da, Rc = Sc + (1 - Sa)*Dc] + XOR [Sa + Da - 2 * Sa * Da, Sc * (1 - Da) + (1 - Sa) * Dc] + +https://docs.gimp.org/2.6/en/gimp-concepts-layer-modes.html + Normal [M] + Dissolve [I + dots] + Multiply [M * I] + Divide [I / M] + Screen [1 - (1-M)*(1-I)] + Overlay [I * (I + 2*M*(1-I))] + Dodge [I / (1-M)] + Burn [1 - (1-I) / M] + Hard light [M>0.5 ? (1 - (1-2*(M-0.5))*(1 - I) : 2*M*I] + Soft light [((1-I)*M + Screen()) * I] + Grain extract [I - M + 0.5] + Grain merge [I + M - 0.5] + Difference [abs(I-M)] + Addition [min((I+M),1.0)] + Subtract [max((I-M),0.0)] + Darken only [min(M,I)] + Lighten only [max(M,I)] + Hue [hue(M) + sat(I)+val(I)] + Saturation [sat(M) + hue(I)+val(I)] + Color [hue(M)+sat(M) + val(I)] + Value [val(M) + sat(I)+hue(I)] + +*/ + #define TRANSFER_TYPES 23 #define TRANSFER_NORMAL 0 diff --git a/cinelerra-5.1/cinelerra/preferencesthread.C b/cinelerra-5.1/cinelerra/preferencesthread.C index 853c7a70..d02f9ad4 100644 --- a/cinelerra-5.1/cinelerra/preferencesthread.C +++ b/cinelerra-5.1/cinelerra/preferencesthread.C @@ -127,10 +127,17 @@ BC_Window* PreferencesThread::new_gui() int scr_w = mwindow->gui->get_screen_w(0, -1); int scr_h = mwindow->gui->get_screen_h(0, -1); - int x = scr_x + scr_w / 2 - WIDTH / 2; - int y = scr_h / 2 - HEIGHT / 2; + int w = WIDTH, h = HEIGHT; + int min_w = mwindow->theme->preferencescategory_x; + for(int i = 0; i < CATEGORIES; i++) { + min_w += PreferencesButton::calculate_w(mwindow->gui, category_to_text(i)) - + mwindow->theme->preferences_category_overlap; + } + if( w < min_w ) w = min_w; + int x = scr_x + scr_w / 2 - w / 2; + int y = scr_h / 2 - h / 2; - window = new PreferencesWindow(mwindow, this, x, y); + window = new PreferencesWindow(mwindow, this, x, y, w, h); window->create_objects(); mwindow->gui->unlock_window(); @@ -357,11 +364,8 @@ SET_TRACE PreferencesWindow::PreferencesWindow(MWindow *mwindow, - PreferencesThread *thread, - int x, - int y) - : BC_Window(_(PROGRAM_NAME ": Preferences"), - x,y, WIDTH,HEIGHT, WIDTH,HEIGHT, 1,0,1) + PreferencesThread *thread, int x, int y, int w, int h) + : BC_Window(_(PROGRAM_NAME ": Preferences"), x,y, w,h, 1,0,1) { this->mwindow = mwindow; this->thread = thread; diff --git a/cinelerra-5.1/cinelerra/preferencesthread.h b/cinelerra-5.1/cinelerra/preferencesthread.h index 4de6aa8a..a2437018 100644 --- a/cinelerra-5.1/cinelerra/preferencesthread.h +++ b/cinelerra-5.1/cinelerra/preferencesthread.h @@ -113,8 +113,7 @@ class PreferencesWindow : public BC_Window public: PreferencesWindow(MWindow *mwindow, PreferencesThread *thread, - int x, - int y); + int x, int y, int w, int h); ~PreferencesWindow(); void create_objects(); diff --git a/cinelerra-5.1/plugins/cdripper/cdripwindow.C b/cinelerra-5.1/plugins/cdripper/cdripwindow.C index 8bb88ac2..94dd5b4e 100644 --- a/cinelerra-5.1/plugins/cdripper/cdripwindow.C +++ b/cinelerra-5.1/plugins/cdripper/cdripwindow.C @@ -41,12 +41,12 @@ void CDRipWindow::create_objects() int y = 10, x = 10; add_tool(new BC_Title(x, y, _("Select the range to transfer:"))); y += 25; add_tool(new BC_Title(x, y, _("Track"))); x += 70; - add_tool(new BC_Title(x, y, _("Min"))); x += 70; - add_tool(new BC_Title(x, y, _("Sec"))); x += 100; + add_tool(new BC_Title(x, y, _("Min."))); x += 70; + add_tool(new BC_Title(x, y, _("Sec."))); x += 100; add_tool(new BC_Title(x, y, _("Track"))); x += 70; - add_tool(new BC_Title(x, y, _("Min"))); x += 70; - add_tool(new BC_Title(x, y, _("Sec"))); x += 100; + add_tool(new BC_Title(x, y, _("Min."))); x += 70; + add_tool(new BC_Title(x, y, _("Sec."))); x += 100; x = 10; y += 25; add_tool(track1 = new CDRipTextValue(this, &(cdripper->track1), x, y, 50)); -- 2.26.2