proxy images, add beep on proxy auto_load, fix unnest proxy bug, vwin in/out to_clip bug
authorGood Guy <good1.2guy@gmail.com>
Wed, 11 Jul 2018 00:49:04 +0000 (18:49 -0600)
committerGood Guy <good1.2guy@gmail.com>
Wed, 11 Jul 2018 00:49:04 +0000 (18:49 -0600)
cinelerra-5.1/cinelerra/clippopup.C
cinelerra-5.1/cinelerra/mwindow.C
cinelerra-5.1/cinelerra/mwindowedit.C
cinelerra-5.1/cinelerra/proxy.C

index ad1bdbcc8d4955495a6c9d3062a9c899c969278c..df439311dc32d95819f75335a8f11b0db4cad808 100644 (file)
@@ -492,7 +492,9 @@ int ClipPopupUnNest::handle_event()
                nested_edl = edit && !edit->next && !edit->asset ? edit->nested_edl : 0;
                while( nested_edl && (track=track->next)!=0 ) {
                        Edit *edit = track->edits->first;
                nested_edl = edit && !edit->next && !edit->asset ? edit->nested_edl : 0;
                while( nested_edl && (track=track->next)!=0 ) {
                        Edit *edit = track->edits->first;
-                       if( !edit || edit->next || edit->nested_edl != nested_edl )
+                       if( !edit || edit->next ||
+                           ( edit->nested_edl != nested_edl &&
+                             strcmp(edit->nested_edl->path, nested_edl->path) ) )
                                nested_edl = 0;
                }
                if( nested_edl ) {
                                nested_edl = 0;
                }
                if( nested_edl ) {
index 565f33283a705a29902585f131badf72817a3f0a..2e590c668f376c244c2d46fd6af4f7693962888c 100644 (file)
@@ -2256,6 +2256,7 @@ int MWindow::render_proxy(ArrayList<Indexable *> &new_idxbls)
 
 int MWindow::enable_proxy()
 {
 
 int MWindow::enable_proxy()
 {
+       int ret = 0;
        if( edl->session->proxy_scale == 1 &&
            edl->session->proxy_disabled_scale != 1 ) {
                int new_scale = edl->session->proxy_disabled_scale;
        if( edl->session->proxy_scale == 1 &&
            edl->session->proxy_disabled_scale != 1 ) {
                int new_scale = edl->session->proxy_disabled_scale;
@@ -2263,8 +2264,10 @@ int MWindow::enable_proxy()
                Asset *asset = new Asset;
                asset->format = FILE_FFMPEG;
                asset->load_defaults(defaults, "PROXY_", 1, 1, 0, 0, 0);
                Asset *asset = new Asset;
                asset->format = FILE_FFMPEG;
                asset->load_defaults(defaults, "PROXY_", 1, 1, 0, 0, 0);
-               to_proxy(asset, new_scale);
+               ret = to_proxy(asset, new_scale);
                asset->remove_user();
                asset->remove_user();
+               if( ret > 0 )
+                       beep(2000., 1.5, 0.5);
        }
        return 1;
 }
        }
        return 1;
 }
index e5d90c6b52e23ef8cef4f96cadacee22f5f4cb5a..4e5ec2886b7a617577c261a83f9c9350672746b6 100644 (file)
@@ -2091,14 +2091,16 @@ void MWindow::save_clip(EDL *new_edl, const char *txt)
 void MWindow::to_clip(EDL *edl, const char *txt, int all)
 {
        FileXML file;
 void MWindow::to_clip(EDL *edl, const char *txt, int all)
 {
        FileXML file;
-       double start, end;
+       LocalSession *src = edl->local_session;
 
        gui->lock_window("MWindow::to_clip 1");
 
        gui->lock_window("MWindow::to_clip 1");
-       start = all ? 0 :
-               edl->local_session->get_selectionstart();
-       end = all ? edl->tracks->total_length() :
-               edl->local_session->get_selectionend();
-
+       double start = all ? 0 :
+               src->inpoint_valid() ? src->get_inpoint() :
+               src->outpoint_valid() ? 0 : src->get_selectionstart();
+       double end = all ? edl->tracks->total_length() :
+               src->outpoint_valid() ? src->get_outpoint() :
+               src->inpoint_valid() ? edl->tracks->total_length() :
+                       src->get_selectionend();
        if( EQUIV(end, start) ) {
                start = 0;
                end = edl->tracks->total_length();
        if( EQUIV(end, start) ) {
                start = 0;
                end = edl->tracks->total_length();
index 3acfa42247b0a12118d0d53d065d45dfe8efb10f..fc1380edfc9b32391fcef17707543b427322daea 100644 (file)
@@ -194,9 +194,11 @@ void ProxyRender::to_proxy_path(char *new_path, Indexable *indexable, int scale)
                sfx = ep;  ep += n;
        }
        for( char *cp=prxy; --n>=0; ++cp ) *sfx++ = *cp;
                sfx = ep;  ep += n;
        }
        for( char *cp=prxy; --n>=0; ++cp ) *sfx++ = *cp;
-       const char *ext = format_asset->format == FILE_FFMPEG ?
-               format_asset->fformat : File::get_tag(format_asset->format);
        *ep++ = '.';
        *ep++ = '.';
+       const char *ext = indexable->get_video_frames() < 0 ?  "png" :
+               format_asset->format == FILE_FFMPEG ?
+                       format_asset->fformat :
+                       File::get_tag(format_asset->format);
        while( *ext ) *ep++ = *ext++;
        *ep = 0;
 //printf("ProxyRender::to_proxy_path %d %s %s\n", __LINE__, new_path), asset->path);
        while( *ext ) *ep++ = *ext++;
        *ep = 0;
 //printf("ProxyRender::to_proxy_path %d %s %s\n", __LINE__, new_path), asset->path);
@@ -242,7 +244,6 @@ ProxyRender::~ProxyRender()
 Asset *ProxyRender::add_original(Indexable *idxbl, int new_scale)
 {
        if( !idxbl->have_video() ) return 0;
 Asset *ProxyRender::add_original(Indexable *idxbl, int new_scale)
 {
        if( !idxbl->have_video() ) return 0;
-       if( idxbl->get_video_frames() <= 0 ) return 0;
 // don't proxy proxies
        if( strstr(idxbl->path,".proxy") ) return 0;
        char new_path[BCTEXTLEN];
 // don't proxy proxies
        if( strstr(idxbl->path,".proxy") ) return 0;
        char new_path[BCTEXTLEN];
@@ -259,7 +260,16 @@ Asset *ProxyRender::add_original(Indexable *idxbl, int new_scale)
        if( !proxy ) {
                proxy = new Asset(new_path);
 // new compression parameters
        if( !proxy ) {
                proxy = new Asset(new_path);
 // new compression parameters
-               proxy->copy_format(format_asset, 0);
+               int64_t video_length = idxbl->get_video_frames();
+               if( video_length < 0 ) {
+                       proxy->format = FILE_PNG;
+                       proxy->png_use_alpha = 1;
+                       proxy->video_length = 1;
+               }
+               else {
+                       proxy->copy_format(format_asset, 0);
+                       proxy->video_length = video_length;
+               }
                proxy->awindow_folder = AW_PROXY_FOLDER;
                proxy->audio_data = 0;
                proxy->video_data = 1;
                proxy->awindow_folder = AW_PROXY_FOLDER;
                proxy->audio_data = 0;
                proxy->video_data = 1;
@@ -271,7 +281,6 @@ Asset *ProxyRender::add_original(Indexable *idxbl, int new_scale)
                if( proxy->height & 1 ) ++proxy->height;
                proxy->actual_height = proxy->height;
                proxy->frame_rate = idxbl->get_frame_rate();
                if( proxy->height & 1 ) ++proxy->height;
                proxy->actual_height = proxy->height;
                proxy->frame_rate = idxbl->get_frame_rate();
-               proxy->video_length = idxbl->get_video_frames();
                edl_assets->append(proxy);
        }
        proxy->add_user();
                edl_assets->append(proxy);
        }
        proxy->add_user();
@@ -660,8 +669,10 @@ void ProxyClient::process_package(LoadPackage *ptr)
        VFrame src_frame(src_w,src_h, edl->session->color_model);
 
        OverlayFrame scaler(processors);
        VFrame src_frame(src_w,src_h, edl->session->color_model);
 
        OverlayFrame scaler(processors);
+       int64_t video_length = orig->get_video_frames();
+       if( video_length < 0 ) video_length = 1;
 
 
-       for( int64_t i=0, length=orig->get_video_frames(); i<length &&
+       for( int64_t i=0; i<video_length &&
             !proxy_render->failed && !proxy_render->is_canceled(); ++i ) {
                if( orig->is_asset ) {
                        src_file->set_video_position(i, 0);
             !proxy_render->failed && !proxy_render->is_canceled(); ++i ) {
                if( orig->is_asset ) {
                        src_file->set_video_position(i, 0);