From: Good Guy Date: Sat, 8 Jul 2017 17:44:23 +0000 (-0600) Subject: clip fixes, ladspa build fixes X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=4d2d052cc767103a8699b1de0e3a1f36844ac04f;p=goodguy%2Fhistory.git clip fixes, ladspa build fixes --- diff --git a/cinelerra-5.1/cinelerra/assetpopup.C b/cinelerra-5.1/cinelerra/assetpopup.C index f85b05c0..478b4568 100644 --- a/cinelerra-5.1/cinelerra/assetpopup.C +++ b/cinelerra-5.1/cinelerra/assetpopup.C @@ -59,8 +59,8 @@ AssetPopup::~AssetPopup() void AssetPopup::create_objects() { -// add_item(format = new AssetListFormat(mwindow)); add_item(info = new AssetPopupInfo(mwindow, this)); + add_item(format = new AssetListFormat(mwindow)); add_item(new AssetPopupSort(mwindow, this)); add_item(index = new AssetPopupBuildIndex(mwindow, this)); add_item(view = new AssetPopupView(mwindow, this)); @@ -119,7 +119,7 @@ void AssetPopup::match_all() int AssetPopup::update() { -// format->update(); + format->update(); gui->collect_assets(); return 0; } diff --git a/cinelerra-5.1/cinelerra/assetpopup.h b/cinelerra-5.1/cinelerra/assetpopup.h index 49c06c19..8bb458f9 100644 --- a/cinelerra-5.1/cinelerra/assetpopup.h +++ b/cinelerra-5.1/cinelerra/assetpopup.h @@ -59,7 +59,7 @@ public: AssetPopupBuildIndex *index; AssetPopupView *view; AssetPopupViewWindow *view_window; -// AssetListFormat *format; + AssetListFormat *format; }; class AssetPopupInfo : public BC_MenuItem diff --git a/cinelerra-5.1/cinelerra/cwindowgui.C b/cinelerra-5.1/cinelerra/cwindowgui.C index e676fc8b..9301f19d 100644 --- a/cinelerra-5.1/cinelerra/cwindowgui.C +++ b/cinelerra-5.1/cinelerra/cwindowgui.C @@ -713,13 +713,16 @@ CWrapper(set_inpoint) CWrapper(set_outpoint) CWrapper(clear_inpoint) CWrapper(clear_outpoint) -CWrapper(to_clip) CWrapper(toggle_label) CWrapper(prev_label) CWrapper(next_label) CWrapper(prev_edit) CWrapper(next_edit) +void CWindowEditing::to_clip() +{ + mwindow->to_clip(_("composer window: ")); +} CWindowMeters::CWindowMeters(MWindow *mwindow, diff --git a/cinelerra-5.1/cinelerra/editpanel.C b/cinelerra-5.1/cinelerra/editpanel.C index e8234210..dadae3d9 100644 --- a/cinelerra-5.1/cinelerra/editpanel.C +++ b/cinelerra-5.1/cinelerra/editpanel.C @@ -639,13 +639,6 @@ void EditPanel::clear_outpoint() mwindow->delete_outpoint(); } -void EditPanel::to_clip() -{ - subwindow->unlock_window(); - mwindow->to_clip(); - subwindow->lock_window("EditPanel::to_clip"); -} - EditInPoint::EditInPoint(MWindow *mwindow, EditPanel *panel, int x, int y) : BC_Button(x, y, mwindow->theme->get_image_set("inbutton")) diff --git a/cinelerra-5.1/cinelerra/editpanel.h b/cinelerra-5.1/cinelerra/editpanel.h index e4e0ab7e..24cea3b7 100644 --- a/cinelerra-5.1/cinelerra/editpanel.h +++ b/cinelerra-5.1/cinelerra/editpanel.h @@ -442,7 +442,7 @@ public: virtual void set_outpoint(); virtual void clear_inpoint(); virtual void clear_outpoint(); - virtual void to_clip(); + virtual void to_clip() = 0; virtual void toggle_label(); virtual void prev_label(); virtual void next_label(); diff --git a/cinelerra-5.1/cinelerra/mbuttons.C b/cinelerra-5.1/cinelerra/mbuttons.C index a91c0cbc..a310aa63 100644 --- a/cinelerra-5.1/cinelerra/mbuttons.C +++ b/cinelerra-5.1/cinelerra/mbuttons.C @@ -133,4 +133,12 @@ MainEditing::MainEditing(MWindow *mwindow, MButtons *mbuttons, int x, int y) this->mbuttons = mbuttons; } +void MainEditing::to_clip() +{ + MWindowGUI *gui = mwindow->gui; + gui->unlock_window(); + mwindow->to_clip(_("main window: ")); + gui->lock_window("MainEditing::to_clip"); +} + diff --git a/cinelerra-5.1/cinelerra/mbuttons.h b/cinelerra-5.1/cinelerra/mbuttons.h index 559aecf3..bc8f8a64 100644 --- a/cinelerra-5.1/cinelerra/mbuttons.h +++ b/cinelerra-5.1/cinelerra/mbuttons.h @@ -81,6 +81,7 @@ class MainEditing : public EditPanel public: MainEditing(MWindow *mwindow, MButtons *mbuttons, int x, int y); virtual ~MainEditing() {} + void to_clip(); MWindow *mwindow; MButtons *mbuttons; diff --git a/cinelerra-5.1/cinelerra/mwindow.h b/cinelerra-5.1/cinelerra/mwindow.h index 041953cd..4f49de7b 100644 --- a/cinelerra-5.1/cinelerra/mwindow.h +++ b/cinelerra-5.1/cinelerra/mwindow.h @@ -466,7 +466,8 @@ public: // Synchronize EDL settings with all playback engines depending on current // operation. Doesn't redraw anything. void sync_parameters(int change_type = CHANGE_PARAMS); - void to_clip(); + void to_clip(EDL *edl, const char *txt); + void to_clip(const char *txt); int toggle_label(int is_mwindow); void undo_entry(BC_WindowBase *calling_window_gui); void redo_entry(BC_WindowBase *calling_window_gui); diff --git a/cinelerra-5.1/cinelerra/mwindowedit.C b/cinelerra-5.1/cinelerra/mwindowedit.C index 8ec7d076..0c8ad109 100644 --- a/cinelerra-5.1/cinelerra/mwindowedit.C +++ b/cinelerra-5.1/cinelerra/mwindowedit.C @@ -34,6 +34,7 @@ #include "bchash.h" #include "edl.h" #include "edlsession.h" +#include "filesystem.h" #include "filexml.h" #include "floatauto.h" #include "floatautos.h" @@ -2348,7 +2349,7 @@ void MWindow::splice(EDL *source) sync_parameters(CHANGE_EDL); } -void MWindow::to_clip() +void MWindow::to_clip(EDL *edl, const char *txt) { FileXML file; double start, end; @@ -2357,36 +2358,57 @@ void MWindow::to_clip() start = edl->local_session->get_selectionstart(); end = edl->local_session->get_selectionend(); - if(EQUIV(end, start)) - { + if(EQUIV(end, start)) { start = 0; end = edl->tracks->total_length(); } // Don't copy all since we don't want the clips twice. - edl->copy(start, - end, - 0, - 0, - 0, - &file, - "", - 1); - + edl->copy(start, end, 0, 0, 0, &file, "", 1); EDL *new_edl = new EDL(edl); new_edl->create_objects(); new_edl->load_xml(&file, LOAD_ALL); sprintf(new_edl->local_session->clip_title, _("Clip %d"), session->clip_number++); - char string[BCTEXTLEN]; - Units::totext(string, - end - start, + char duration[BCTEXTLEN]; + Units::totext(duration, end - start, edl->session->time_format, edl->session->sample_rate, edl->session->frame_rate, edl->session->frames_per_foot); - sprintf(new_edl->local_session->clip_notes, _("%s\nCreated from main window"), string); + const char *path = edl->path; + Track *track=edl->tracks->first; + for(; (!path || !*path) && track; track=track->next ) { + if( !track->record ) continue; + Edit *edit = track->edits->editof(start, PLAY_FORWARD, 0); + if( !edit ) continue; + Indexable *indexable = edit->get_source(); + if( !indexable ) continue; + path = indexable->path; + } + + time_t now; time(&now); + struct tm *tm = localtime(&now); + char *cp = new_edl->local_session->clip_notes; + int n, sz = sizeof(new_edl->local_session->clip_notes)-1; + if( txt && *txt ) { + n = snprintf(cp, sz, "%s", txt); + cp += n; sz -= n; + } + n = snprintf(cp, sz, + "%02d/%02d/%02d %02d:%02d:%02d, +%s\n", + tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, + tm->tm_hour, tm->tm_min, tm->tm_sec, duration); + cp += n; sz -= n; + if( path && *path ) { + FileSystem fs; + char title[BCTEXTLEN]; + fs.extract_name(title, path); + n = snprintf(cp, sz, "%s", title); + cp += n; sz -= n; + } + cp[n] = 0; new_edl->local_session->set_selectionstart(0); new_edl->local_session->set_selectionend(0); @@ -2399,6 +2421,10 @@ void MWindow::to_clip() save_backup(); gui->unlock_window(); } +void MWindow::to_clip(const char *txt) +{ + to_clip(edl, txt); +} int MWindow::toggle_label(int is_mwindow) { diff --git a/cinelerra-5.1/cinelerra/vwindowgui.C b/cinelerra-5.1/cinelerra/vwindowgui.C index 4dbdff28..0c4621e2 100644 --- a/cinelerra-5.1/cinelerra/vwindowgui.C +++ b/cinelerra-5.1/cinelerra/vwindowgui.C @@ -654,61 +654,11 @@ void VWindowEditing::clear_outpoint() void VWindowEditing::to_clip() { - if(vwindow->get_edl()) - { - FileXML file; - EDL *edl = vwindow->get_edl(); - double start = edl->local_session->get_selectionstart(); - double end = edl->local_session->get_selectionend(); - - if(EQUIV(start, end)) - { - end = edl->tracks->total_length(); - start = 0; - } - - - - edl->copy(start, - end, - 1, - 0, - 0, - &file, - "", - 1); - - - - - EDL *new_edl = new EDL(mwindow->edl); - new_edl->create_objects(); - new_edl->load_xml(&file, LOAD_ALL); - sprintf(new_edl->local_session->clip_title, - _("Clip %d"), mwindow->session->clip_number++); - char string[BCTEXTLEN]; - Units::totext(string, - end - start, - edl->session->time_format, - edl->session->sample_rate, - edl->session->frame_rate, - edl->session->frames_per_foot); - - sprintf(new_edl->local_session->clip_notes, - _("%s\n Created from:\n%s"), string, vwindow->gui->loaded_title); - - new_edl->local_session->set_selectionstart(0); - new_edl->local_session->set_selectionend(0); - - -//printf("VWindowEditing::to_clip 1 %s\n", edl->local_session->clip_title); - new_edl->local_session->set_selectionstart(0.0); - new_edl->local_session->set_selectionend(0.0); - vwindow->clip_edit->create_clip(new_edl); - } + EDL *edl = vwindow->get_edl(); + if( !edl ) return; + mwindow->to_clip(edl, _("viewer window: ")); } - VWindowSource::VWindowSource(MWindow *mwindow, VWindowGUI *vwindow, int x, int y) : BC_PopupTextBox(vwindow, &vwindow->sources, diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac index 3016661a..b4325d5e 100644 --- a/cinelerra-5.1/configure.ac +++ b/cinelerra-5.1/configure.ac @@ -181,7 +181,7 @@ PKG_3RD([ilmbase],[auto], IlmThread/.libs/libIlmThread.a ], [ Iex Half Imath config IlmThread ]) -PKG_DEF([ladspa], [ladspa-05182015], [], []) +PKG_DEF([ladspa], [ladspa-0.4.17], [], []) PKG_3RD([lame],[auto], [lame-3.99.5], diff --git a/cinelerra-5.1/guicast/bclistbox.C b/cinelerra-5.1/guicast/bclistbox.C index 960226f8..882c378b 100644 --- a/cinelerra-5.1/guicast/bclistbox.C +++ b/cinelerra-5.1/guicast/bclistbox.C @@ -1061,7 +1061,7 @@ int BC_ListBox::get_text_w(BC_ListBoxItem *item) int BC_ListBox::get_text_h(BC_ListBoxItem *item) { int h = item->get_text_h(); - if( h < 0 ) item->set_text_h(h = get_text_height(MEDIUMFONT)); + if( h < 0 ) item->set_text_h(h = get_text_height(MEDIUMFONT, item->get_text())); return h; } diff --git a/cinelerra-5.1/plugins/Makefile b/cinelerra-5.1/plugins/Makefile index 6b9e9395..aec17e68 100644 --- a/cinelerra-5.1/plugins/Makefile +++ b/cinelerra-5.1/plugins/Makefile @@ -164,8 +164,8 @@ $(DATA): $(LADSPA_DIR): mkdir -p $@ - if [ -d $(THIRDPARTY)/ladspa-*/usr/local/lib/ladspa ]; then \ - cp -a $(THIRDPARTY)/ladspa-*/usr/local/lib/ladspa/. $@/. ; \ + if [ -d $(THIRDPARTY)/ladspa-*/usr/local/lib*/ladspa ]; then \ + cp -a $(THIRDPARTY)/ladspa-*/usr/local/lib*/ladspa/. $@/. ; \ fi # parallel compilation of all directories diff --git a/cinelerra-5.1/thirdparty/Makefile b/cinelerra-5.1/thirdparty/Makefile index 5fae947d..4b220efd 100644 --- a/cinelerra-5.1/thirdparty/Makefile +++ b/cinelerra-5.1/thirdparty/Makefile @@ -176,7 +176,7 @@ lame.mak_params?= ; cd $(call bld_path,lame,include); ln -sf . lame mjpegtools.cflags?="$(call inc_path,libjpeg) $(call ld_path,libjpeg,.libs)" mjpegtools.mak_params?=; ln -s . $(call bld_path,mjpegtools,utils)/mjpegtools mjpegtools.cfg_params?= --enable-shared=no -ladspa.cfg_vars?= ./autogen.sh; CFLAGS+=' -Dinline="" ' +ladspa.cfg_vars?= CFLAGS+=' -Dinline="" ' ladspa.mak_params?=; $(MAKE) -C ladspa* install DESTDIR=$(call bld_path,ladspa) libavc1394.cfg_vars?=PKG_CONFIG_PATH=$(call bld_path,libraw1394) libavc1394.cflags?="$(call inc_path,libraw1394)" diff --git a/cinelerra-5.1/thirdparty/src/ladspa-0.4.17.tar.xz b/cinelerra-5.1/thirdparty/src/ladspa-0.4.17.tar.xz index baa99af1..69c8b509 100644 Binary files a/cinelerra-5.1/thirdparty/src/ladspa-0.4.17.tar.xz and b/cinelerra-5.1/thirdparty/src/ladspa-0.4.17.tar.xz differ