transcode target dir can be nested proxy pref, filebox/loadmode tweaks, meters tweak...
authorGood Guy <good1.2guy@gmail.com>
Sun, 19 Jan 2020 01:37:13 +0000 (18:37 -0700)
committerGood Guy <good1.2guy@gmail.com>
Sun, 19 Jan 2020 01:37:13 +0000 (18:37 -0700)
25 files changed:
cinelerra-5.1/cinelerra/convert.C
cinelerra-5.1/cinelerra/convert.h
cinelerra-5.1/cinelerra/convert.inc
cinelerra-5.1/cinelerra/loadfile.C
cinelerra-5.1/cinelerra/loadmode.C
cinelerra-5.1/cinelerra/mwindow.C
cinelerra-5.1/cinelerra/mwindow.h
cinelerra-5.1/cinelerra/mwindowedit.C
cinelerra-5.1/cinelerra/pluginarray.C
cinelerra-5.1/cinelerra/preferences.C
cinelerra-5.1/cinelerra/proxy.C
cinelerra-5.1/doc/shortcuts.html
cinelerra-5.1/guicast/bcfilebox.C
cinelerra-5.1/guicast/bcwindowbase.C
cinelerra-5.1/plugins/theme_blond/blondtheme.C
cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C
cinelerra-5.1/plugins/theme_blue/bluetheme.C
cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C
cinelerra-5.1/plugins/theme_bright/brighttheme.C
cinelerra-5.1/plugins/theme_cakewalk/cakewalk.C
cinelerra-5.1/plugins/theme_hulk/hulktheme.C
cinelerra-5.1/plugins/theme_neophyte/neophyte.C
cinelerra-5.1/plugins/theme_pinklady/pinkladytheme.C
cinelerra-5.1/plugins/theme_suv/suv.C
cinelerra-5.1/plugins/theme_unflat/unflattheme.C

index 80694ef..c6ecb04 100644 (file)
@@ -52,7 +52,7 @@
 
 
 #define WIDTH xS(400)
-#define HEIGHT yS(320)
+#define HEIGHT yS(360)
 #define MAX_SCALE 16
 
 ConvertRender::ConvertRender(MWindow *mwindow)
@@ -70,6 +70,7 @@ ConvertRender::ConvertRender(MWindow *mwindow)
        failed = 0;  canceled = 0;
        result = 0;
        beep = 0;
+       to_proxy = 0;
 }
 
 ConvertRender::~ConvertRender()
@@ -102,7 +103,16 @@ void ConvertRender::reset()
 
 void ConvertRender::to_convert_path(char *new_path, Indexable *idxbl)
 {
-       strcpy(new_path, idxbl->path);
+       if( to_proxy ) {
+               char *bp = idxbl->path, *cp = strrchr(bp, '/');
+               if( cp ) bp = cp+1;
+               char filename[BCTEXTLEN], proxy_path[BCTEXTLEN];
+               strcpy(filename, bp);
+               File::getenv_path(proxy_path, mwindow->preferences->nested_proxy_path);
+               sprintf(new_path, "%s/%s", proxy_path, filename);
+       }
+       else
+               strcpy(new_path, idxbl->path);
        int n = strlen(suffix);
        char *ep = new_path + strlen(new_path);
        char *sfx = strrchr(new_path, '.');
@@ -333,13 +343,14 @@ int ConvertRender::find_convertable_assets(EDL *edl)
        return count;
 }
 
-void ConvertRender::set_format(Asset *asset, const char *suffix)
+void ConvertRender::set_format(Asset *asset, const char *suffix, int to_proxy)
 {
        delete [] this->suffix;
        this->suffix = cstrdup(suffix);
        if( !format_asset )
                format_asset = new Asset();
        format_asset->copy_from(asset, 0);
+       this->to_proxy = to_proxy;
 }
 
 void ConvertRender::start_convert(float beep, int remove_originals)
@@ -568,6 +579,8 @@ void ConvertWindow::create_objects()
        add_subwindow(remove_originals = new ConvertRemoveOriginals(this, x, y));
        x = lmargin;
        y += remove_originals->get_h() + margin;
+       add_subwindow(to_proxy_path = new ConvertToProxyPath(this, x, y));
+       y += to_proxy_path->get_h() + margin;
 
        add_subwindow(beep_on_done = new ConvertBeepOnDone(this, x, y));
        x += beep_on_done->get_w() + margin + xS(10);
@@ -654,6 +667,7 @@ ConvertDialog::ConvertDialog(MWindow *mwindow)
        asset->audio_data = 1;
        remove_originals = 1;
        beep = 0;
+       to_proxy = 0;
 }
 
 ConvertDialog::~ConvertDialog()
@@ -670,6 +684,7 @@ BC_Window* ConvertDialog::new_gui()
        asset->load_defaults(mwindow->defaults, "CONVERT_", 1, 1, 0, 1, 0);
        remove_originals = mwindow->defaults->get("CONVERT_REMOVE_ORIGINALS", remove_originals);
        beep = mwindow->defaults->get("CONVERT_BEEP", beep);
+       to_proxy = mwindow->defaults->get("CONVERT_TO_PROXY", to_proxy);
        mwindow->defaults->get("CONVERT_SUFFIX", suffix);
        mwindow->gui->lock_window("ConvertDialog::new_gui");
        int cx, cy;
@@ -686,8 +701,9 @@ void ConvertDialog::handle_close_event(int result)
        mwindow->defaults->update("CONVERT_SUFFIX", suffix);
        mwindow->defaults->update("CONVERT_REMOVE_ORIGINALS", remove_originals);
        mwindow->defaults->update("CONVERT_BEEP", beep);
+       mwindow->defaults->update("CONVERT_TO_PROXY", to_proxy);
        asset->save_defaults(mwindow->defaults, "CONVERT_", 1, 1, 0, 1, 0);
-       mwindow->start_convert(asset, suffix, beep, remove_originals);
+       mwindow->start_convert(asset, suffix, beep, to_proxy, remove_originals);
 }
 
 
@@ -707,6 +723,22 @@ int ConvertRemoveOriginals::handle_event()
        return 1;
 }
 
+ConvertToProxyPath::ConvertToProxyPath(ConvertWindow *gui, int x, int y)
+ : BC_CheckBox(x, y, gui->dialog->to_proxy, _("Into Nested Proxy directory"))
+{
+       this->gui = gui;
+}
+
+ConvertToProxyPath::~ConvertToProxyPath()
+{
+}
+
+int ConvertToProxyPath::handle_event()
+{
+       gui->dialog->to_proxy = get_value();
+       return 1;
+}
+
 ConvertBeepOnDone::ConvertBeepOnDone(ConvertWindow *gui, int x, int y)
  : BC_FPot(x, y, gui->dialog->beep*100.f, 0.f, 100.f)
 {
index 36c2c8c..dde071d 100644 (file)
@@ -61,7 +61,7 @@ public:
 
 // if user canceled progress bar
        int is_canceled();
-       void set_format(Asset *asset, const char *suffix);
+       void set_format(Asset *asset, const char *suffix, int to_proxy);
        void start_convert(float beep, int remove_originals);
        void run();
        void create_copy(int i);
@@ -79,6 +79,7 @@ public:
        int total_rendered, remove_originals;
        int failed, canceled, result;
        float beep;
+       int to_proxy;
 };
 
 class ConvertMenuItem : public BC_MenuItem
@@ -125,6 +126,17 @@ public:
        ConvertWindow *gui;
 };
 
+class ConvertToProxyPath : public BC_CheckBox
+{
+public:
+       ConvertToProxyPath(ConvertWindow *gui, int x, int y);
+       ~ConvertToProxyPath();
+
+       int handle_event();
+
+       ConvertWindow *gui;
+};
+
 class ConvertBeepOnDone : public BC_FPot
 {
 public:
@@ -178,6 +190,7 @@ public:
        ConvertSuffixText *suffix_text;
        ConvertFormatTools *format_tools;
        ConvertRemoveOriginals *remove_originals;
+       ConvertToProxyPath *to_proxy_path;
        ConvertBeepOnDone *beep_on_done;
 };
 
@@ -202,6 +215,7 @@ public:
        int orig_w, orig_h;
        int remove_originals;
        float beep;
+       int to_proxy;
 };
 
 #endif
index 50a816c..119a94f 100644 (file)
@@ -6,6 +6,7 @@ class ConvertMenuItem;
 class ConvertFormatTools;
 class ConvertSuffixText;
 class ConvertRemoveOriginals;
+class ConvertToProxyPath;
 class ConvertBeepOnDone;
 class ConvertPackageRenderer;
 class ConvertProgress;
index e40f716..5d8dffc 100644 (file)
@@ -121,7 +121,8 @@ void LoadFileThread::load_apply()
        if( edl_mode == LOADMODE_EDL_FILEREF )
                mwindow->show_warning(
                        &mwindow->preferences->warn_fileref,
-                       _("Other projects can change this project"));
+                       _("Other projects can change this project\n"
+                         "and this can become a broken link"));
        ArrayList<char*> path_list;
        path_list.set_array_delete();
 
index 04193b2..4caed98 100644 (file)
@@ -224,10 +224,10 @@ void LoadMode::create_objects()
                ix += pad;
        }
 
-       ix = 0;  iy = mh+pad;
+       ix = xS(25);  iy = mh+pad;
        const char *mode_text = mode_to_text(*load_mode);
        textbox = new BC_TextBox(x+ix, y+iy,
-               mwindow->theme->loadmode_w, 1, mode_text);
+               mwindow->theme->loadmode_w-2*ix, 1, mode_text);
        window->add_subwindow(textbox);
        ix += textbox->get_w();
        listbox = new LoadModeListBox(window, this, x+ix, y+iy);
@@ -274,7 +274,7 @@ int LoadMode::reposition_window(int x, int y)
                ix += pad;
        }
 
-       ix = 0;  iy = mh+pad;
+       ix = xS(25);  iy = mh+pad;
        textbox->reposition_window(x+ix, y+iy);
        ix += textbox->get_w();
        listbox->reposition_window(x+ix, y+iy);
index c63c25b..988e49a 100644 (file)
@@ -4287,7 +4287,10 @@ void MWindow::save_project(const char *dir, int save_mode, int overwrite, int re
        char progress_title[BCTEXTLEN];
        sprintf(progress_title, _("Saving to %s:\n"), dir);
        int total_assets = save_edl->assets->total();
+       gui->lock_window("MWindow::save_project");
        MainProgressBar *progress = mainprogress->start_progress(progress_title, total_assets);
+       gui->unlock_window();
+
        int ret = 0;
        Asset *current = save_edl->assets->first;
        for( int i=0; !ret && current; ++i, current=NEXT ) {
index c35d62b..32f3d24 100644 (file)
@@ -597,7 +597,7 @@ public:
        int optimize_assets();            // delete unused assets from the cache and assets
 // render edl assets to specified format, then replace in edl
        void start_convert(Asset *format_asset, const char *suffix,
-                       float beep, int remove_originals);
+                       float beep, int to_proxy, int remove_originals);
        void finish_convert(int remove_originals);
        ConvertRender *convert_render;
 
index f32413a..0c8c56b 100644 (file)
@@ -2445,11 +2445,11 @@ void MWindow::add_proxy(ArrayList<Indexable*> *orig_assets, ArrayList<Indexable*
 }
 
 void MWindow::start_convert(Asset *format_asset, const char *suffix,
-               float beep, int remove_originals)
+               float beep, int to_proxy, int remove_originals)
 {
        if( !convert_render )
                convert_render = new ConvertRender(this);
-       convert_render->set_format(format_asset, suffix);
+       convert_render->set_format(format_asset, suffix, to_proxy);
        int found = convert_render->find_convertable_assets(edl);
        if( convert_render->needed_idxbls.size() > 0 )
                convert_render->start_convert(beep, remove_originals);
index 33a3ec1..a04e985 100644 (file)
@@ -193,8 +193,10 @@ int PluginArray::run_plugins()
                MainProgressBar *progress;
                char string[BCTEXTLEN], string2[BCTEXTLEN];
 
+               mwindow->gui->lock_window();
                sprintf(string, "%s...", _(plugin_server->title));
                progress = mwindow->mainprogress->start_progress(string, end - start);
+               mwindow->gui->unlock_window();
 
                for(int64_t current_position = start;
                        current_position < end && !done && !error;
index 2b3f76f..d9db06a 100644 (file)
@@ -422,7 +422,7 @@ int Preferences::load_defaults(BC_Hash *defaults)
        shbtn_prefs.remove_all_objects();
        int shbtns_total = defaults->get("SHBTNS_TOTAL", -1);
        if( shbtns_total < 0 ) {
-               shbtn_prefs.append(new ShBtnPref(_("Current Manual"), "$CIN_BROWSER https://cinelerra-gg.org/download/CinelerraGG_manual.pdf"));
+               shbtn_prefs.append(new ShBtnPref(_("Current Manual"), "$CIN_BROWSER https://cinelerra-gg.org/download/CinelerraGG_Manual.pdf"));
                shbtn_prefs.append(new ShBtnPref(_("Setting Shell Commands"), "$CIN_BROWSER file://$CIN_DAT/doc/ShellCmds.html"));
                shbtn_prefs.append(new ShBtnPref(_("Shortcuts"), "$CIN_BROWSER file://$CIN_DAT/doc/shortcuts.html"));
                shbtn_prefs.append(new ShBtnPref(_("RenderMux"), "$CIN_DAT/doc/RenderMux.sh"));
index edeb394..fbb34fc 100644 (file)
@@ -358,8 +358,10 @@ int ProxyRender::create_needed_proxies(int new_scale)
        }
 
 // start progress bar.  MWindow is locked inside this
+       mwindow->gui->lock_window("ProxyRender::create_needed_proxies");
        progress = mwindow->mainprogress->
                start_progress(_("Creating proxy files..."), total_len);
+       mwindow->gui->unlock_window();
 
        ProxyFarm engine(mwindow, this, &needed_idxbls, &needed_proxies);
        engine.process_packages();
index 991ecff..29120cd 100644 (file)
        </tr>
        <tr>
                <td height="26" align="right"><font face="Liberation Serif" size=4><br></font></td>
-               <td align="left"><font face="Liberation Serif" size=4>Convert</font></td>
+               <td align="left"><font face="Liberation Serif" size=4>Proxy switch</font></td>
+               <td align="left"><font face="Liberation Serif" size=4>Ctrl-r</font></td>
+               <td align="left"><font face="Liberation Serif" size=4>Switch from current proxy mode</font></td>
+       </tr>
+       <tr>
+               <td height="26" align="right"><font face="Liberation Serif" size=4><br></font></td>
+               <td align="left"><font face="Liberation Serif" size=4>Transcode</font></td>
                <td align="left"><font face="Liberation Serif" size=4>Alt-e</font></td>
-               <td align="left"><font face="Liberation Serif" size=4>Bring up the Convert menu</font></td>
+               <td align="left"><font face="Liberation Serif" size=4>Bring up the Transcode menu</font></td>
        </tr>
        <tr>
                <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
index cbb5168..ca88ead 100644 (file)
@@ -442,7 +442,7 @@ BC_FileBox::BC_FileBox(int x, int y, const char *init_path,
  : BC_Window(title, x, y,
        BC_WindowBase::get_resources()->filebox_w,
        BC_WindowBase::get_resources()->filebox_h,
-       xS(400), yS(300), 1, 0, 1)
+       xS(450), yS(350), 1, 0, 1)
 {
        fs = new FileSystem;
 //     if(want_directory)
@@ -708,28 +708,28 @@ int BC_FileBox::resize_event(int w, int h)
 {
        draw_background(0, 0, w, h);
        flash(0);
+       int dw = w - get_w();
+       int dh = h - get_h();
 
 // OK button handles resize event itself
 //     ok_button->reposition_window(ok_button->get_x(),
-//             h - (get_h() - ok_button->get_y()));
-//     cancel_button->reposition_window(w - (get_w() - cancel_button->get_x()),
-//             h - (get_h() - cancel_button->get_y()));
+//             ok_button->get_y() + dh);
+//     cancel_button->reposition_window(cancel_button->get_x() + dw,
+//             cancel_button->get_y() + dh);
        if(usethis_button)
                usethis_button->reposition_window(w / 2 - xS(50),
-                       h - (get_h() - usethis_button->get_y()));
+                       usethis_button->get_y() + dh);
 
 
-       if(filter_popup) filter_popup->reposition_window(w - (get_w() - filter_popup->get_x()),
-               h - (get_h() - filter_popup->get_y()),
-               w - xS(30),
-               0);
+       if(filter_popup)
+               filter_popup->reposition_window(filter_popup->get_x() + dw,
+                       filter_popup->get_y() + dh, w - xS(30), 0);
 
-       if(filter_title) filter_title->reposition_window(filter_title->get_x(),
-               h - (get_h() - filter_title->get_y()));
+       if(filter_title)
+               filter_title->reposition_window(filter_title->get_x(),
+                       filter_title->get_y() + dh);
        if(filter_text) filter_text->reposition_window(filter_text->get_x(),
-               h - (get_h() - filter_text->get_y()),
-               w - (get_w() - filter_text->get_w()),
-               1);
+               filter_text->get_y() + dh, filter_text->get_w() + dw, 1);
        directory_title->reposition_window(
                directory_title->get_x(), directory_title->get_y(),
                get_w()-directory_title->get_x() - recent_popup->get_w()-xS(20), 1);
@@ -738,30 +738,22 @@ int BC_FileBox::resize_event(int w, int h)
                directory_title->get_y(),
                directory_title->get_w() + recent_popup->get_w(), xS(200));
        search_text->reposition_window(
-               search_text->get_x(),
-               search_text->get_y(),
-               get_w() - search_text->get_x() -  xS(40),
-               1);
+               search_text->get_x(), search_text->get_y(),
+               get_w() - search_text->get_x() -  xS(40), 1);
        file_title->reposition_window(file_title->get_x(),
-               h - (get_h() - file_title->get_y()));
+               file_title->get_y() + dh);
        textbox->reposition_window(textbox->get_x(),
-               h - (get_h() - textbox->get_y()),
-               w - (get_w() - textbox->get_w()),
-               1);
-       listbox->reposition_window(listbox->get_x(),
-               listbox->get_y(),
-               w - (get_w() - listbox->get_w()),
-               h - (get_h() - listbox->get_h()),
-               0);
-       int dx = w - get_w();
-       icon_button->reposition_window(icon_button->get_x()+dx, icon_button->get_y());
-       text_button->reposition_window(text_button->get_x()+dx, text_button->get_y());
-       folder_button->reposition_window(folder_button->get_x()+dx, folder_button->get_y());
-       rename_button->reposition_window(rename_button->get_x()+dx, rename_button->get_y());
-       reload_button->reposition_window(reload_button->get_x()+dx, reload_button->get_y());
-       delete_button->reposition_window(delete_button->get_x()+dx, delete_button->get_y());
-       updir_button->reposition_window(updir_button->get_x()+dx, updir_button->get_y());
-       szfmt_button->reposition_window(szfmt_button->get_x()+dx, szfmt_button->get_y());
+               textbox->get_y() + dh, textbox->get_w() + dw, 1);
+       listbox->reposition_window(listbox->get_x(), listbox->get_y(),
+               listbox->get_w() + dw, listbox->get_h() + dh, 0);
+       icon_button->reposition_window(icon_button->get_x()+dw, icon_button->get_y());
+       text_button->reposition_window(text_button->get_x()+dw, text_button->get_y());
+       folder_button->reposition_window(folder_button->get_x()+dw, folder_button->get_y());
+       rename_button->reposition_window(rename_button->get_x()+dw, rename_button->get_y());
+       reload_button->reposition_window(reload_button->get_x()+dw, reload_button->get_y());
+       delete_button->reposition_window(delete_button->get_x()+dw, delete_button->get_y());
+       updir_button->reposition_window(updir_button->get_x()+dw, updir_button->get_y());
+       szfmt_button->reposition_window(szfmt_button->get_x()+dw, szfmt_button->get_y());
        set_w(w);  set_h(h);
        get_resources()->filebox_w = get_w();
        get_resources()->filebox_h = get_h();
index e861238..9a730f9 100644 (file)
@@ -4638,9 +4638,9 @@ int BC_WindowBase::wait_viewable(int ms)
        XWindowAttributes xwa;
        do {
                XGetWindowAttributes(top_level->display, top_level->win, &xwa);
-               if( xwa.map_state == IsViewable ) return 1;
+               if( xwa.map_state == IsViewable ) return 0;
                usleep(10000);
        } while( timer.get_difference() < ms );
-       return 0;
+       return 1;
 }
 
index 71c647a..023fa5b 100644 (file)
@@ -934,7 +934,7 @@ void BlondTheme::initialize()
        recordgui_variable_color = RED;
 
        channel_position_color = MEYELLOW;
-       resources->meter_title_w = xS(25);
+       resources->meter_title_w = xS(28);
 
         // (asset) edit info text color
         edit_font_color = YELLOW;
index c4666b7..0d40fb6 100644 (file)
@@ -998,7 +998,7 @@ void BlondCVTheme::initialize()
        resources->medium_font = cstrdup(string);
 
        channel_position_color = MEYELLOW;
-       resources->meter_title_w = xS(25);
+       resources->meter_title_w = xS(28);
 
        // (asset) edit info text color
        edit_font_color = YELLOW;
index adbc600..532094b 100644 (file)
@@ -932,7 +932,7 @@ void BlueDotTheme::initialize()
        recordgui_variable_color = RED;
 
        channel_position_color = MEYELLOW;
-       resources->meter_title_w = xS(25);
+       resources->meter_title_w = xS(28);
 
         // (asset) edit info text color
         edit_font_color = YELLOW;
index e00a45e..d4fb437 100644 (file)
@@ -995,7 +995,7 @@ void BlueDotTheme::initialize()
        resources->medium_font = cstrdup(string);
 
        channel_position_color = MEYELLOW;
-       resources->meter_title_w = xS(25);
+       resources->meter_title_w = xS(28);
 
        // (asset) edit info text color
        edit_font_color = BLACK;
index 132e70c..beab6d1 100644 (file)
@@ -930,7 +930,7 @@ void BrightTheme::initialize()
        recordgui_variable_color = BLACK;
 
        channel_position_color = BLACK;
-       resources->meter_title_w = xS(25);
+       resources->meter_title_w = xS(28);
 }
 
 
index bb3a001..f3c1cde 100644 (file)
@@ -132,7 +132,7 @@ void CAKEWALKTHEME::initialize()
  recordgui_fixed_color = MeterGreen;
  recordgui_variable_color = MeterYellow;
  channel_position_color = MeterYellow;
- resources->meter_title_w = xS(25);
+ resources->meter_title_w = xS(28);
  edit_font_color = ComicYellow;
  assetedit_color = TextFgBright;
  timebar_cursor_color = WHITE;
index be173bc..9052377 100644 (file)
@@ -931,7 +931,7 @@ void HULKTHEME::initialize()
        recordgui_variable_color = RED;
 
        channel_position_color = MEYELLOW;
-       resources->meter_title_w = xS(25);
+       resources->meter_title_w = xS(28);
 
         // (asset) edit info text color
         edit_font_color = YELLOW;
index 8cb04d0..ac05732 100644 (file)
@@ -196,7 +196,7 @@ void NEOPHYTETHEME::initialize()
        recordgui_variable_color = RED;
              
        channel_position_color = ComicYellow; // Set Format, speaker numbers 
-       resources->meter_title_w = xS(25);
+       resources->meter_title_w = xS(28);
 
        // (asset) edit info text color
        edit_font_color = ComicYellow; // ? ../../cinelerra/theme.h:282
index bca5c59..9a0816c 100644 (file)
@@ -931,7 +931,7 @@ void PINKLADY::initialize()
        recordgui_variable_color = RED;
 
        channel_position_color = MEYELLOW;
-       resources->meter_title_w = xS(25);
+       resources->meter_title_w = xS(28);
 
         // (asset) edit info text color
         edit_font_color = YELLOW;
index 73ea0a2..7589ab5 100644 (file)
@@ -919,7 +919,7 @@ void SUV::initialize()
        recordgui_variable_color = RED;
 
        channel_position_color = MEYELLOW;
-       resources->meter_title_w = xS(25);
+       resources->meter_title_w = xS(28);
 
         // (asset) edit info text color
         edit_font_color = YELLOW;
index 4f537a1..6dbe900 100644 (file)
@@ -926,7 +926,7 @@ void UNFLATTHEME::initialize()
        recordgui_variable_color = RED;
 
        channel_position_color = MEYELLOW;
-       resources->meter_title_w = xS(25);
+       resources->meter_title_w = xS(28);
 
         // (asset) edit info text color
         edit_font_color = YELLOW;