From: Good Guy Date: Wed, 26 Jul 2017 00:35:46 +0000 (-0600) Subject: picon dirs, new cinfinity picons, plugin info, rework text drawing, show msg, compres... X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=b78e8ac7987fbf35a4ba60534c4a3d2b290562b9;p=goodguy%2Fhistory.git picon dirs, new cinfinity picons, plugin info, rework text drawing, show msg, compressor fix --- diff --git a/cinelerra-5.1/Makefile.am b/cinelerra-5.1/Makefile.am index 7e001030..a6426923 100644 --- a/cinelerra-5.1/Makefile.am +++ b/cinelerra-5.1/Makefile.am @@ -36,6 +36,7 @@ binstall: install-recursive > "bin/applications/$(WANT_CIN).desktop" cp -a image/cin.svg "bin/pixmaps/$(WANT_CIN)".svg cp -a image/cin.xpm "bin/pixmaps/$(WANT_CIN)".xpm + for d in picon*; do cp -a $$d/. bin/plugins/$$d/.; done cp -a db/utils/new_db "bin/cin_db" buninstall: diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index 272bfea8..13e7164d 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -163,13 +163,14 @@ AssetPicon::AssetPicon(MWindow *mwindow, } AssetPicon::AssetPicon(MWindow *mwindow, - AWindowGUI *gui, int folder) + AWindowGUI *gui, int folder, int persist) : BC_ListBoxItem(_(AWindowGUI::folder_names[folder]), gui->folder_icon) { reset(); foldernum = folder; this->mwindow = mwindow; this->gui = gui; + persistent = persist; } AssetPicon::AssetPicon(MWindow *mwindow, @@ -464,22 +465,19 @@ AWindowGUI::~AWindowGUI() displayed_assets[1].remove_all_objects(); delete vicon_thread; - delete file_icon; - delete audio_icon; - delete video_icon; - delete folder_icon; - delete clip_icon; - delete label_icon; - delete atransition_icon; - delete vtransition_icon; - delete aeffect_icon; - delete ladspa_icon; - delete ladspa_vframe; - delete ff_aud_icon; - delete ff_aud_vframe; - delete ff_vid_icon; - delete ff_vid_vframe; - delete veffect_icon; + delete file_icon; delete file_res; + delete audio_icon; delete audio_res; + delete video_icon; delete video_res; + delete folder_icon; delete folder_res; + delete clip_icon; delete clip_res; + delete label_icon; delete label_res; + delete atransition_icon; delete atrans_res; + delete vtransition_icon; delete vtrans_res; + delete aeffect_icon; delete aeffect_res; + delete veffect_icon; delete veffect_res; + delete ladspa_icon; delete ladspa_res; + delete ff_aud_icon; delete ff_aud_res; + delete ff_vid_icon; delete ff_vid_res; delete newfolder_thread; delete asset_menu; delete clip_menu; @@ -489,7 +487,7 @@ AWindowGUI::~AWindowGUI() delete cliplist_menu; delete labellist_menu; delete folderlist_menu; - if( temp_picon ) delete temp_picon; + delete temp_picon; delete remove_plugin; } @@ -510,10 +508,48 @@ bool AWindowGUI::protected_pixmap(BC_Pixmap *icon) icon == ff_vid_icon; } -void AWindowGUI::create_objects() +VFrame *AWindowGUI::get_picon(const char *name, const char *plugin_icons) +{ + char png_path[BCTEXTLEN]; + char *pp = png_path, *ep = pp + sizeof(png_path)-1; + pp += snprintf(pp, ep-pp, "%s/picon", File::get_plugin_path()); + if( strcmp(DEFAULT_PICON, plugin_icons) ) + pp += snprintf(pp, ep-pp, "_%s", plugin_icons); + pp += snprintf(pp, ep-pp, "/%s.png", name); + return VFramePng::vframe_png(png_path,0,0); +} + +VFrame *AWindowGUI::get_picon(const char *name) { - AssetPicon *picon; + VFrame *vframe = get_picon(name, mwindow->preferences->plugin_icons); + if( !vframe ) vframe = get_picon(name, DEFAULT_PICON); + return vframe; +} +VFrame *AWindowGUI::resource_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn, int idx) +{ + VFrame *ret = vfrm = get_picon(fn); + if( !ret ) vfrm = BC_WindowBase::get_resources()->type_to_icon[idx]; + icon = new BC_Pixmap(this, vfrm, PIXMAP_ALPHA); + return ret; +} +VFrame *AWindowGUI::theme_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn) +{ + VFrame *ret = vfrm = get_picon(fn); + if( !ret ) vfrm = mwindow->theme->get_image(fn); + icon = new BC_Pixmap(this, vfrm, PIXMAP_ALPHA); + return ret; +} +VFrame *AWindowGUI::plugin_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn, unsigned char *png) +{ + VFrame *ret = vfrm = get_picon(fn); + if( !ret ) vfrm = new VFramePng(png); + icon = new BC_Pixmap(this, vfrm, PIXMAP_ALPHA); + return vfrm; +} + +void AWindowGUI::create_objects() +{ lock_window("AWindowGUI::create_objects"); SET_TRACE //printf("AWindowGUI::create_objects 1\n"); @@ -521,64 +557,34 @@ SET_TRACE asset_titles[1] = _("Comments"); SET_TRACE - set_icon(mwindow->theme->get_image("awindow_icon")); - file_icon = new BC_Pixmap(this, - BC_WindowBase::get_resources()->type_to_icon[ICON_UNKNOWN], - PIXMAP_ALPHA); - - folder_icon = new BC_Pixmap(this, - BC_WindowBase::get_resources()->type_to_icon[ICON_FOLDER], - PIXMAP_ALPHA); - - audio_icon = new BC_Pixmap(this, - BC_WindowBase::get_resources()->type_to_icon[ICON_SOUND], - PIXMAP_ALPHA); - video_icon = new BC_Pixmap(this, - BC_WindowBase::get_resources()->type_to_icon[ICON_FILM], - PIXMAP_ALPHA); + file_res = resource_icon(file_vframe, file_icon, "film_icon", ICON_UNKNOWN); + folder_res = resource_icon(folder_vframe, folder_icon, "folder_icon", ICON_FOLDER); + audio_res = resource_icon(audio_vframe, audio_icon, "audio_icon", ICON_SOUND); + video_res = resource_icon(video_vframe, video_icon, "video_icon", ICON_FILM); + label_res = resource_icon(label_vframe, label_icon, "label_icon", ICON_LABEL); - label_icon = new BC_Pixmap(this, - BC_WindowBase::get_resources()->type_to_icon[ICON_LABEL], - PIXMAP_ALPHA); - -SET_TRACE + clip_res = theme_icon(clip_vframe, clip_icon, "clip_icon"); + atrans_res = theme_icon(atransition_vframe, atransition_icon, "atransition_icon"); + vtrans_res = theme_icon(vtransition_vframe, vtransition_icon, "vtransition_icon"); + aeffect_res = theme_icon(aeffect_vframe, aeffect_icon, "aeffect_icon"); + veffect_res = theme_icon(veffect_vframe, veffect_icon, "veffect_icon"); - clip_vframe = mwindow->theme->get_image("clip_icon"); - clip_icon = new BC_Pixmap(this, clip_vframe, PIXMAP_ALPHA); - atransition_vframe = mwindow->theme->get_image("atransition_icon"); - atransition_icon = new BC_Pixmap(this, atransition_vframe, PIXMAP_ALPHA); - vtransition_vframe = mwindow->theme->get_image("vtransition_icon"); - vtransition_icon = new BC_Pixmap(this, vtransition_vframe, PIXMAP_ALPHA); - aeffect_vframe = mwindow->theme->get_image("aeffect_icon"); - aeffect_icon = new BC_Pixmap(this, aeffect_vframe, PIXMAP_ALPHA); - ladspa_vframe = new VFramePng(lad_picon_png); - ladspa_icon = new BC_Pixmap(this, ladspa_vframe, PIXMAP_ALPHA); - ff_aud_vframe = new VFramePng(ff_audio_png); - ff_aud_icon = new BC_Pixmap(this, ff_aud_vframe, PIXMAP_ALPHA); - ff_vid_vframe = new VFramePng(ff_video_png); - ff_vid_icon = new BC_Pixmap(this, ff_vid_vframe, PIXMAP_ALPHA); - veffect_vframe = mwindow->theme->get_image("veffect_icon"); - veffect_icon = new BC_Pixmap(this, veffect_vframe, PIXMAP_ALPHA); + ladspa_res = plugin_icon(ladspa_vframe, ladspa_icon, "lad_picon", lad_picon_png); + ff_aud_res = plugin_icon(ff_aud_vframe, ff_aud_icon, "ff_audio", ff_audio_png); + ff_vid_res = plugin_icon(ff_vid_vframe, ff_vid_icon, "ff_video", ff_video_png); SET_TRACE // Mandatory folders - folders.append(picon = new AssetPicon(mwindow, this, AW_AEFFECT_FOLDER)); - picon->persistent = 1; - folders.append(picon = new AssetPicon(mwindow, this, AW_VEFFECT_FOLDER)); - picon->persistent = 1; - folders.append(picon = new AssetPicon(mwindow, this, AW_ATRANSITION_FOLDER)); - picon->persistent = 1; - folders.append(picon = new AssetPicon(mwindow, this, AW_VTRANSITION_FOLDER)); - picon->persistent = 1; - folders.append(picon = new AssetPicon(mwindow, this, AW_LABEL_FOLDER)); - picon->persistent = 1; - folders.append(picon = new AssetPicon(mwindow, this, AW_CLIP_FOLDER)); - picon->persistent = 1; - folders.append(picon = new AssetPicon(mwindow, this, AW_MEDIA_FOLDER)); - picon->persistent = 1; + folders.append(new AssetPicon(mwindow, this, AW_AEFFECT_FOLDER, 1)); + folders.append(new AssetPicon(mwindow, this, AW_VEFFECT_FOLDER, 1)); + folders.append(new AssetPicon(mwindow, this, AW_ATRANSITION_FOLDER, 1)); + folders.append(new AssetPicon(mwindow, this, AW_VTRANSITION_FOLDER, 1)); + folders.append(new AssetPicon(mwindow, this, AW_LABEL_FOLDER, 1)); + folders.append(new AssetPicon(mwindow, this, AW_CLIP_FOLDER, 1)); + folders.append(new AssetPicon(mwindow, this, AW_MEDIA_FOLDER, 1)); create_label_folder(); SET_TRACE @@ -947,7 +953,7 @@ void AWindowGUI::update_folder_list() if( !exists ) { int aw_folder = folder_number(folder); AssetPicon *picon = aw_folder >= 0 ? - new AssetPicon(mwindow, this, aw_folder) : + new AssetPicon(mwindow, this, aw_folder, 0) : new AssetPicon(mwindow, this, folder, AW_USER_FOLDER); picon->create_objects(); folders.append(picon); diff --git a/cinelerra-5.1/cinelerra/awindowgui.h b/cinelerra-5.1/cinelerra/awindowgui.h index 165e201f..62e86597 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.h +++ b/cinelerra-5.1/cinelerra/awindowgui.h @@ -50,7 +50,7 @@ public: AssetPicon(MWindow *mwindow, AWindowGUI *gui, EDL *edl); AssetPicon(MWindow *mwindow, AWindowGUI *gui, PluginServer *plugin); AssetPicon(MWindow *mwindow, AWindowGUI *gui, Label *plugin); - AssetPicon(MWindow *mwindow, AWindowGUI *gui, int folder); + AssetPicon(MWindow *mwindow, AWindowGUI *gui, int folder, int persist); AssetPicon(MWindow *mwindow, AWindowGUI *gui, const char *folder_name, int folder_num); virtual ~AssetPicon(); @@ -167,6 +167,12 @@ public: void stop_vicon_drawing(); void update_picon(Indexable *indexable); + VFrame *get_picon(const char *name, const char *plugin_icons); + VFrame *get_picon(const char *name); + VFrame *resource_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn, int idx); + VFrame *theme_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn); + VFrame *plugin_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn, unsigned char *png); + MWindow *mwindow; AWindow *awindow; @@ -193,19 +199,19 @@ public: BC_Hash *defaults; // Persistent icons - BC_Pixmap *folder_icon; - BC_Pixmap *file_icon; - BC_Pixmap *audio_icon; - BC_Pixmap *video_icon; - BC_Pixmap *label_icon; - BC_Pixmap *clip_icon; VFrame *clip_vframe; - BC_Pixmap *atransition_icon; VFrame *atransition_vframe; - BC_Pixmap *vtransition_icon; VFrame *vtransition_vframe; - BC_Pixmap *aeffect_icon; VFrame *aeffect_vframe; - BC_Pixmap *ladspa_icon; VFrame *ladspa_vframe; - BC_Pixmap *ff_aud_icon; VFrame *ff_aud_vframe; - BC_Pixmap *ff_vid_icon; VFrame *ff_vid_vframe; - BC_Pixmap *veffect_icon; VFrame *veffect_vframe; + BC_Pixmap *folder_icon; VFrame *folder_res, *folder_vframe; + BC_Pixmap *file_icon; VFrame *file_res, *file_vframe; + BC_Pixmap *audio_icon; VFrame *audio_res, *audio_vframe; + BC_Pixmap *video_icon; VFrame *video_res, *video_vframe; + BC_Pixmap *label_icon; VFrame *label_res, *label_vframe; + BC_Pixmap *clip_icon; VFrame *clip_res, *clip_vframe; + BC_Pixmap *atransition_icon; VFrame *atrans_res, *atransition_vframe; + BC_Pixmap *vtransition_icon; VFrame *vtrans_res, *vtransition_vframe; + BC_Pixmap *aeffect_icon; VFrame *aeffect_res, *aeffect_vframe; + BC_Pixmap *veffect_icon; VFrame *veffect_res, *veffect_vframe; + BC_Pixmap *ladspa_icon; VFrame *ladspa_res, *ladspa_vframe; + BC_Pixmap *ff_aud_icon; VFrame *ff_aud_res, *ff_aud_vframe; + BC_Pixmap *ff_vid_icon; VFrame *ff_vid_res, *ff_vid_vframe; NewFolderThread *newfolder_thread; // Popup menus diff --git a/cinelerra-5.1/cinelerra/interfaceprefs.C b/cinelerra-5.1/cinelerra/interfaceprefs.C index c4771fc2..2b825013 100644 --- a/cinelerra-5.1/cinelerra/interfaceprefs.C +++ b/cinelerra-5.1/cinelerra/interfaceprefs.C @@ -202,7 +202,7 @@ void InterfacePrefs::create_objects() y1 = y + 5; y += 35; add_subwindow(title = new BC_Title(x, y, _("Keyframe reticle:"))); - x1 = x + 100; + x1 = x + 140; keyframe_reticle = new KeyframeReticle(x1, y, &pwindow->thread->preferences->keyframe_reticle); add_subwindow(keyframe_reticle); keyframe_reticle->create_objects(); @@ -244,6 +244,7 @@ void InterfacePrefs::create_objects() y += 25; add_subwindow(new BC_Title(x, y, _("Button 1:"))); + x1 = x + 100; ViewBehaviourText *text; add_subwindow(text = new ViewBehaviourText(x1, y - 5, behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[0]), @@ -284,16 +285,14 @@ void InterfacePrefs::create_objects() y += 30; ViewTheme *theme; add_subwindow(new BC_Title(x, y, _("Theme:"))); - x += 100; - add_subwindow(theme = new ViewTheme(x, y, pwindow)); + add_subwindow(theme = new ViewTheme(x1, y, pwindow)); theme->create_objects(); x = x0; y += theme->get_h() + 5; ViewPluginIcons *plugin_icons; add_subwindow(new BC_Title(x, y, _("Plugin Icons:"))); - x += 100; - add_subwindow(plugin_icons = new ViewPluginIcons(x, y, pwindow)); + add_subwindow(plugin_icons = new ViewPluginIcons(x1, y, pwindow)); plugin_icons->create_objects(); } diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 107ef166..ce48f124 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -1529,6 +1529,7 @@ SET_TRACE case FILE_NOT_FOUND: sprintf(string, _("Failed to open %s"), new_asset->path); gui->show_message(string, theme->message_error); + gui->update_default_message(); break; // Unknown format diff --git a/cinelerra-5.1/cinelerra/mwindowgui.C b/cinelerra-5.1/cinelerra/mwindowgui.C index 41882647..7587d46d 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.C +++ b/cinelerra-5.1/cinelerra/mwindowgui.C @@ -916,16 +916,19 @@ int MWindowGUI::visible(int64_t x1, int64_t x2, int64_t view_x1, int64_t view_x2 void MWindowGUI::show_message(const char *message, int color) { - statusbar->set_message(message, color); + statusbar->show_message(message, color); } -void MWindowGUI::set_default_message(const char *message) + +void MWindowGUI::update_default_message() { - statusbar->set_default_message(message); + statusbar->update_default_message(); } + void MWindowGUI::reset_default_message() { statusbar->reset_default_message(); } + void MWindowGUI::default_message() { statusbar->default_message(); diff --git a/cinelerra-5.1/cinelerra/mwindowgui.h b/cinelerra-5.1/cinelerra/mwindowgui.h index de21ee81..2d5fd10c 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.h +++ b/cinelerra-5.1/cinelerra/mwindowgui.h @@ -142,11 +142,10 @@ public: int menu_w(); int menu_h(); // Draw on the status bar only. - void show_message(const char *message, int color = -1); - void set_default_message(const char *message); + void show_message(const char *message, int color=-1); + void update_default_message(); void reset_default_message(); void default_message(); -// Pop up a box if the statusbar is taken and show an error. void show_error(char *message, int color = BLACK); int repeat_event(int64_t duration); // Entry point for drag events in all windows diff --git a/cinelerra-5.1/cinelerra/render.C b/cinelerra-5.1/cinelerra/render.C index be49dabb..34b5c7dc 100644 --- a/cinelerra-5.1/cinelerra/render.C +++ b/cinelerra-5.1/cinelerra/render.C @@ -495,7 +495,8 @@ void Render::stop_progress() sprintf(string2, _("Rendering took %s"), string); mwindow->gui->lock_window(""); - mwindow->gui->set_default_message(string2); + mwindow->gui->show_message(string2); + mwindow->gui->update_default_message(); mwindow->gui->stop_hourglass(); mwindow->gui->unlock_window(); } diff --git a/cinelerra-5.1/cinelerra/statusbar.C b/cinelerra-5.1/cinelerra/statusbar.C index 02b92d05..b7e97138 100644 --- a/cinelerra-5.1/cinelerra/statusbar.C +++ b/cinelerra-5.1/cinelerra/statusbar.C @@ -103,24 +103,25 @@ void StatusBar::resize_event() flash(0); } -void StatusBar::set_message(const char *text, int color) +void StatusBar::show_message(const char *text, int color) { if( color < 0 ) color = mwindow->theme->message_normal; status_text->set_color(color); status_text->update(text); } -void StatusBar::set_default_message(const char *text) +void StatusBar::reset_default_message() { - strcpy(default_msg, text); - default_message(); + status_color = -1; + strcpy(default_msg, _("Welcome to cinelerra")); } -void StatusBar::reset_default_message() +void StatusBar::update_default_message() { - set_default_message(_("Welcome to cinelerra")); + status_color = status_text->get_color(); + strcpy(default_msg, status_text->get_text()); } void StatusBar::default_message() { - set_message(default_msg, mwindow->theme->message_normal); + show_message(default_msg, status_color); } StatusBarCancel::StatusBarCancel(MWindow *mwindow, int x, int y) diff --git a/cinelerra-5.1/cinelerra/statusbar.h b/cinelerra-5.1/cinelerra/statusbar.h index 726a08c2..eac56594 100644 --- a/cinelerra-5.1/cinelerra/statusbar.h +++ b/cinelerra-5.1/cinelerra/statusbar.h @@ -34,8 +34,8 @@ public: StatusBar(MWindow *mwindow, MWindowGUI *gui); ~StatusBar(); - void set_message(const char *text, int color=-1); - void set_default_message(const char *text); + void show_message(const char *text, int color=-1); + void update_default_message(); void reset_default_message(); void default_message(); @@ -47,6 +47,7 @@ public: BC_ProgressBar *main_progress; StatusBarCancel *main_progress_cancel; BC_Title *status_text; + int status_color; char default_msg[BCTEXTLEN]; }; diff --git a/cinelerra-5.1/guicast/bcpopupmenu.C b/cinelerra-5.1/guicast/bcpopupmenu.C index 9d8e2c22..8421a6bf 100644 --- a/cinelerra-5.1/guicast/bcpopupmenu.C +++ b/cinelerra-5.1/guicast/bcpopupmenu.C @@ -291,6 +291,7 @@ int BC_PopupMenu::activate_menu() { if( !get_button_down() || !BC_WindowBase::get_resources()->popupmenu_btnup ) return menu_activate(); + top_level->active_popup_menu = this; pending = 1; return 0; } @@ -328,7 +329,7 @@ int BC_PopupMenu::menu_activate() popup_down = 1; if(use_title) draw_title(1); } - return 0; + return 1; } int BC_PopupMenu::deactivate_menu() diff --git a/cinelerra-5.1/guicast/bctextbox.C b/cinelerra-5.1/guicast/bctextbox.C index 2536cf7a..d377a448 100644 --- a/cinelerra-5.1/guicast/bctextbox.C +++ b/cinelerra-5.1/guicast/bctextbox.C @@ -697,7 +697,7 @@ void BC_TextBox::draw(int flush) int len = row_end - row_begin; if( len > 0 ) { set_color(enabled ? resources->text_default : DMGREY); - draw_wtext(text_x, k + text_ascent, wtext_row, len, 0); + draw_single_text(1, font, text_x, k + text_ascent, wtext_row, len); } // Get ibeam location diff --git a/cinelerra-5.1/guicast/bcwindowbase.h b/cinelerra-5.1/guicast/bcwindowbase.h index 0bcad162..5532ae49 100644 --- a/cinelerra-5.1/guicast/bcwindowbase.h +++ b/cinelerra-5.1/guicast/bcwindowbase.h @@ -397,7 +397,8 @@ public: BC_Pixmap *pixmap = 0, int is_utf8 = 0); void draw_xft_text(int x, int y, const wchar_t *text, int length, BC_Pixmap *pixmap); - void draw_wtext(int x, int y, const wchar_t *text, int length = -1, BC_Pixmap *pixmap = 0); + int draw_single_text(int draw, int font, + int x, int y, const wchar_t *text, int length = -1, BC_Pixmap *pixmap = 0); // truncate the text to a ... version that fits in the width, using the current_font void truncate_text(char *result, const char *text, int w); void draw_center_text(int x, int y, const char *text, int length = -1); diff --git a/cinelerra-5.1/guicast/bcwindowdraw.C b/cinelerra-5.1/guicast/bcwindowdraw.C index c5d904ea..cd28636f 100644 --- a/cinelerra-5.1/guicast/bcwindowdraw.C +++ b/cinelerra-5.1/guicast/bcwindowdraw.C @@ -232,15 +232,16 @@ void BC_WindowBase::draw_xft_text(int x, int y, { int dy = -1; const wchar_t *wsp = text, *wep = wsp + length; + int font = top_level->current_font; while( wsp < wep ) { const wchar_t *wcp = wsp; while( wcp < wep && *wcp != '\n' ) ++wcp; int len = wcp - wsp; if( len > 0 ) - draw_wtext(x, y, wsp, len, pixmap); + draw_single_text(1, font, x, y, wsp, len, pixmap); if( wcp >= wep ) break; if( dy < 0 ) - dy = get_text_height(top_level->current_font); + dy = get_text_height(font); y += dy; wsp = wcp + 1; } @@ -281,6 +282,12 @@ void BC_WindowBase::xft_draw_string(XftColor *xft_color, XftFont *xft_font, } int BC_WindowBase::get_single_text_width(int font, const wchar_t *text, int length) +{ + return draw_single_text(0, font, 0,0, text, length); +} + +int BC_WindowBase::draw_single_text(int draw, int font, + int x, int y, const wchar_t *text, int length, BC_Pixmap *pixmap) { if( length < 0 ) length = wcslen(text); @@ -293,10 +300,31 @@ int BC_WindowBase::get_single_text_width(int font, const wchar_t *text, int leng xp->byte1 = (unsigned char) (text[i] >> 8); xp->byte2 = (unsigned char) (text[i] & 0xff); } + if( draw ) { + XDrawString16(top_level->display, + pixmap ? pixmap->opaque_pixmap : this->pixmap->opaque_pixmap, + top_level->gc, x, y, xtext, length); + } return XTextWidth16(get_font_struct(font), xtext, length); } - int x = 0; + #ifdef HAVE_XFT + XftColor xft_color; + if( draw ) { + XRenderColor color; + color.red = (top_level->current_color & 0xff0000) >> 16; + color.red |= color.red << 8; + color.green = (top_level->current_color & 0xff00) >> 8; + color.green |= color.green << 8; + color.blue = (top_level->current_color & 0xff); + color.blue |= color.blue << 8; + color.alpha = 0xffff; + + XftColorAllocValue(top_level->display, top_level->vis, top_level->cmap, + &color, &xft_color); + } + + int x0 = x; XftFont *basefont = top_level->get_xft_struct(font); XftFont *curfont = 0, *altfont = 0; const wchar_t *up = text, *ubp = up, *uep = ubp + length; @@ -327,6 +355,10 @@ int BC_WindowBase::get_single_text_width(int font, const wchar_t *text, int leng xft_font = basefont; if( xft_font != curfont ) { if( curfont && up > ubp ) { + if( draw ) { + xft_draw_string(&xft_color, curfont, x, y, + (const FcChar32*)ubp, up-ubp, pixmap); + } XGlyphInfo extents; XftTextExtents32(top_level->display, curfont, (const FcChar32*)ubp, up-ubp, &extents); @@ -338,105 +370,22 @@ int BC_WindowBase::get_single_text_width(int font, const wchar_t *text, int leng } if( curfont && up > ubp ) { + if( draw ) { + xft_draw_string(&xft_color, curfont, x, y, + (const FcChar32*)ubp, up-ubp, pixmap); + } XGlyphInfo extents; XftTextExtents32(top_level->display, curfont, (const FcChar32*)ubp, up-ubp, &extents); x += extents.xOff; } - if( altfont ) - XftFontClose(top_level->display, altfont); -#endif - return x; -} - -void BC_WindowBase::draw_wtext(int x, int y, - const wchar_t *text, int length, BC_Pixmap *pixmap) -{ - if( length < 0 ) - length = wcslen(text); - if( !length ) return; - - int font = top_level->current_font; - if( !get_resources()->use_xft ) { - if( !get_font_struct(font) ) return; - XChar2b xtext[length], *xp = xtext; - for( int i=0; ibyte1 = (unsigned char) (text[i] >> 8); - xp->byte2 = (unsigned char) (text[i] & 0xff); - } - XDrawString16(top_level->display, - pixmap ? pixmap->opaque_pixmap : this->pixmap->opaque_pixmap, - top_level->gc, x, y, xtext, length); - return; - } - -#ifdef HAVE_XFT - XRenderColor color; - color.red = (top_level->current_color & 0xff0000) >> 16; - color.red |= color.red << 8; - color.green = (top_level->current_color & 0xff00) >> 8; - color.green |= color.green << 8; - color.blue = (top_level->current_color & 0xff); - color.blue |= color.blue << 8; - color.alpha = 0xffff; - - XftColor xft_color; - XftColorAllocValue(top_level->display, top_level->vis, top_level->cmap, - &color, &xft_color); - - XftFont *basefont = top_level->get_xft_struct(font); - XftFont *curfont = 0, *altfont = 0; - const wchar_t *up = text, *ubp = up, *uep = ubp + length; - - while( up < uep ) { - XftFont *xft_font = 0; - if( XftCharExists(top_level->display, basefont, *up) ) - xft_font = basefont; - else if( altfont ) { - if( XftCharExists(top_level->display, altfont, *up)) - xft_font = altfont; - else { - XftFontClose(top_level->display, altfont); - altfont = 0; - } - } - if( !xft_font ) { - FcPattern *pattern = BC_Resources::find_similar_font(*up, basefont->pattern); - if( pattern != 0 ) { - double psize = 0; - FcPatternGetDouble(basefont->pattern, FC_PIXEL_SIZE, 0, &psize); - FcPatternAddDouble(pattern, FC_PIXEL_SIZE, psize); - FcPatternDel(pattern, FC_SCALABLE); - xft_font = altfont = XftFontOpenPattern(top_level->display, pattern); - } - } - if( !xft_font ) - xft_font = basefont; - if( xft_font != curfont ) { - if( curfont && up > ubp ) { - xft_draw_string(&xft_color, curfont, x, y, - (const FcChar32*)ubp, up-ubp, pixmap); - XGlyphInfo extents; - XftTextExtents32(top_level->display, curfont, - (const FcChar32*)ubp, up-ubp, &extents); - x += extents.xOff; - } - ubp = up; curfont = xft_font; - } - ++up; - } - - if( curfont && up > ubp ) { - xft_draw_string(&xft_color, curfont, x, y, - (const FcChar32*)ubp, up-ubp, pixmap); - } - if( altfont ) XftFontClose(top_level->display, altfont); XftColorFree(top_level->display, top_level->vis, top_level->cmap, &xft_color); #endif + return x - x0; } void BC_WindowBase::truncate_text(char *result, const char *text, int w) diff --git a/cinelerra-5.1/info/plugins.txt b/cinelerra-5.1/info/plugins.txt index edc32cec..94c0e689 100644 --- a/cinelerra-5.1/info/plugins.txt +++ b/cinelerra-5.1/info/plugins.txt @@ -419,7 +419,8 @@ F_volume: Change input volume. #4 x 4 pole allpass: #Artificial latency: #Audio Divider (Suboctave Generator): -#AudioScope: +AudioScope: Convert input audio to video output representing the + audio power spectrum. Shows you the sound wave. #Auto phaser: #Barry's Satan Maximiser: #Bode frequency shifter: @@ -430,7 +431,9 @@ F_volume: Change input volume. #Comb delay line, cubic spline interpolation: #Comb delay line, linear interpolation: #Comb delay line, noninterpolating: -#Compressor: +Compressor: Lessen the dynamic range between the loudest and quietest + parts of an audio signal by boosting the quieter signals + and attenuating the louder signals. #Constant Signal Generator: #Crossfade: #Crossfade (4 outs): @@ -442,10 +445,10 @@ F_volume: Change input volume. #DJ flanger: #Decimator: #Declipper: -#Delay audio: +Delay audio: Delay the audio by some number of seconds. #Delayorama: -#Denoise: -#DenoiseFFT: +Denoise: Reduce audio background noise. +DenoiseFFT: Noise removal from audio using FFT editing. #Despike: #Diode Processor: #Dyson compressor: @@ -453,7 +456,7 @@ F_volume: Change input volume. #EQ Parametric: Echo: Add echo - reflection of sound - for effect. . Level represents the volume adjustment - . Atten is attenuation meaning a reduction in reflection + . Atten is attenuation meaning reduction in reflection . Offset is the lag in the attenuated echo signal EchoCancel: Removes echoes from audio to improve the quality. Recommended to just set the Mode to On for simplicity. @@ -515,7 +518,9 @@ Pitch shift: Uses FFT to try to change the pitch without #Remove Gaps: #ResampleRT: #Retro Flanger: -#Reverb: +Reverb: Reflections of sound to add depth and fullness. + Simulates creation of a large number of reflections + which build up and then decay. #Reverse Delay (5s max): Reverse audio: Play the audio backwards. #Ringmod with LFO: @@ -552,3 +557,22 @@ Reverse audio: Play the audio backwards. #VyNil (Vinyl Effect): #Wave Terrain Oscillator: #z-1: +# +# Transitions - Audio and Video +# +Crossfade: Creates a smooth transition from one audio source + edit to another. The crossfade has the first + source fade out while the second fades in. +BandSlide: Bands slide across video and you see the image slide. +BandWipe: Bands wipe across the video and you see the mask slides. +Dissolve: A soft dissolve transition between two video segments, + The left segment turns more transparent while at the + same time the right segment materializes into place. +Flash: The video flashes when transitioning between segments. +IrisSquare: Video switches segments via a small rectangular view + that gradually grows to full size. +Shape Wipe: Wipe a specific shape across the video. Available + shapes are: circle, clock, heart, tile2x2h, tile2x2v. +Slide: Image slides into view - can set: Left/Right/In/Out. +Wipe: Wipe the image across screen starting left or right. +Zoom: Zoom out video at X/Y magnification for some seconds. diff --git a/cinelerra-5.1/picon_cinfinity/ff_audio.png b/cinelerra-5.1/picon_cinfinity/ff_audio.png new file mode 100644 index 00000000..60dde317 Binary files /dev/null and b/cinelerra-5.1/picon_cinfinity/ff_audio.png differ diff --git a/cinelerra-5.1/picon_cinfinity/ff_video.png b/cinelerra-5.1/picon_cinfinity/ff_video.png new file mode 100644 index 00000000..a26b8e97 Binary files /dev/null and b/cinelerra-5.1/picon_cinfinity/ff_video.png differ diff --git a/cinelerra-5.1/picon_cinfinity/lad_picon.png b/cinelerra-5.1/picon_cinfinity/lad_picon.png new file mode 100644 index 00000000..2efaeb5f Binary files /dev/null and b/cinelerra-5.1/picon_cinfinity/lad_picon.png differ diff --git a/cinelerra-5.1/plugins/compressor/compressor.C b/cinelerra-5.1/plugins/compressor/compressor.C index 9797bc3d..54405a4c 100644 --- a/cinelerra-5.1/plugins/compressor/compressor.C +++ b/cinelerra-5.1/plugins/compressor/compressor.C @@ -1071,6 +1071,7 @@ CompressorCanvas::CompressorCanvas(CompressorEffect *plugin, int x, int y, int w { this->plugin = plugin; current_operation = NONE; + current_point = 0; } int CompressorCanvas::button_press_event()