fix audio big btn replay, new proj path, proxy fix, updated Features5
authorGood Guy <good1.2guy@gmail.com>
Mon, 30 Apr 2018 04:14:29 +0000 (22:14 -0600)
committerGood Guy <good1.2guy@gmail.com>
Mon, 30 Apr 2018 04:14:29 +0000 (22:14 -0600)
24 files changed:
cinelerra-5.1/cinelerra/aboutprefs.C
cinelerra-5.1/cinelerra/assetpopup.C
cinelerra-5.1/cinelerra/mwindow.C
cinelerra-5.1/cinelerra/new.C
cinelerra-5.1/cinelerra/new.h
cinelerra-5.1/cinelerra/proxy.C
cinelerra-5.1/cinelerra/renderengine.C
cinelerra-5.1/doc/Features5.pdf
cinelerra-5.1/guicast/bcrecentlist.C
cinelerra-5.1/guicast/bcrecentlist.h
cinelerra-5.1/guicast/bctexture.C
cinelerra-5.1/guicast/filesystem.C
cinelerra-5.1/guicast/test4.C
cinelerra-5.1/msg/txt
cinelerra-5.1/plugins/findobj/findobj.C
cinelerra-5.1/plugins/theme_blond/data/new_bg.png
cinelerra-5.1/plugins/theme_blond_cv/data/new_bg.png
cinelerra-5.1/plugins/theme_blue/data/new_bg.png
cinelerra-5.1/plugins/theme_blue_dot/data/new_bg.png
cinelerra-5.1/plugins/theme_bright/data/new_bg.png
cinelerra-5.1/plugins/theme_hulk/data/new_bg.png
cinelerra-5.1/plugins/theme_pinklady/data/new_bg.png
cinelerra-5.1/plugins/theme_suv/data/new_bg.png
cinelerra-5.1/plugins/theme_unflat/data/new_bg.png

index 4702c944e6c1439074d1cb9bfcbb194175c6483d..9997efa7cd59b2210218a378b4f014824a4fc2af 100644 (file)
@@ -117,7 +117,7 @@ void AboutPrefs::create_objects()
 "This program is free software; you can redistribute it and/or modify it under the terms\n"
 "of the GNU General Public License as published by the Free Software Foundation; either version\n"
 "2 of the License, or (at your option) any later version.\n"
-"\n"
+"  This software uses libraries from the FFmpeg project under the LGPLv2.1.\n"
 "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;\n"
 "without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n"
 "PURPOSE.  See the GNU General Public License for more details.\n"));
index 026806a1c9eb3e6bddf15acdbc020e5da5246b93..059e5850d86de696bbe8462c77bb503c41c7e1fd 100644 (file)
@@ -37,6 +37,7 @@
 #include "edl.h"
 #include "edlsession.h"
 #include "file.h"
+#include "filesystem.h"
 #include "filexml.h"
 #include "language.h"
 #include "loadfile.h"
@@ -776,10 +777,13 @@ int SnapshotMenuItem::handle_event()
                preferences->snapshot_path, _("snap"),
                1900+tm.tm_year,1+tm.tm_mon,tm.tm_mday,
                tm.tm_hour,tm.tm_min,tm.tm_sec, exts[mode]);
+       char *asset_path = FileSystem::basepath(filename);
+       Asset *asset = new Asset(asset_path);
+       delete [] asset_path;
+
        int fw = edl->get_w(), fh = edl->get_h();
        int fcolor_model = edl->session->color_model;
 
-       Asset *asset = new Asset(filename);
        switch( mode ) {
        case SNAPSHOT_PNG:
                asset->format = FILE_PNG;
@@ -998,8 +1002,9 @@ int GrabshotPopup::grab_event(XEvent *event)
                preferences->snapshot_path, _("grab"),
                1900+tm.tm_year,1+tm.tm_mon,tm.tm_mday,
                tm.tm_hour,tm.tm_min,tm.tm_sec, exts[mode]);
-
-       Asset *asset = new Asset(filename);
+       char *asset_path = FileSystem::basepath(filename);
+       Asset *asset = new Asset(asset_path);
+       delete [] asset_path;
        switch( mode ) {
        case GRABSHOT_PNG:
                asset->format = FILE_PNG;
index 6150f954131af90569483dc305304075ff4c09d8..6ad64376e6b3e47839d20d5adae6fdd49d495d3a 100644 (file)
@@ -471,6 +471,7 @@ void MWindow::init_defaults(BC_Hash* &defaults, char *config_path)
        else
                create_defaults_path(path, CONFIG_FILE);
 
+       delete defaults;
        defaults = new BC_Hash(path);
        defaults->load();
 }
@@ -746,17 +747,17 @@ void MWindow::add_plugins(ArrayList<PluginServer*> &plugins)
 
 void MWindow::init_plugin_tips(ArrayList<PluginServer*> &plugins, const char *lang)
 {
-       const char *cfg_path = File::get_cindat_path();
+       const char *dat_path = File::get_cindat_path();
        char msg_path[BCTEXTLEN];
        FILE *fp = 0;
        if( BC_Resources::language[0] ) {
                snprintf(msg_path, sizeof(msg_path), "%s/info/plugins.%s",
-                       cfg_path, lang);
+                       dat_path, lang);
                fp = fopen(msg_path, "r");
        }
        if( !fp ) {
                snprintf(msg_path, sizeof(msg_path), "%s/info/plugins.txt",
-                       cfg_path);
+                       dat_path);
                fp = fopen(msg_path, "r");
        }
        if( !fp ) return;
index 9877894bd05bd29ce749385520b1717399f5c24f..e5aa6df4fb1ea87d5ed60e8129f2a323abc6b3b0 100644 (file)
  *
  */
 
+#include "browsebutton.h"
 #include "clip.h"
 #include "cplayback.h"
 #include "cwindow.h"
 #include "bchash.h"
 #include "edl.h"
 #include "edlsession.h"
+#include "filesystem.h"
 #include "filexml.h"
 #include "interlacemodes.h"
 #include "language.h"
 #include "levelwindow.h"
+#include "mainerror.h"
 #include "mainundo.h"
 #include "mainmenu.h"
 #include "mutex.h"
 
 
 #define WIDTH 640
-#define HEIGHT 425
+// full height
+#define HEIGHT0 585
+// add tracks dialog
+#define HEIGHT1 240
+// offset for folder panel
+#define HEIGHT2 440
 
 New::New(MWindow *mwindow)
 {
        this->mwindow = mwindow;
-       script = 0;
        new_edl = 0;
        thread = 0;
 }
@@ -115,7 +122,7 @@ int New::create_new_project(int load_mode)
                }
        }
        mwindow->undo->update_undo_before();
-       mwindow->set_filename("");
+       mwindow->set_filename(new_edl->path);
        ArrayList<EDL *>new_edls;
        new_edls.append(new_edl);
        mwindow->paste_edls(&new_edls, load_mode, 0,0,0,0,0,0);
@@ -193,20 +200,59 @@ BC_Window* NewThread::new_gui()
        return nwindow;
 }
 
+void NewThread::handle_done_event(int result)
+{
+       if( !result ) {
+               const char *project_folder = nwindow->folder->get_text();
+               const char *project_name = nwindow->name->get_text();
+               if( project_folder[0] && project_name[0] ) {
+                       nwindow->recent_folder->add_item("PROJECT", project_folder);
+                       char project_path[BCTEXTLEN], *ep = project_path + sizeof(project_path);
+                       FileSystem fs;  fs.join_names(project_path, project_folder, project_name);
+                       char *bp = strrchr(project_path, '/');
+                       if( !bp ) bp = project_path;
+                       bp = strrchr(bp, '.');
+                       if( !bp ) bp = project_path + strlen(project_path);
+                       if( strcasecmp(bp,".xml") ) snprintf(bp, ep-bp, ".xml");
+                       fs.complete_path(project_path);
+                       EDL *new_edl = new_project->new_edl;
+                       bp = FileSystem::basepath(project_path);
+                       strcpy(new_edl->path, bp);  delete [] bp;
+               }
+       }
+}
+
 void NewThread::handle_close_event(int result)
 {
        if( !new_project->new_edl ) return;
-       new_project->new_edl->save_defaults(mwindow->defaults);
-       mwindow->defaults->save();
 
-       if( result ) {
-// Aborted
-               if( !new_project->new_edl->Garbage::remove_user() )
-                       new_project->new_edl = 0;
+       FileSystem fs;
+       char *path = new_project->new_edl->path;
+       char *bp = path;
+       while( !result ) {
+               while( *bp == '/' ) ++bp;
+               if( !(bp = strchr(bp, '/')) ) break;
+               char dir_path[BCTEXTLEN];
+               int len = bp - path;
+               strncpy(dir_path, path, len);
+               dir_path[len] = 0;
+               if( fs.is_dir(dir_path) ) continue;
+               if( fs.create_dir(dir_path) ) {
+                       eprintf(_("Cannot create and access project path:\n%s"),
+                               dir_path);
+                       result = 1;
+               }
        }
-       else {
+
+       if( !result ) {
+               new_project->new_edl->save_defaults(mwindow->defaults);
+               mwindow->defaults->save();
                new_project->create_new_project(load_mode);
        }
+       else { // Aborted
+               new_project->new_edl->Garbage::remove_user();
+               new_project->new_edl = 0;
+       }
 }
 
 int NewThread::load_defaults()
@@ -240,7 +286,7 @@ int NewThread::update_aspect()
 
 NewWindow::NewWindow(MWindow *mwindow, NewThread *new_thread, int x, int y)
  : BC_Window(new_thread->title, x, y,
-               WIDTH, new_thread->load_mode == LOADMODE_REPLACE ? HEIGHT : HEIGHT-180,
+               WIDTH, new_thread->load_mode == LOADMODE_REPLACE ? HEIGHT0 : HEIGHT1,
                -1, -1, 0, 0, 1)
 {
        this->mwindow = mwindow;
@@ -258,6 +304,9 @@ NewWindow::NewWindow(MWindow *mwindow, NewThread *new_thread, int x, int y)
        aspect_h_text = 0;
        interlace_pulldown = 0;
        color_model = 0;
+       folder = 0;
+       name = 0;
+       recent_folder = 0;
 }
 
 NewWindow::~NewWindow()
@@ -271,6 +320,7 @@ void NewWindow::create_objects()
 {
        int x = 10, y = 10, x1, y1;
        BC_TextBox *textbox;
+       BC_Title *title;
 
        lock_window("NewWindow::create_objects");
        mwindow->theme->draw_new_bg(this);
@@ -400,7 +450,6 @@ void NewWindow::create_objects()
                y += aspect_w_text->get_h() + 5;
                add_subwindow(new NewAspectAuto(this, x1, y));
                y += 40;
-               BC_Title *title;
                add_subwindow(title = new BC_Title(x, y, _("Color model:")));
                x1 = x + title->get_w();
                y1 = y;  y += title->get_h() + 10;
@@ -417,6 +466,21 @@ void NewWindow::create_objects()
                        textbox, &new_edl->session->interlace_mode,
                        (ArrayList<BC_ListBoxItem*>*)&mwindow->interlace_project_modes,
                        x1+textbox->get_w(), y2));
+
+               x = 20;  y = HEIGHT2;
+               add_subwindow(title = new BC_Title(x, y, _("Create project folder in:")));
+               x1 = x;  y += title->get_h() + 5;
+               add_subwindow(folder = new BC_TextBox(x1, y, get_w()-x1-64, 1, ""));
+               x1 += folder->get_w() + 10;
+               add_subwindow(recent_folder = new BC_RecentList("FOLDER", mwindow->defaults, folder));
+               recent_folder->load_items("PROJECT");
+               x1 = recent_folder->get_x() + recent_folder->get_w();
+               add_subwindow(new BrowseButton(mwindow->theme, this, folder, x1, y, "",
+                        _("Project Directory"), _("Project Directory Path:"), 1));
+               y += folder->get_h() + 10;  x1 = x;
+               add_subwindow(title = new BC_Title(x1, y, _("Project Name:")));
+               x1 += title->get_w() + 10;
+               add_subwindow(name = new BC_TextBox(x1, y, get_w()-x1-64, 1, ""));
        }
 
        add_subwindow(new BC_OKButton(this,
index c56dd4f6a5092731ff0b190316d58fe93285999b..dc511bd40e29f3036231e24c5995d4d403b35c5c 100644 (file)
@@ -46,16 +46,12 @@ public:
 
        virtual void create_objects() = 0;
        int handle_event();
-       int run_script(FileXML *script);
        int create_new_project(int load_mode);
        void create_new_edl();
 
        MWindow *mwindow;
        NewThread *thread;
        EDL *new_edl;
-
-private:
-       FileXML *script;
 };
 
 class NewProject : public BC_MenuItem, public New
@@ -85,6 +81,7 @@ public:
        ~NewThread();
 
        BC_Window* new_gui();
+       void handle_done_event(int result);
        void handle_close_event(int result);
 
        int load_defaults();
@@ -119,6 +116,8 @@ public:
        BC_TextBox *frame_rate;
        BC_TextBox *aspect_w_text, *aspect_h_text;
        BC_TextBox *output_w_text, *output_h_text;
+       BC_TextBox *folder, *name;
+       BC_RecentList *recent_folder;
        InterlacemodePulldown *interlace_pulldown;
        ColormodelPulldown *color_model;
        NewPresets *format_presets;
index 02eb20fa03c5003e06f375e542c00c6ab1f0ecd4..5432f478546fb1927cd64e7c20667e843545bb06 100644 (file)
@@ -259,7 +259,7 @@ void ProxyDialog::to_proxy()
        mwindow->restart_brender();
 
        mwindow->gui->lock_window("ProxyDialog::to_proxy");
-       mwindow->update_project(LOAD_ALL);
+       mwindow->update_project(LOADMODE_REPLACE);
        mwindow->gui->unlock_window();
 }
 
index 3c73709af7d1c57db02d7edd5e11bedeb4f40fd2..177f33504d46b276a8812822b50b5b23592cc911 100644 (file)
@@ -527,17 +527,9 @@ void RenderEngine::run()
 //printf("RenderEngine::run 4.1 %d\n", playback_engine->tracking_position);
                        if(!interrupted)
                        {
-                               if(do_audio)
-                                       playback_engine->tracking_position =
-                                               (double)arender->current_position /
-                                                       command->get_edl()->session->sample_rate;
-                               else
-                               if(do_video)
-                               {
-                                       playback_engine->tracking_position =
-                                               (double)vrender->current_position /
-                                                       command->get_edl()->session->frame_rate;
-                               }
+                               playback_engine->tracking_position =
+                                       command->get_direction() == PLAY_FORWARD ?
+                                               command->end_position : command->start_position;
                        }
 
                        if( playback_engine->is_playing_back && command->displacement ) {
index bc092cb5f66a69c7e66fefb2fe61aff3b196e832..fac7209aa017f0a10aebbbf70f96ff0a2bd1ebdc 100644 (file)
Binary files a/cinelerra-5.1/doc/Features5.pdf and b/cinelerra-5.1/doc/Features5.pdf differ
index 73d2859dd601da8bbeb0be4222f6f9c7988b84b9..d1e24349e654a8cfb7137064c7d8cf77fca1bc32 100644 (file)
@@ -65,7 +65,8 @@ BC_RecentList::~BC_RecentList()
        items.remove_all_objects();
 }
 
-int BC_RecentList::handle_event() {
+int BC_RecentList::handle_event()
+{
        BC_ListBoxItem *item = get_selection(0, 0);
        if( !item ) return 0;
        char *text = item->get_text();
@@ -79,7 +80,8 @@ int BC_RecentList::handle_event() {
 }
 
 
-int BC_RecentList::load_items(const char *prefix) {
+int BC_RecentList::load_items(const char *prefix)
+{
 
        if (! prefix) prefix = "ANY";
 
@@ -105,7 +107,8 @@ int BC_RecentList::load_items(const char *prefix) {
 }
 
 
-int BC_RecentList::add_item(const char *prefix, char *text) {
+int BC_RecentList::add_item(const char *prefix, const char *text)
+{
 
        if (! prefix) prefix = "ANY";
 
@@ -133,3 +136,4 @@ int BC_RecentList::add_item(const char *prefix, char *text) {
 
        return count;
 }
+
index ecc644d3c5161fa8444a6aa0f75cfee53225b126..225b22cd180c2d2d557620bbbe62a4ad3638a6fc 100644 (file)
@@ -47,7 +47,7 @@ class BC_RecentList : public BC_ListBox
 
        int handle_event();
        int load_items(const char *prefix = NULL);
-       int add_item(const char *prefix, char *text);
+       int add_item(const char *prefix, const char *text);
 
        ArrayList<BC_ListBoxItem*> items;
  private:
index d9bc92d94869d67e314cc907d0495f3b8d16be27..b527b4e137327ab853a7528958907338d30b56d2 100644 (file)
@@ -227,7 +227,20 @@ void BC_Texture::bind(int texture_unit)
 #endif
 }
 
-void write_ppm(uint8_t *tp, int w, int h, const char *fmt, ...);
+#ifdef HAVE_GL
+static void write_ppm(uint8_t *tp, int w, int h, const char *fmt, ...)
+{
+  va_list ap;    va_start(ap, fmt);
+  char fn[256];  vsnprintf(fn, sizeof(fn), fmt, ap);
+  va_end(ap);
+  FILE *fp = !strcmp(fn,"-") ? stdout : fopen(fn,"w");
+  if( fp ) {
+    fprintf(fp,"P6\n%d %d\n255\n",w,h);
+    fwrite(tp,3*w,h,fp);
+    if( fp != stdout ) fclose(fp);
+  }
+}
+#endif
 
 void BC_Texture::write_tex(const char *fn)
 {
index 1d0aee887127385affb67d6f34dec726389437cd..62bf1a5a47573522a7568c8d6aeb91343b393bdc 100644 (file)
@@ -536,9 +536,7 @@ int FileSystem::create_dir(const char *new_dir_)
        char new_dir[BCTEXTLEN];
        strcpy(new_dir, new_dir_);
        complete_path(new_dir);
-
-       mkdir(new_dir, S_IREAD | S_IWRITE | S_IEXEC);
-       return 0;
+       return mkdir(new_dir, S_IRWXU | S_IRWXG | S_IRWXO);
 }
 
 int FileSystem::parse_tildas(char *new_dir)
index 522b844132eb94a3cf3e77983639a84b3689e057..de94fad8d709e1c24304b8ef9660d2f2296d3dbf 100644 (file)
@@ -107,7 +107,7 @@ void write_ppm(uint8_t *tp, int w, int h, const char *fmt, ...)
   if( fp ) {
     fprintf(fp,"P6\n%d %d\n255\n",w,h);
     fwrite(tp,3*w,h,fp);
-    if( fp != sdtout ) fclose(fp);
+    if( fp != stdout ) fclose(fp);
   }
 }
 
index a67924bfa56e4f72b6d2d593b80c4b31fad43be3..db4e170cf0338667ed8f56701babb5b98c753bbe 100644 (file)
@@ -9,6 +9,12 @@ For usage help, refer to the following:
 Cinfinity icons selected in Preferences (Creative Common
   By https://creativecommons.org/licenses/by/3.0/)
 .
+April 2018 New Features of note:
+  FFmpeg has been updated to V 4.0. Libx265 to 2.7.
+  OpenCV FindObj updated and StyleObj, PuzzleObj added.
+  Shortcuts F11-F12 in compositor / b for load backup.
+  Drag widget designed/added for future versatility.
+.
 March 2018 New Features of note:
   Audio now is associated when in the Proxy folder.
   Perpetual Session preference and 1 extra backup.
index 20f117bffcb9665c965a0966f2a341ebd43d34ec..6815fd1aaf233e77b939a65bafb0d98ff6de8eb3 100644 (file)
@@ -627,6 +627,7 @@ void FindObjMain::reshape()
                double v = atan2(vy, vx);
                double h = atan2(hy, hx);
                r = (h + v - pi/2) / 2;
+               if( config.mode != MODE_QUADRILATERAL ) r = -r;
        }
 // diagonal length
        double a = dist(x1,y1, x3,y3) / 2;
index 3b3ed4fd7615e7745aea6c8dcad79990811a0835..29b6d803f53ad0efc11158a6d92be89bc2af8a41 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_blond/data/new_bg.png and b/cinelerra-5.1/plugins/theme_blond/data/new_bg.png differ
index d4ba3b95d6b137a83b3ce576ad4e562bafcff065..d0d7847241e4244dc3b16aa8c12b81c2bdb994d3 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_blond_cv/data/new_bg.png and b/cinelerra-5.1/plugins/theme_blond_cv/data/new_bg.png differ
index 4e5f0bd124e818f08fec29535581d0eb626b1ea1..6fbe68110901df137275210b23beac4722d87189 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_blue/data/new_bg.png and b/cinelerra-5.1/plugins/theme_blue/data/new_bg.png differ
index da3bfa03254158e9a915c8ebbf8f1930f81bd9c3..35bf8a615e9936ec9150f77774758f948ec0c528 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_blue_dot/data/new_bg.png and b/cinelerra-5.1/plugins/theme_blue_dot/data/new_bg.png differ
index e84d0ebde8971675f752284a50a038c03805857b..6d6ef21a8ce8861ea39e24f4e2d141738ce5b9f5 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_bright/data/new_bg.png and b/cinelerra-5.1/plugins/theme_bright/data/new_bg.png differ
index bb615c8f44468de897efdfe0a60b8108d96eab95..efdbc88cda0203b2bc6dce47a8813f5fdecb40a5 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_hulk/data/new_bg.png and b/cinelerra-5.1/plugins/theme_hulk/data/new_bg.png differ
index b2c970ff05200c3fbcfaa3259e00b191ef7c2d89..d3c61a8aa9831c9fd8ab3d16e312d17b657c9d72 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_pinklady/data/new_bg.png and b/cinelerra-5.1/plugins/theme_pinklady/data/new_bg.png differ
index deade2b29d3714e1f5d882f232aa499ee0346e6b..63a830b34e20a358a06f5666d03b18ea6277f609 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_suv/data/new_bg.png and b/cinelerra-5.1/plugins/theme_suv/data/new_bg.png differ
index ac722ca95f39857b52f1e17debeb2e3b2a50deba..086fd99b4981770e90448c89ad6fdba151f3109f 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_unflat/data/new_bg.png and b/cinelerra-5.1/plugins/theme_unflat/data/new_bg.png differ