rework set default transtion, nested proxy edl fixes, doubleclick proxy media fix...
authorGood Guy <[email protected]>
Wed, 20 Jun 2018 16:21:04 +0000 (10:21 -0600)
committerGood Guy <[email protected]>
Wed, 20 Jun 2018 16:21:04 +0000 (10:21 -0600)
13 files changed:
cinelerra-5.1/cinelerra/awindowgui.C
cinelerra-5.1/cinelerra/clippopup.C
cinelerra-5.1/cinelerra/edit.h
cinelerra-5.1/cinelerra/edl.C
cinelerra-5.1/cinelerra/edl.h
cinelerra-5.1/cinelerra/edlsession.C
cinelerra-5.1/cinelerra/edlsession.inc
cinelerra-5.1/cinelerra/mwindowedit.C
cinelerra-5.1/cinelerra/new.C
cinelerra-5.1/cinelerra/pluginlv2.C
cinelerra-5.1/cinelerra/proxy.C
cinelerra-5.1/cinelerra/proxy.h
cinelerra-5.1/guicast/bcfilebox.C

index 7e97656929ae6787fd8e37d0c8d13de183502c8d..19330e92051af647f0ca7ab156b0828ec70f9144 100644 (file)
@@ -2026,20 +2026,30 @@ int AWindowAssets::handle_event()
 {
        AssetPicon *asset_picon = (AssetPicon *)get_selection(0, 0);
        if( !asset_picon ) return 0;
+       Indexable *picon_idxbl = asset_picon->indexable;
+       EDL *picon_edl = asset_picon->edl;
+       int proxy = 0;
+       VWindow *vwindow = 0;
        switch( mwindow->edl->session->awindow_folder ) {
        case AW_AEFFECT_FOLDER:
        case AW_VEFFECT_FOLDER:
        case AW_ATRANSITION_FOLDER:
        case AW_VTRANSITION_FOLDER: return 1;
+       case AW_PROXY_FOLDER:
+               proxy = 1; // fall thru
+       default:
+               if( mwindow->vwindows.size() > DEFAULT_VWINDOW )
+                       vwindow = mwindow->vwindows.get(DEFAULT_VWINDOW);
+               break;
        }
-       VWindow *vwindow = mwindow->vwindows.size() > DEFAULT_VWINDOW ?
-               mwindow->vwindows.get(DEFAULT_VWINDOW) : 0;
        if( !vwindow || !vwindow->is_running() ) return 1;
+       if( proxy && picon_idxbl ) {
+               picon_edl = gui->collect_proxy(picon_idxbl);
+               picon_idxbl = 0;
+       }
 
-       if( asset_picon->indexable )
-               vwindow->change_source(asset_picon->indexable);
-       else if( asset_picon->edl )
-               vwindow->change_source(asset_picon->edl);
+       if( picon_idxbl ) vwindow->change_source(picon_idxbl);
+       else if( picon_edl ) vwindow->change_source(picon_edl);
        return 1;
 }
 
index 96e60c01eb258eaa537f6fad17a64e634eea614f..ad1bdbcc8d4955495a6c9d3062a9c899c969278c 100644 (file)
@@ -32,6 +32,7 @@
 #include "edit.h"
 #include "edits.h"
 #include "edl.h"
+#include "edlsession.h"
 #include "filexml.h"
 #include "language.h"
 #include "localsession.h"
@@ -429,7 +430,10 @@ int ClipPopupNest::handle_event()
 {
        MWindowGUI *gui = mwindow->gui;
        gui->lock_window("ClipPopupNest::handle_event 1");
-       if( mwindow->session->drag_clips->total > 0 ) {
+       if( mwindow->edl->session->proxy_scale != 1 ) {
+               eprintf("Nesting not allowed when proxy scale != 1");
+       }
+       else if( mwindow->session->drag_clips->total > 0 ) {
                EDL *edl = mwindow->edl;
                time_t dt;      time(&dt);
                struct tm dtm;  localtime_r(&dt, &dtm);
index adbb0c47e4e4e9ded3eeda5b9a16a6ce55418c42..e4bbcc5d2a8069d15540e4b248aae37c61b57444 100644 (file)
@@ -143,11 +143,11 @@ public:
 
        Track *track;
 
-// Asset is 0 if silence, otherwise points an object in edl->assets
+// points to an object in edl->assets if set
        Asset *asset;
-
-// points to an object in edl->clips if a nested clip
+// points to an object in edl->nested_edls if set
        EDL *nested_edl;
+// Asset and nested_edl are 0 if silence
 
 // Parent EDL of this edit
        EDL *edl;
index 3c3de37f9aa31b93be26a2eec2dc0dee6ea37bfb..ccc5a1b9999e6ff90692a3847bd897a7c4cf8b18 100644 (file)
 #include "autoconf.h"
 #include "automation.h"
 #include "awindowgui.inc"
+#include "bccmodels.h"
+#include "bchash.h"
 #include "bcsignals.h"
 #include "clip.h"
 #include "cstrdup.h"
-#include "bccmodels.h"
-#include "bchash.h"
 #include "clipedls.h"
 #include "edits.h"
 #include "edl.h"
 #include "edlsession.h"
 #include "filexml.h"
+#include "floatauto.h"
+#include "floatautos.h"
 #include "guicast.h"
 #include "indexstate.h"
 #include "interlacemodes.h"
@@ -735,6 +737,7 @@ double EDL::equivalent_output(EDL *edl)
 
 void EDL::set_path(const char *path)
 {
+       if( &this->path[0] == path ) return;
        strcpy(this->path, path);
 }
 
@@ -1460,3 +1463,125 @@ double EDL::prev_edit(double position)
        return new_position;
 }
 
+void EDL::rescale_proxy(int orig_scale, int new_scale)
+{
+       if( orig_scale == new_scale ) return;
+// project size
+       float orig_w = (float)session->output_w * orig_scale;
+       float orig_h = (float)session->output_h * orig_scale;
+       if( !parent_edl ) {
+               session->output_w = Units::round(orig_w / new_scale);
+               session->output_h = Units::round(orig_h / new_scale);
+       }
+
+// track sizes
+       for( Track *track=tracks->first; track; track=track->next ) {
+               if( track->data_type != TRACK_VIDEO ) continue;
+               orig_w = (float)track->track_w * orig_scale;
+               orig_h = (float)track->track_h * orig_scale;
+               track->track_w = Units::round(orig_w / new_scale);
+               track->track_h = Units::round(orig_h / new_scale);
+               ((MaskAutos*)track->automation->autos[AUTOMATION_MASK])->
+                       set_proxy(orig_scale, new_scale);
+               ((FloatAutos*)track->automation->autos[AUTOMATION_CAMERA_X])->
+                       set_proxy(orig_scale, new_scale);
+               ((FloatAutos*)track->automation->autos[AUTOMATION_CAMERA_Y])->
+                       set_proxy(orig_scale, new_scale);
+               ((FloatAutos*)track->automation->autos[AUTOMATION_PROJECTOR_X])->
+                       set_proxy(orig_scale, new_scale);
+               ((FloatAutos*)track->automation->autos[AUTOMATION_PROJECTOR_Y])->
+                       set_proxy(orig_scale, new_scale);
+       }
+}
+
+void EDL::set_proxy(int use_scaler, int new_scale, int auto_scale,
+       ArrayList<Indexable*> *orig_assets, ArrayList<Indexable*> *proxy_assets)
+{
+       int orig_use_scaler = session->proxy_use_scaler;
+       int orig_scale = session->proxy_scale;
+// rescale to full size asset in read_frame
+       session->proxy_use_scaler = use_scaler;
+       session->proxy_scale = new_scale;
+       session->proxy_auto_scale = auto_scale;
+
+       if( use_scaler ) {
+               for( int i=0; i<proxy_assets->size(); ++i ) {
+                       Asset *proxy_asset = (Asset *)proxy_assets->get(i);
+                       proxy_asset->width = orig_assets->get(i)->get_w();
+                       proxy_asset->height = orig_assets->get(i)->get_h();
+               }
+               new_scale = 1;
+       }
+
+       if( !orig_use_scaler )
+               rescale_proxy(orig_scale, new_scale);
+
+// change original assets to proxy assets
+       int awindow_folder = use_scaler || new_scale != 1 ? AW_PROXY_FOLDER : AW_MEDIA_FOLDER;
+       for( int i=0,n=proxy_assets->size(); i<n; ++i ) {
+               const char *orig_path = orig_assets->get(i)->path;
+               Indexable *proxy_idxbl = proxy_assets->get(i);
+               proxy_idxbl->awindow_folder = awindow_folder;
+               Asset *proxy_asset = proxy_idxbl->is_asset ? assets->update((Asset *)proxy_idxbl) : 0;
+               EDL *proxy_edl = !proxy_idxbl->is_asset ? (EDL *)proxy_idxbl : 0;
+// replace track contents
+               for( Track *track=tracks->first; track; track=track->next ) {
+                       if( track->data_type != TRACK_VIDEO ) continue;
+                       for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
+                               Indexable *idxbl = (Indexable *)edit->asset;
+                               if( !idxbl ) idxbl = (Indexable *)edit->nested_edl;
+                               if( !idxbl ) continue;
+                               if( strcmp(idxbl->path, orig_path) ) continue;
+                               edit->asset = proxy_asset;
+                               edit->nested_edl = proxy_edl;
+                       }
+               }
+               for( int j=0,m=clips.size(); j<m; ++j ) {
+                       EDL *clip = clips[j];
+                       int has_proxy = 0;
+                       for( Track *track=clip->tracks->first; track; track=track->next ) {
+                               if( track->data_type != TRACK_VIDEO ) continue;
+                               for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
+                                       Indexable *idxbl = (Indexable *)edit->asset;
+                                       if( !idxbl ) idxbl = (Indexable *)edit->nested_edl;
+                                       if( !idxbl ) continue;
+                                       if( strcmp(idxbl->path, orig_path) ) continue;
+                                       edit->asset = proxy_asset;
+                                       edit->nested_edl = proxy_edl;
+                                       has_proxy = 1;
+                               }
+                       }
+                       if( has_proxy && !orig_use_scaler )
+                               clip->rescale_proxy(orig_scale, new_scale);
+               }
+       }
+}
+
+void EDL::add_proxy(int use_scaler,
+       ArrayList<Indexable*> *orig_assets, ArrayList<Indexable*> *proxy_assets)
+{
+       if( use_scaler ) {
+               for( int i=0,n=proxy_assets->size(); i<n; ++i ) {
+                       Asset *proxy_asset = (Asset *)proxy_assets->get(i);
+                       proxy_asset->width = orig_assets->get(i)->get_w();
+                       proxy_asset->height = orig_assets->get(i)->get_h();
+               }
+       }
+
+// change original assets to proxy assets
+       for( int i=0,n=proxy_assets->size(); i<n; ++i ) {
+               Asset *proxy_asset = assets->update((Asset *)proxy_assets->get(i));
+               proxy_asset->awindow_folder = AW_PROXY_FOLDER;
+// replace track contents
+               for( Track *track=tracks->first; track; track=track->next ) {
+                       if( track->data_type != TRACK_VIDEO ) continue;
+                       for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
+                               if( !edit->asset ) continue;
+                               if( !strcmp(edit->asset->path, orig_assets->get(i)->path) ) {
+                                       edit->asset = proxy_asset;
+                               }
+                       }
+               }
+       }
+}
+
index 04170ad18aa45804a51d829b6ca9a2cfe902f04f..f5459de64e893ba8adb8a60185e3c9abbba899f7 100644 (file)
@@ -249,6 +249,11 @@ public:
 // Adds to list of EDLs & increase garbage collection counter
 // Does nothing if EDL already exists
        void append_vwindow_edl(EDL *edl, int increase_counter);
+       void rescale_proxy(int orig_scale, int new_scale);
+       void set_proxy(int use_scaler, int new_scale, int auto_scale,
+               ArrayList<Indexable*> *orig_assets, ArrayList<Indexable*> *proxy_assets);
+       void add_proxy(int use_scaler,
+               ArrayList<Indexable*> *orig_assets, ArrayList<Indexable*> *proxy_assets);
 
 // Titles of all subfolders
        ArrayList<char*> folders;
index 7e07ca8ca4f1be8859725e8013a885c7d44cfc7e..bfb85a75044c7bec40a2d3a015c5104af47b3166 100644 (file)
@@ -72,8 +72,8 @@ EDLSession::EDLSession(EDL *edl)
        cwindow_xscroll = cwindow_yscroll = 0;
        cwindow_zoom = 1.0;
        cwindow_click2play = 0;
-       strcpy(default_atransition, "");
-       strcpy(default_vtransition, "");
+       strcpy(default_atransition, INIT_ATRANSITION);
+       strcpy(default_vtransition, INIT_VTRANSITION);
        default_transition_length = 1.0;
        edit_handle_mode[0] = MOVE_ALL_EDITS;
        edit_handle_mode[1] = MOVE_ONE_EDIT;
@@ -248,9 +248,9 @@ int EDLSession::load_defaults(BC_Hash *defaults)
        cwindow_yscroll = defaults->get("CWINDOW_YSCROLL", 0);
        cwindow_zoom = defaults->get("CWINDOW_ZOOM", (float)1);
        cwindow_click2play = defaults->get("CWINDOW_CLICK2PLAY", 0);
-       sprintf(default_atransition, _("Crossfade"));
+       sprintf(default_atransition, INIT_ATRANSITION);
        defaults->get("DEFAULT_ATRANSITION", default_atransition);
-       sprintf(default_vtransition, _("Dissolve"));
+       sprintf(default_vtransition, INIT_VTRANSITION);
        defaults->get("DEFAULT_VTRANSITION", default_vtransition);
        default_transition_length = defaults->get("DEFAULT_TRANSITION_LENGTH", (double)1);
        edit_handle_mode[0] = defaults->get("EDIT_HANDLE_MODE0", MOVE_ALL_EDITS);
index 6010ee845196304be01d9126538ae039ebac2d56..6b4b5a056aa7b61a452a0badb9ee5e534ceab0a1 100644 (file)
@@ -22,6 +22,9 @@
 #ifndef EDLSESSION_INC
 #define EDLSESSION_INC
 
+#define INIT_ATRANSITION "Crossfade"
+#define INIT_VTRANSITION "Dissolve"
+
 class EDLSession;
 
 #endif
index eb06639824c8e0620f4307ecc9738e9cc158953a..3016050ba567e6451c6357143feeea4ff74fa016 100644 (file)
@@ -1655,11 +1655,6 @@ void MWindow::paste_transition()
        PluginServer *server = session->drag_pluginservers->values[0];
 
        undo->update_undo_before();
-       if( server->audio )
-               strcpy(edl->session->default_atransition, server->title);
-       else
-               strcpy(edl->session->default_vtransition, server->title);
-
        edl->tracks->paste_transition(server, session->edit_highlighted);
        save_backup();
        undo->update_undo_after(_("transition"), LOAD_EDITS);
@@ -1676,16 +1671,6 @@ void MWindow::paste_transitions(int track_type, char *title)
        double start = edl->local_session->get_selectionstart();
        double end = edl->local_session->get_selectionend();
        edl->tracks->paste_transitions(start, end, track_type, title);
-
-       switch( track_type ) {
-       case TRACK_AUDIO:
-               strcpy(edl->session->default_atransition, title);
-               break;
-       case TRACK_VIDEO:
-               strcpy(edl->session->default_vtransition, title);
-               break;
-       }
-
        save_backup();
        undo->update_undo_after(_("attach transitions"), LOAD_EDITS);
 
@@ -2331,119 +2316,19 @@ void MWindow::remap_audio(int pattern)
 
 void MWindow::rescale_proxy(EDL *clip, int orig_scale, int new_scale)
 {
-       if( orig_scale == new_scale ) return;
-// project size
-       float orig_w = (float)clip->session->output_w * orig_scale;
-       float orig_h = (float)clip->session->output_h * orig_scale;
-       if( !clip->parent_edl ) {
-               clip->session->output_w = Units::round(orig_w / new_scale);
-               clip->session->output_h = Units::round(orig_h / new_scale);
-       }
-
-// track sizes
-       for( Track *track=clip->tracks->first; track; track=track->next ) {
-               if( track->data_type != TRACK_VIDEO ) continue;
-               orig_w = (float)track->track_w * orig_scale;
-               orig_h = (float)track->track_h * orig_scale;
-               track->track_w = Units::round(orig_w / new_scale);
-               track->track_h = Units::round(orig_h / new_scale);
-               ((MaskAutos*)track->automation->autos[AUTOMATION_MASK])->
-                       set_proxy(orig_scale, new_scale);
-               ((FloatAutos*)track->automation->autos[AUTOMATION_CAMERA_X])->
-                       set_proxy(orig_scale, new_scale);
-               ((FloatAutos*)track->automation->autos[AUTOMATION_CAMERA_Y])->
-                       set_proxy(orig_scale, new_scale);
-               ((FloatAutos*)track->automation->autos[AUTOMATION_PROJECTOR_X])->
-                       set_proxy(orig_scale, new_scale);
-               ((FloatAutos*)track->automation->autos[AUTOMATION_PROJECTOR_Y])->
-                       set_proxy(orig_scale, new_scale);
-       }
+       edl->rescale_proxy(orig_scale, new_scale);
 }
 
 void MWindow::set_proxy(int use_scaler, int new_scale, int auto_scale,
-               ArrayList<Indexable*> *orig_assets,
-               ArrayList<Indexable*> *proxy_assets)
-{
-       int orig_use_scaler = edl->session->proxy_use_scaler;
-       int orig_scale = edl->session->proxy_scale;
-// rescale to full size asset in read_frame
-       edl->session->proxy_use_scaler = use_scaler;
-       edl->session->proxy_scale = new_scale;
-       edl->session->proxy_auto_scale = auto_scale;
-
-       if( use_scaler ) {
-               for( int i=0; i<proxy_assets->size(); ++i ) {
-                       Asset *proxy_asset = (Asset *)proxy_assets->get(i);
-                       proxy_asset->width = orig_assets->get(i)->get_w();
-                       proxy_asset->height = orig_assets->get(i)->get_h();
-               }
-               new_scale = 1;
-       }
-
-       if( !orig_use_scaler )
-               rescale_proxy(edl, orig_scale, new_scale);
-
-// change original assets to proxy assets
-       int awindow_folder = use_scaler || new_scale != 1 ? AW_PROXY_FOLDER : AW_MEDIA_FOLDER;
-       for( int i=0,n=proxy_assets->size(); i<n; ++i ) {
-               Asset *proxy_asset = edl->assets->update((Asset *)proxy_assets->get(i));
-               proxy_asset->awindow_folder = awindow_folder;
-// replace track contents
-               for( Track *track=edl->tracks->first; track; track=track->next ) {
-                       if( track->data_type != TRACK_VIDEO ) continue;
-                       for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
-                               if( !edit->asset ) continue;
-                               if( !strcmp(edit->asset->path, orig_assets->get(i)->path) ) {
-                                       edit->asset = proxy_asset;
-                               }
-                       }
-               }
-               for( int j=0,m=edl->clips.size(); j<m; ++j ) {
-                       EDL *clip = edl->clips[j];
-                       int has_proxy = 0;
-                       for( Track *track=clip->tracks->first; track; track=track->next ) {
-                               if( track->data_type != TRACK_VIDEO ) continue;
-                               for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
-                                       if( !edit->asset ) continue;
-                                       if( !strcmp(edit->asset->path, orig_assets->get(i)->path) ) {
-                                               has_proxy = 1;
-                                               edit->asset = proxy_asset;
-                                       }
-                               }
-                       }
-                       if( has_proxy && !orig_use_scaler )
-                               rescale_proxy(clip, orig_scale, new_scale);
-               }
-       }
+       ArrayList<Indexable*> *orig_assets, ArrayList<Indexable*> *proxy_assets)
+{
+       edl->set_proxy(use_scaler, new_scale, auto_scale, orig_assets, proxy_assets);
 }
 
 void MWindow::add_proxy(int use_scaler,
-               ArrayList<Indexable*> *orig_assets,
-               ArrayList<Indexable*> *proxy_assets)
-{
-       if( use_scaler ) {
-               for( int i=0,n=proxy_assets->size(); i<n; ++i ) {
-                       Asset *proxy_asset = (Asset *)proxy_assets->get(i);
-                       proxy_asset->width = orig_assets->get(i)->get_w();
-                       proxy_asset->height = orig_assets->get(i)->get_h();
-               }
-       }
-
-// change original assets to proxy assets
-       for( int i=0,n=proxy_assets->size(); i<n; ++i ) {
-               Asset *proxy_asset = edl->assets->update((Asset *)proxy_assets->get(i));
-               proxy_asset->awindow_folder = AW_PROXY_FOLDER;
-// replace track contents
-               for( Track *track=edl->tracks->first; track; track=track->next ) {
-                       if( track->data_type != TRACK_VIDEO ) continue;
-                       for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
-                               if( !edit->asset ) continue;
-                               if( !strcmp(edit->asset->path, orig_assets->get(i)->path) ) {
-                                       edit->asset = proxy_asset;
-                               }
-                       }
-               }
-       }
+       ArrayList<Indexable*> *orig_assets, ArrayList<Indexable*> *proxy_assets)
+{
+       edl->add_proxy(use_scaler, orig_assets, proxy_assets);
 }
 
 void MWindow::cut_commercials()
index e5aa6df4fb1ea87d5ed60e8129f2a323abc6b3b0..ef690a6dfb1566efe6d46516c5c27a6ad39544a7 100644 (file)
@@ -415,7 +415,8 @@ void NewWindow::create_objects()
 //     y += canvas_h_text->get_h() + 5;
 
        x1 = x;
-       add_subwindow(new BC_Title(x1, y, _("Track size:")));
+       add_subwindow(new BC_Title(x1, y, new_thread->load_mode == LOADMODE_REPLACE ?
+                       _("Canvas size:") : _("Track size:")));
        x1 += 115;
        add_subwindow(output_w_text = new NewOutputW(this, x1, y));
        x1 += output_w_text->get_w() + 2;
index d5f6c079eaf5ee4500a1a692d71caaa342541718..f4f1f7946df4ce9bf77b35e5dea84aa298f900aa 100644 (file)
@@ -128,6 +128,8 @@ int PluginLV2::load_lv2(const char *path, char *title)
 int PluginLV2::init_lv2(PluginLV2ClientConfig &conf, int sample_rate, int bfrsz)
 {
        reset_lv2();
+       double bps = 2. * sample_rate / bfrsz;
+       if( bps > refreshrate ) refreshrate = bps;
 
        lv2_AudioPort       = lilv_new_uri(world, LV2_CORE__AudioPort);
        lv2_ControlPort     = lilv_new_uri(world, LV2_CORE__ControlPort);
index 5432f478546fb1927cd64e7c20667e843545bb06..9f25a7e1131ca32b0db95594adefa037b539ebbb 100644 (file)
@@ -199,6 +199,26 @@ void ProxyDialog::to_proxy()
                        orig_idxbls.append(orig_asset);
                        orig_asset->add_user();
                }
+               for( int i=0,n=edl->nested_edls.size(); i<n; ++i ) {
+                       EDL *orig_nested = edl->nested_edls[i];
+                       char new_path[BCTEXTLEN];
+                       if( !ProxyRender::from_proxy_path(new_path, orig_nested, proxy_scale) )
+                               continue;
+                       proxy_render.to_proxy_path(new_path, orig_nested, proxy_scale);
+// test if proxy asset was already added to proxy_assets
+                       int got_it = 0;
+                       for( int i = 0; !got_it && i<proxy_assets.size(); ++i )
+                               got_it = !strcmp(proxy_assets[i]->path, new_path);
+                       if( got_it ) continue;
+                       Asset *proxy_nested = edl->assets->get_asset(new_path);
+                       if( !proxy_nested ) continue;
+// add pointer to existing EDL asset if it exists
+// EDL won't delete it unless it's the same pointer.
+                       proxy_assets.append(proxy_nested);
+                       proxy_nested->add_user();
+                       orig_idxbls.append(orig_nested);
+                       orig_nested->add_user();
+               }
 
 // convert from the proxy assets to the original assets
                int proxy_auto_scale = edl->session->proxy_auto_scale;
@@ -238,6 +258,19 @@ void ProxyDialog::to_proxy()
                                proxy_render.add_needed(orig, proxy);
                        }
                }
+               for( int i=0,n=edl->nested_edls.size(); i<n; ++i ) {
+                       EDL *orig_nested = edl->nested_edls[i];
+                       Asset *proxy = proxy_render.add_original(orig_nested, new_scale);
+                       if( !proxy ) continue;
+                       int exists = fs.get_size(proxy->path) > 0 ? 1 : 0;
+                       int got_it = exists && // if proxy exists, and is newer than orig_nested
+                           fs.get_date(proxy->path) > fs.get_date(orig_nested->path) ? 1 : 0;
+                       if( !got_it ) {
+                               if( exists ) // prompt user to overwrite
+                                       confirm_paths.append(cstrdup(proxy->path));
+                               proxy_render.add_needed(orig_nested, proxy);
+                       }
+               }
        }
 
        int result = 0;
@@ -291,19 +324,20 @@ void ProxyRender::to_proxy_path(char *new_path, Indexable *indexable, int scale)
 //printf("ProxyRender::to_proxy_path %d %s %s\n", __LINE__, new_path), asset->path);
 }
 
-void ProxyRender::from_proxy_path(char *new_path, Asset *asset, int scale)
+int ProxyRender::from_proxy_path(char *new_path, Indexable *indexable, int scale)
 {
        char prxy[BCTEXTLEN];
        int n = sprintf(prxy, ".proxy%d", scale);
-       strcpy(new_path, asset->path);
+       strcpy(new_path, indexable->path);
        char *ptr = strstr(new_path, prxy);
-       if( !ptr || (ptr[n] != '-' && ptr[n] != '.') ) return;
+       if( !ptr || (ptr[n] != '-' && ptr[n] != '.') ) return 1;
 // remove proxy, path.proxy#-sfx.ext => path.sfx
        char *ext = strrchr(ptr, '.');
        if( !ext ) ext = ptr + strlen(ptr);
        char *cp = ptr + n;
        for( *cp='.'; cp<ext; ++cp ) *ptr++ = *cp;
        *ptr = 0;
+       return 0;
 }
 
 ProxyRender::ProxyRender(MWindow *mwindow, Asset *format_asset)
index 8726cb78f0793f4dc44adaa89adb78440d803fa4..0db833ea2b87599096eb97e8eeb8ba37eca7e7b3 100644 (file)
@@ -68,7 +68,7 @@ public:
        ProxyRender(MWindow *mwindow, Asset *format_asset);
        ~ProxyRender();
        void to_proxy_path(char *new_path, Indexable *indexable, int scale);
-       static void from_proxy_path(char *new_path, Asset *asset, int scale);
+       static int from_proxy_path(char *new_path, Indexable *indexable, int scale);
 
        ArrayList<Indexable *> orig_idxbls;   // originals which match the proxy assets
        ArrayList<Indexable *> orig_proxies;  // proxy assets
index 8ffafb8169990717fac71831c4cd1457f9fba3a1..ae6e15f6f196b3d35ef48320e2198ac2f0c7a126 100644 (file)
@@ -562,10 +562,10 @@ void BC_FileBox::create_objects()
        {
                filter_list.append(new BC_ListBoxItem("*"));
                filter_list.append(new BC_ListBoxItem("[*.mkv][*.webm]"));
-               filter_list.append(new BC_ListBoxItem("[*.mp4]"));
+               filter_list.append(new BC_ListBoxItem("[*.mp4][*.MP4]"));
                filter_list.append(new BC_ListBoxItem("[*.mp2][*.mp3][*.wav]"));
                filter_list.append(new BC_ListBoxItem("[*.avi][*.mpg][*.m2v][*.m1v][*.mov]"));
-               filter_list.append(new BC_ListBoxItem("[*.jpg][*.png][*.gif][*.tiff]"));
+               filter_list.append(new BC_ListBoxItem("[*.jpg][*.JPG][*.png][*.gif][*.tiff]"));
                filter_list.append(new BC_ListBoxItem("*.xml"));
                fs->set_filter(get_resources()->filebox_filter);
        }