clip fixes, ladspa build fixes
authorGood Guy <good1.2guy@gmail.com>
Sat, 8 Jul 2017 17:44:23 +0000 (11:44 -0600)
committerGood Guy <good1.2guy@gmail.com>
Sat, 8 Jul 2017 17:44:23 +0000 (11:44 -0600)
15 files changed:
cinelerra-5.1/cinelerra/assetpopup.C
cinelerra-5.1/cinelerra/assetpopup.h
cinelerra-5.1/cinelerra/cwindowgui.C
cinelerra-5.1/cinelerra/editpanel.C
cinelerra-5.1/cinelerra/editpanel.h
cinelerra-5.1/cinelerra/mbuttons.C
cinelerra-5.1/cinelerra/mbuttons.h
cinelerra-5.1/cinelerra/mwindow.h
cinelerra-5.1/cinelerra/mwindowedit.C
cinelerra-5.1/cinelerra/vwindowgui.C
cinelerra-5.1/configure.ac
cinelerra-5.1/guicast/bclistbox.C
cinelerra-5.1/plugins/Makefile
cinelerra-5.1/thirdparty/Makefile
cinelerra-5.1/thirdparty/src/ladspa-0.4.17.tar.xz

index f85b05c08c2983bdfb737ab865e8e942121fb07e..478b4568eb7d0c72ecb9ef6b3ffaad3af96484eb 100644 (file)
@@ -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;
 }
index 49c06c19b9529df127a5a2120c68e11f19795416..8bb458f9d0eace276297689713d2838319ee8760 100644 (file)
@@ -59,7 +59,7 @@ public:
        AssetPopupBuildIndex *index;
        AssetPopupView *view;
        AssetPopupViewWindow *view_window;
-//     AssetListFormat *format;
+       AssetListFormat *format;
 };
 
 class AssetPopupInfo : public BC_MenuItem
index e676fc8b9a6e3830f20853b194d846c27f63b1db..9301f19dd184d39dc062dc99cfdbce65b576204b 100644 (file)
@@ -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,
index e823421025aefb2aa2550521ea5d7d4dc7b5cd7b..dadae3d95d80c38676511c413d7f06a0153cd24b 100644 (file)
@@ -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"))
index e4e0ab7e1be4fc7b84b961033dc5223b2bf1cb8f..24cea3b74b9cb21c0e7b830a0b38febc7478fd09 100644 (file)
@@ -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();
index a91c0cbcddead31ccf4c0d6819a415124df16708..a310aa63c42cfbcf5e0b58b7614c4997a0b76a07 100644 (file)
@@ -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");
+}
+
 
index 559aecf3cc11f90cb0cd1c8a1f25324f35bb4bcf..bc8f8a64bb2bdee29e609cdb7e1eb72c2217f776 100644 (file)
@@ -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;
index 041953cd724ab27eb198fa7062986bcb4514b6d0..4f49de7b9ef429809766c1a5d5e7e5b7ef9675b9 100644 (file)
@@ -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);
index 8ec7d0764f1f263bfe4d90cf76b1fde510d89b03..0c8ad1099c5d19e3c5cce7b741af4d8b8f9290ca 100644 (file)
@@ -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)
 {
index 4dbdff28fefc77e1c37b5b791b39dd7ac9eaf63c..0c4621e2bb2f3e096dda7ae4364d708177b32c9a 100644 (file)
@@ -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,
index 3016661a7a1a5a22dc6a47e6a2cc8aa723a3f3a7..b4325d5ea2887d4ff9419f04c8f00312a6b0bf80 100644 (file)
@@ -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],
index 960226f8bfffc43116fb4134706efaef1555186b..882c378be96f2bab80cb01c1b700aeda152b5706 100644 (file)
@@ -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;
 }
 
index 6b9e9395ae3a3aa5d4865ac436a209ee33974b59..aec17e689d736c13d2d2d837a69762c97ffda139 100644 (file)
@@ -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
index 5fae947d5f3be4666e9dbd6dfbb969deaa4e5a51..4b220efdc16eaf90aeb4aec04af55fa8edee588c 100644 (file)
@@ -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)"
index baa99af144bf9d5a8495762623d535d4151dd51d..69c8b509d828d91e74ca079bb7a7ecd640ea0b99 100644 (file)
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