From: Good Guy Date: Mon, 30 Apr 2018 04:14:29 +0000 (-0600) Subject: fix audio big btn replay, new proj path, proxy fix, updated Features5 X-Git-Url: https://cinelerra-gg.org/git/?a=commitdiff_plain;h=463702f1b724c43a1cb7951ce7d71986f9715d5f;p=goodguy%2Fhistory.git fix audio big btn replay, new proj path, proxy fix, updated Features5 --- diff --git a/cinelerra-5.1/cinelerra/aboutprefs.C b/cinelerra-5.1/cinelerra/aboutprefs.C index 4702c944..9997efa7 100644 --- a/cinelerra-5.1/cinelerra/aboutprefs.C +++ b/cinelerra-5.1/cinelerra/aboutprefs.C @@ -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")); diff --git a/cinelerra-5.1/cinelerra/assetpopup.C b/cinelerra-5.1/cinelerra/assetpopup.C index 026806a1..059e5850 100644 --- a/cinelerra-5.1/cinelerra/assetpopup.C +++ b/cinelerra-5.1/cinelerra/assetpopup.C @@ -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; diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 6150f954..6ad64376 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -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 &plugins) void MWindow::init_plugin_tips(ArrayList &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; diff --git a/cinelerra-5.1/cinelerra/new.C b/cinelerra-5.1/cinelerra/new.C index 9877894b..e5aa6df4 100644 --- a/cinelerra-5.1/cinelerra/new.C +++ b/cinelerra-5.1/cinelerra/new.C @@ -19,16 +19,19 @@ * */ +#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" @@ -52,12 +55,16 @@ #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); ArrayListnew_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*)&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, diff --git a/cinelerra-5.1/cinelerra/new.h b/cinelerra-5.1/cinelerra/new.h index c56dd4f6..dc511bd4 100644 --- a/cinelerra-5.1/cinelerra/new.h +++ b/cinelerra-5.1/cinelerra/new.h @@ -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; diff --git a/cinelerra-5.1/cinelerra/proxy.C b/cinelerra-5.1/cinelerra/proxy.C index 02eb20fa..5432f478 100644 --- a/cinelerra-5.1/cinelerra/proxy.C +++ b/cinelerra-5.1/cinelerra/proxy.C @@ -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(); } diff --git a/cinelerra-5.1/cinelerra/renderengine.C b/cinelerra-5.1/cinelerra/renderengine.C index 3c73709a..177f3350 100644 --- a/cinelerra-5.1/cinelerra/renderengine.C +++ b/cinelerra-5.1/cinelerra/renderengine.C @@ -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 ) { diff --git a/cinelerra-5.1/doc/Features5.pdf b/cinelerra-5.1/doc/Features5.pdf index bc092cb5..fac7209a 100644 Binary files a/cinelerra-5.1/doc/Features5.pdf and b/cinelerra-5.1/doc/Features5.pdf differ diff --git a/cinelerra-5.1/guicast/bcrecentlist.C b/cinelerra-5.1/guicast/bcrecentlist.C index 73d2859d..d1e24349 100644 --- a/cinelerra-5.1/guicast/bcrecentlist.C +++ b/cinelerra-5.1/guicast/bcrecentlist.C @@ -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; } + diff --git a/cinelerra-5.1/guicast/bcrecentlist.h b/cinelerra-5.1/guicast/bcrecentlist.h index ecc644d3..225b22cd 100644 --- a/cinelerra-5.1/guicast/bcrecentlist.h +++ b/cinelerra-5.1/guicast/bcrecentlist.h @@ -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 items; private: diff --git a/cinelerra-5.1/guicast/bctexture.C b/cinelerra-5.1/guicast/bctexture.C index d9bc92d9..b527b4e1 100644 --- a/cinelerra-5.1/guicast/bctexture.C +++ b/cinelerra-5.1/guicast/bctexture.C @@ -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) { diff --git a/cinelerra-5.1/guicast/filesystem.C b/cinelerra-5.1/guicast/filesystem.C index 1d0aee88..62bf1a5a 100644 --- a/cinelerra-5.1/guicast/filesystem.C +++ b/cinelerra-5.1/guicast/filesystem.C @@ -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) diff --git a/cinelerra-5.1/guicast/test4.C b/cinelerra-5.1/guicast/test4.C index 522b8441..de94fad8 100644 --- a/cinelerra-5.1/guicast/test4.C +++ b/cinelerra-5.1/guicast/test4.C @@ -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); } } diff --git a/cinelerra-5.1/msg/txt b/cinelerra-5.1/msg/txt index a67924bf..db4e170c 100644 --- a/cinelerra-5.1/msg/txt +++ b/cinelerra-5.1/msg/txt @@ -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. diff --git a/cinelerra-5.1/plugins/findobj/findobj.C b/cinelerra-5.1/plugins/findobj/findobj.C index 20f117bf..6815fd1a 100644 --- a/cinelerra-5.1/plugins/findobj/findobj.C +++ b/cinelerra-5.1/plugins/findobj/findobj.C @@ -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; diff --git a/cinelerra-5.1/plugins/theme_blond/data/new_bg.png b/cinelerra-5.1/plugins/theme_blond/data/new_bg.png index 3b3ed4fd..29b6d803 100644 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 diff --git a/cinelerra-5.1/plugins/theme_blond_cv/data/new_bg.png b/cinelerra-5.1/plugins/theme_blond_cv/data/new_bg.png index d4ba3b95..d0d78472 100644 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 diff --git a/cinelerra-5.1/plugins/theme_blue/data/new_bg.png b/cinelerra-5.1/plugins/theme_blue/data/new_bg.png index 4e5f0bd1..6fbe6811 100644 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 diff --git a/cinelerra-5.1/plugins/theme_blue_dot/data/new_bg.png b/cinelerra-5.1/plugins/theme_blue_dot/data/new_bg.png index da3bfa03..35bf8a61 100644 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 diff --git a/cinelerra-5.1/plugins/theme_bright/data/new_bg.png b/cinelerra-5.1/plugins/theme_bright/data/new_bg.png index e84d0ebd..6d6ef21a 100644 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 diff --git a/cinelerra-5.1/plugins/theme_hulk/data/new_bg.png b/cinelerra-5.1/plugins/theme_hulk/data/new_bg.png index bb615c8f..efdbc88c 100644 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 diff --git a/cinelerra-5.1/plugins/theme_pinklady/data/new_bg.png b/cinelerra-5.1/plugins/theme_pinklady/data/new_bg.png index b2c970ff..d3c61a8a 100644 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 diff --git a/cinelerra-5.1/plugins/theme_suv/data/new_bg.png b/cinelerra-5.1/plugins/theme_suv/data/new_bg.png index deade2b2..63a830b3 100644 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 diff --git a/cinelerra-5.1/plugins/theme_unflat/data/new_bg.png b/cinelerra-5.1/plugins/theme_unflat/data/new_bg.png index ac722ca9..086fd99b 100644 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