added keyframe reticle, fixes: DEL, transition at endtrk, DVD/BD render menu
authorGood Guy <[email protected]>
Fri, 22 Apr 2016 01:26:04 +0000 (19:26 -0600)
committerGood Guy <[email protected]>
Fri, 22 Apr 2016 01:26:04 +0000 (19:26 -0600)
20 files changed:
cinelerra-5.1/cinelerra/batchrender.C
cinelerra-5.1/cinelerra/batchrender.h
cinelerra-5.1/cinelerra/bdcreate.C
cinelerra-5.1/cinelerra/dvdcreate.C
cinelerra-5.1/cinelerra/edits.C
cinelerra-5.1/cinelerra/formattools.C
cinelerra-5.1/cinelerra/interfaceprefs.C
cinelerra-5.1/cinelerra/interfaceprefs.h
cinelerra-5.1/cinelerra/mainmenu.C
cinelerra-5.1/cinelerra/mainsession.C
cinelerra-5.1/cinelerra/mwindow.C
cinelerra-5.1/cinelerra/mwindow.inc
cinelerra-5.1/cinelerra/mwindowgui.C
cinelerra-5.1/cinelerra/preferences.C
cinelerra-5.1/cinelerra/preferences.h
cinelerra-5.1/cinelerra/trackcanvas.C
cinelerra-5.1/cinelerra/trackcanvas.h
cinelerra-5.1/cinelerra/vdevicebuz.C
cinelerra-5.1/global_config
cinelerra-5.1/thirdparty/configure

index d2a7341f0ff86a7ddd0c6086b0e91700bcac1883..20e27d596ef230d06e19ccf83b1cd90da942444b 100644 (file)
@@ -235,6 +235,18 @@ BatchRenderThread::~BatchRenderThread()
        }
 }
 
+void BatchRenderThread::reset()
+{
+       current_job = 0;
+       rendering_job = -1;
+       delete default_job;  default_job = 0;
+       jobs.remove_all_objects();
+       if(file_entries) {
+               file_entries->remove_all_objects();
+               delete file_entries;  file_entries = 0;
+       }
+}
+
 void BatchRenderThread::handle_close_event(int result)
 {
 // Save settings
@@ -242,15 +254,7 @@ void BatchRenderThread::handle_close_event(int result)
        path[0] = 0;
        save_jobs(path);
        save_defaults(mwindow->defaults);
-       delete default_job;
-       default_job = 0;
-       jobs.remove_all_objects();
-       if(file_entries)
-       {
-               file_entries->remove_all_objects();
-               delete file_entries;
-               file_entries = 0;
-       }
+       reset();
 }
 
 BC_Window* BatchRenderThread::new_gui()
@@ -737,108 +741,61 @@ void BatchRenderGUI::create_objects()
 
        int x = mwindow->theme->batchrender_x1;
        int y = 5;
-       int x1 = mwindow->theme->batchrender_x1;
-       int x2 = mwindow->theme->batchrender_x2;
-       //int x3 = mwindow->theme->batchrender_x3;
-       int y1 = y;
-       int y2;
+       int x1 = x, x2 = get_w()/2 + 10; // mwindow->theme->batchrender_x2;
+       int y1 = 5, y2 = 5;
 
 // output file
-       add_subwindow(output_path_title = new BC_Title(x1, y, _("Output path:")));
-       y += 20;
-       format_tools = new BatchFormat(mwindow,
-                                       this,
-                                       thread->get_current_asset());
+       add_subwindow(output_path_title = new BC_Title(x1, y1, _("Output path:")));
+       y1 += output_path_title->get_h() + mwindow->theme->widget_border;
+
+       format_tools = new BatchFormat(mwindow, this, thread->get_current_asset());
        format_tools->set_w(get_w() / 2);
-       format_tools->create_objects(x,
-                                               y,
-                                               1,
-                                               1,
-                                               1,
-                                               1,
-                                               0,
-                                               1,
-                                               0,
-                                               0,
-                                               &thread->get_current_job()->strategy,
-                                               0);
-
-       x2 = x;
-       y2 = y + 10;
-       x += format_tools->get_w();
-       y = y1;
-       x1 = x;
-       //x3 = x + 80;
+       format_tools->create_objects(x1, y1, 1, 1, 1, 1, 0, 1, 0, 0,
+                       &thread->get_current_job()->strategy, 0); 
 
 // input EDL
-       x = x1;
-       add_subwindow(edl_path_title = new BC_Title(x, y, _("EDL Path:")));
-       y += 20;
-       add_subwindow(edl_path_text = new BatchRenderEDLPath(
-               thread,
-               x,
-               y,
-               get_w() - x - 40,
-               thread->get_current_edl()));
-
-       x += edl_path_text->get_w();
+       add_subwindow(edl_path_title = new BC_Title(x2, y2, _("EDL Path:")));
+       y2 += edl_path_title->get_h() + mwindow->theme->widget_border;
+       
+       x = x2;  y = y2;
+       add_subwindow(edl_path_text = new BatchRenderEDLPath( thread,
+               x, y, get_w()-x - 40, thread->get_current_edl())); 
+       x =  x2 + edl_path_text->get_w();
        add_subwindow(edl_path_browse = new BrowseButton(
                mwindow, this, edl_path_text, x, y, thread->get_current_edl(),
                _("Input EDL"), _("Select an EDL to load:"), 0));
+       y2 = y + edl_path_browse->get_h() + mwindow->theme->widget_border;
 
-       x = x1;
-       y += 64;
-       update_selected_edl = new BatchRenderUpdateEDL(thread, x, y);
-       add_subwindow(update_selected_edl);
+       x = x2;  y = y2;
+       add_subwindow(update_selected_edl = new BatchRenderUpdateEDL(thread, x, y));
        y += update_selected_edl->get_h() + mwindow->theme->widget_border;
-
-       add_subwindow(new_batch = new BatchRenderNew(thread,
-               x,
-               y));
-       x += new_batch->get_w() + 10;
-
-       add_subwindow(delete_batch = new BatchRenderDelete(thread,
-               x,
-               y));
-       x = new_batch->get_x();
-       y += new_batch->get_h() + mwindow->theme->widget_border;
-       use_current_edl = new BatchRenderCurrentEDL(thread, x, y);
-       add_subwindow(use_current_edl);
+       add_subwindow(use_current_edl = new BatchRenderCurrentEDL(thread, x, y));
+       y += use_current_edl->get_h() + mwindow->theme->widget_border;
        if( !mwindow->edl || !mwindow->edl->path[0] ) use_current_edl->disable();
+       add_subwindow(new_batch = new BatchRenderNew(thread, x, y));
+       x += new_batch->get_w() + mwindow->theme->widget_border;
+       add_subwindow(delete_batch = new BatchRenderDelete(thread, x, y));
+       x = x2;  y += delete_batch->get_h() + mwindow->theme->widget_border;
+       add_subwindow(savelist_batch = new BatchRenderSaveList(thread, x, y));
+       x += savelist_batch->get_w() + mwindow->theme->widget_border;
+       add_subwindow(loadlist_batch = new BatchRenderLoadList(thread, x, y));
+       y2 = y + loadlist_batch->get_h() + mwindow->theme->widget_border;
+       if( y2 > y1 ) y1 = y2;
+       x = mwindow->theme->batchrender_x1, y = y1;
 
-       savelist_batch = new BatchRenderSaveList(thread, x, y);
-       add_subwindow(savelist_batch);
-       x += savelist_batch->get_w() + 10;
-
-       loadlist_batch = new BatchRenderLoadList(thread, x, y);
-       add_subwindow(loadlist_batch);
-       x += loadlist_batch->get_w() + 10;
-
-       x = x2;
-       y = y2;
        add_subwindow(list_title = new BC_Title(x, y, _("Batches to render:")));
-       y += 20;
-       add_subwindow(batch_list = new BatchRenderList(thread,
-               x,
-               y,
-               get_w() - x - 10,
-               get_h() - y - BC_GenericButton::calculate_h() - 15));
-
-       y += batch_list->get_h() + 10;
-       add_subwindow(start_button = new BatchRenderStart(thread,
-           x,
-           y));
-       x = get_w() / 2 -
-               BC_GenericButton::calculate_w(this, _("Stop")) / 2;
-       add_subwindow(stop_button = new BatchRenderStop(thread,
-               x,
-               y));
-       x = get_w() -
-               BC_GenericButton::calculate_w(this, _("Close")) -
-               10;
-       add_subwindow(cancel_button = new BatchRenderCancel(thread,
-               x,
-               y));
+       y += list_title->get_h() + mwindow->theme->widget_border;
+       y1 = get_h();
+       y1 -= 15 + BC_GenericButton::calculate_h() + mwindow->theme->widget_border;
+       add_subwindow(batch_list = new BatchRenderList(thread, x, y,
+               get_w() - x - 10, y1 - y));
+       y += batch_list->get_h() + mwindow->theme->widget_border;
+
+       add_subwindow(start_button = new BatchRenderStart(thread, x, y));
+       x = get_w() / 2 - BC_GenericButton::calculate_w(this, _("Stop")) / 2;
+       add_subwindow(stop_button = new BatchRenderStop(thread, x, y));
+       x = get_w() - BC_GenericButton::calculate_w(this, _("Close")) - 10;
+       add_subwindow(cancel_button = new BatchRenderCancel(thread, x, y));
 
        show_window(1);
        unlock_window();
@@ -869,63 +826,52 @@ int BatchRenderGUI::resize_event(int w, int h)
 
        int x = mwindow->theme->batchrender_x1;
        int y = 5;
-       int x1 = mwindow->theme->batchrender_x1;
-       int x2 = mwindow->theme->batchrender_x2;
-       //int x3 = mwindow->theme->batchrender_x3;
-       int y1 = y;
-       int y2;
-
-       output_path_title->reposition_window(x1, y);
-       y += 20;
-       format_tools->reposition_window(x, y);
-       x2 = x;
-       y2 = y + 10;
-       y = y1;
-       x += format_tools->get_w();
-       x1 = x;
-       //x3 = x + 80;
-
-       x = x1;
+       int x1 = x, x2 = get_w()/2 + 10; // mwindow->theme->batchrender_x2;
+       int y1 = 5, y2 = 5;
+
+// output file
+       output_path_title->reposition_window(x1, y1);
+       y1 += output_path_title->get_h() + mwindow->theme->widget_border;
+       format_tools->reposition_window(x1, y1);
+
+// input EDL
+       x = x2, y = y2;
        edl_path_title->reposition_window(x, y);
-       y += 20;
+       y += edl_path_title->get_h() + mwindow->theme->widget_border;
        edl_path_text->reposition_window(x, y, w - x - 40);
        x += edl_path_text->get_w();
        edl_path_browse->reposition_window(x, y);
+       y2 = y + edl_path_browse->get_h() + mwindow->theme->widget_border;
 
-       x = x1;
-//     y += 30;
-//     status_title->reposition_window(x, y);
-//     x = x3;
-//     status_text->reposition_window(x, y);
-//     x = x1;
-//     y += 30;
-//     progress_bar->reposition_window(x, y, w - x - 10);
-
-       y += 30;
+       x = x2;  y = y2;
        update_selected_edl->reposition_window(x, y);
        y += update_selected_edl->get_h() + mwindow->theme->widget_border;
+       use_current_edl->reposition_window(x, y);
+       y += use_current_edl->get_h() + mwindow->theme->widget_border;
        new_batch->reposition_window(x, y);
-       x += new_batch->get_w() + 10;
+       x += new_batch->get_w() + mwindow->theme->widget_border;
        delete_batch->reposition_window(x, y);
-       x = new_batch->get_x();
-       y += new_batch->get_h() + mwindow->theme->widget_border;
-       use_current_edl->reposition_window(x, y);
 
-       x = x2;
-       y = y2;
-       int y_margin = get_h() - batch_list->get_h();
+       x = x2;  y += delete_batch->get_h() + mwindow->theme->widget_border;
+       savelist_batch->reposition_window(x, y);
+       x += savelist_batch->get_w() + mwindow->theme->widget_border;
+       loadlist_batch->reposition_window(x, y);
+       y += loadlist_batch->get_h() + mwindow->theme->widget_border;
+
+       y1 = 15 + BC_GenericButton::calculate_h() + mwindow->theme->widget_border;
+       y2 = get_h() - y1 - batch_list->get_h();
+       y2 -= list_title->get_h() + mwindow->theme->widget_border;
+
+       x = mwindow->theme->batchrender_x1;  y = y2;
        list_title->reposition_window(x, y);
-       y += 20;
-       batch_list->reposition_window(x, y, w - x - 10, h - y_margin);
+       y += list_title->get_h() + mwindow->theme->widget_border;
+       batch_list->reposition_window(x, y, w - x - 10, h - y - y1);
+       y += batch_list->get_h() + mwindow->theme->widget_border;
 
-       y += batch_list->get_h() + 10;
        start_button->reposition_window(x, y);
-       x = w / 2 -
-               stop_button->get_w() / 2;
+       x = w / 2 - stop_button->get_w() / 2;
        stop_button->reposition_window(x, y);
-       x = w -
-               cancel_button->get_w() -
-               10;
+       x = w - cancel_button->get_w() - 10;
        cancel_button->reposition_window(x, y);
        return 1;
 }
index 8e29b035d96b941b517ad3d347d4be66e564c05f..d848d98907decf72c6387bc55fd13b3ca8d36de3 100644 (file)
@@ -92,7 +92,7 @@ public:
        int test_edl_files();
        void calculate_dest_paths(ArrayList<char*> *paths,
                Preferences *preferences);
-
+       void reset();
 // Load batch rendering jobs
        void load_jobs(char *path, Preferences *preferences);
 // Not applicable to western civilizations
index d1eb5741eb3d96622635ee9247dec7df2513e76d..f74538037cd3fcd3c0f8f24cc362f0ff1649ee8b 100644 (file)
@@ -250,9 +250,10 @@ void CreateBD_Thread::handle_close_event(int result)
                insert_video_plugin("Inverse Telecine", &keyframe);
        }
        if( use_scale ) {
-               sprintf(data,"<PHOTOSCALE WIDTH=%d HEIGHT=%d USE_FILE=1>", BD_WIDTH, BD_HEIGHT);
+               sprintf(data,"<SCALE TYPE=1 X_FACTOR=1 Y_FACTOR=1 "
+                       " WIDTH=%d HEIGHT=%d CONSTRAIN=0>", BD_WIDTH, BD_HEIGHT);
                keyframe.set_data(data);
-               insert_video_plugin("Auto Scale", &keyframe);
+               insert_video_plugin("Scale", &keyframe);
        }
        if( use_resize_tracks )
                resize_tracks();
@@ -278,6 +279,7 @@ void CreateBD_Thread::handle_close_event(int result)
                keyframe.set_data(data);
                insert_video_plugin("Histogram", &keyframe);
        }
+       mwindow->batch_render->reset();
        create_bd_jobs(&mwindow->batch_render->jobs, tmp_path, asset_title);
        mwindow->save_backup();
        mwindow->undo->update_undo_after(_("create bd"), LOAD_ALL);
@@ -648,7 +650,7 @@ insert_video_plugin(const char *title, KeyFrame *default_keyframe)
                vtrk->plugin_set.append(plugin_set);
                Edits *edits = vtrk->edits;
                for( Edit *edit=edits->first; edit; edit=edit->next ) {
-                       plugin_set->insert_plugin(title,
+                       plugin_set->insert_plugin(_(title),
                                edit->startproject, edit->length,
                                PLUGIN_STANDALONE, 0, default_keyframe, 0);
                }
@@ -661,7 +663,6 @@ int CreateBD_Thread::
 resize_tracks()
 {
        Tracks *tracks = mwindow->edl->tracks;
-#if 0
        int max_w = 0, max_h = 0;
        for( Track *vtrk=tracks->first; vtrk; vtrk=vtrk->next ) {
                if( vtrk->data_type != TRACK_VIDEO ) continue;
@@ -675,12 +676,12 @@ resize_tracks()
                        if( h > max_h ) max_h = h;
                }
        }
-#endif
+
        for( Track *vtrk=tracks->first; vtrk; vtrk=vtrk->next ) {
                if( vtrk->data_type != TRACK_VIDEO ) continue;
                if( !vtrk->record ) continue;
-               vtrk->track_w = BD_WIDTH; // max_w;
-               vtrk->track_h = BD_HEIGHT; // max_h;
+               vtrk->track_w = max_w;
+               vtrk->track_h = max_h;
        }
        return 0;
 }
@@ -698,6 +699,7 @@ option_presets()
                switch( trk->data_type ) {
                case TRACK_VIDEO:
                        for( Edit *edit=edits->first; edit; edit=edit->next ) {
+                               if( edit->silence() ) continue;
                                Indexable *indexable = edit->get_source();
                                int w = indexable->get_w();
                                if( w > max_w ) max_w = w;
@@ -710,10 +712,10 @@ option_presets()
                                for(Plugin *plugin = (Plugin*)trk->plugin_set[i]->first;
                                                plugin;
                                                plugin = (Plugin*)plugin->next) {
-                                       if( !strcmp(plugin->title, "Deinterlace") )
+                                       if( !strcmp(plugin->title, _("Deinterlace")) )
                                                has_deinterlace = 1;
-                                       if( !strcmp(plugin->title, "Auto Scale") ||
-                                           !strcmp(plugin->title, "Scale") )
+                                       if( !strcmp(plugin->title, _("Auto Scale")) ||
+                                           !strcmp(plugin->title, _("Scale")) )
                                                has_scale = 1;
                                }
                        }
index c560f208d1e70c283a20d104a23e111478681771..05dde68b9a5db2d997755def98eec644e2aa42f8 100644 (file)
@@ -324,9 +324,10 @@ void CreateDVD_Thread::handle_close_event(int result)
                insert_video_plugin("Inverse Telecine", &keyframe);
        }
        if( use_scale ) {
-               sprintf(data,"<PHOTOSCALE WIDTH=%d HEIGHT=%d USE_FILE=1>", DVD_WIDTH, DVD_HEIGHT);
+               sprintf(data,"<SCALE TYPE=1 X_FACTOR=1 Y_FACTOR=1 "
+                       "WIDTH=%d HEIGHT=%d CONSTRAIN=0>", DVD_WIDTH, DVD_HEIGHT);
                keyframe.set_data(data);
-               insert_video_plugin("Auto Scale", &keyframe);
+               insert_video_plugin("Scale", &keyframe);
        }
        if( use_resize_tracks )
                resize_tracks();
@@ -352,6 +353,7 @@ void CreateDVD_Thread::handle_close_event(int result)
                keyframe.set_data(data);
                insert_video_plugin("Histogram", &keyframe);
        }
+       mwindow->batch_render->reset();
        create_dvd_jobs(&mwindow->batch_render->jobs, tmp_path, asset_title);
        mwindow->save_backup();
        mwindow->undo->update_undo_after(_("create dvd"), LOAD_ALL);
@@ -736,7 +738,7 @@ insert_video_plugin(const char *title, KeyFrame *default_keyframe)
                vtrk->plugin_set.append(plugin_set);
                Edits *edits = vtrk->edits;
                for( Edit *edit=edits->first; edit; edit=edit->next ) {
-                       plugin_set->insert_plugin(title,
+                       plugin_set->insert_plugin(_(title),
                                edit->startproject, edit->length,
                                PLUGIN_STANDALONE, 0, default_keyframe, 0);
                }
@@ -749,7 +751,6 @@ int CreateDVD_Thread::
 resize_tracks()
 {
        Tracks *tracks = mwindow->edl->tracks;
-#if 0
        int max_w = 0, max_h = 0;
        for( Track *vtrk=tracks->first; vtrk; vtrk=vtrk->next ) {
                if( vtrk->data_type != TRACK_VIDEO ) continue;
@@ -763,12 +764,12 @@ resize_tracks()
                        if( h > max_h ) max_h = h;
                }
        }
-#endif
+
        for( Track *vtrk=tracks->first; vtrk; vtrk=vtrk->next ) {
                if( vtrk->data_type != TRACK_VIDEO ) continue;
                if( !vtrk->record ) continue;
-               vtrk->track_w = DVD_WIDTH; // max_w;
-               vtrk->track_h = DVD_HEIGHT; // max_h;
+               vtrk->track_w = max_w;
+               vtrk->track_h = max_h;
        }
        return 0;
 }
@@ -786,6 +787,7 @@ option_presets()
                switch( trk->data_type ) {
                case TRACK_VIDEO:
                        for( Edit *edit=edits->first; edit; edit=edit->next ) {
+                               if( edit->silence() ) continue;
                                Indexable *indexable = edit->get_source();
                                int w = indexable->get_w();
                                if( w > max_w ) max_w = w;
@@ -798,10 +800,10 @@ option_presets()
                                for(Plugin *plugin = (Plugin*)trk->plugin_set[i]->first;
                                                plugin;
                                                plugin = (Plugin*)plugin->next) {
-                                       if( !strcmp(plugin->title, "Deinterlace") )
+                                       if( !strcmp(plugin->title, _("Deinterlace")) )
                                                has_deinterlace = 1;
-                                       if( !strcmp(plugin->title, "Auto Scale") ||
-                                           !strcmp(plugin->title, "Scale") )
+                                       if( !strcmp(plugin->title, _("Auto Scale")) ||
+                                           !strcmp(plugin->title, _("Scale")) )
                                                has_scale = 1;
                                }
                        }
index 7d152bc5ef0e59c50155e2a2a34bedbb78dd0863..1face800f82ee333c5aab4b1ee989ff5baf71a3e 100644 (file)
@@ -408,7 +408,7 @@ int Edits::optimize()
                        current = current->next;
                }
 
-               if(last && last->silence()) {
+               if(last && last->silence() && !last->transition ) {
                        delete last;
                        result = 1;
                }
index 28f4b556461f7a1337a9272df7c7f497dcaa7637..ad6df95b18b19379cc0b5a128bd0dc656ed7d4b5 100644 (file)
@@ -179,21 +179,20 @@ void FormatTools::create_objects(int &init_x,
 
        if(!recording)
        {
-               window->add_subwindow(path_textbox = new FormatPathText(x, y, this));
-               x += path_textbox->get_w() + 5;
+               int px = x;
+               window->add_subwindow(path_textbox = new FormatPathText(px, y, this));
+               px += path_textbox->get_w() + 5;
                path_recent = new BC_RecentList("PATH", mwindow->defaults,
-                                       path_textbox, 10, x, y, 300, 100);
+                                       path_textbox, 10, px, y, 300, 100);
                window->add_subwindow(path_recent);
                path_recent->load_items(File::formattostr(asset->format));
-               x += path_recent->get_w() + 8;
+               px += path_recent->get_w() + 8;
                window->add_subwindow(path_button = new BrowseButton(
-                       mwindow, window, path_textbox, x, y, asset->path,
+                       mwindow, window, path_textbox, px, y, asset->path,
                        _("Output to file"), _("Select a file to write to:"), 0));
 
 // Set w for user.
                w = MAX(w, 305);
-//             w = x + path_button->get_w() + 5;
-               x -= path_textbox->get_w() + 5;
                y += path_textbox->get_h() + 10;
        }
        else
@@ -212,10 +211,10 @@ void FormatTools::create_objects(int &init_x,
        window->add_subwindow(format_button = new FormatFormat(x, y, this));
        format_button->create_objects();
        x += format_button->get_w() + 5;
-       window->add_subwindow(ffmpeg_type = new FFMpegType(x, y, 50, 1, asset->fformat));
+       window->add_subwindow(ffmpeg_type = new FFMpegType(x, y+5, 50, 1, asset->fformat));
        FFMPEG::set_asset_format(asset, asset->fformat);
        x += ffmpeg_type->get_w();
-       window->add_subwindow(format_ffmpeg = new FormatFFMPEG(x, y, this));
+       window->add_subwindow(format_ffmpeg = new FormatFFMPEG(x, y+5, this));
        format_ffmpeg->create_objects();
        x = init_x;
        y += format_button->get_h() + 10;
@@ -507,7 +506,8 @@ void FormatTools::close_format_windows()
 
 int FormatTools::get_w()
 {
-       return w;
+       return asset->format != FILE_FFMPEG ? w :
+               format_ffmpeg->get_x() + format_ffmpeg->get_w();
 }
 
 void FormatTools::set_w(int w)
@@ -522,11 +522,13 @@ void FormatTools::reposition_window(int &init_x, int &init_y)
 
        if(path_textbox)
        {
-               path_textbox->reposition_window(x, y);
-               x += path_textbox->get_w() + 5;
-               path_button->reposition_window(x, y);
-               x -= path_textbox->get_w() + 5;
-               y += 35;
+               int px = x;
+               path_textbox->reposition_window(px, y);
+               px += path_textbox->get_w() + 5;
+               path_recent->reposition_window(px, y);
+               px += path_recent->get_w() + 8;
+               path_button->reposition_window(px, y);
+               y += path_textbox->get_h() + 10;
        }
 
        format_title->reposition_window(x, y);
@@ -547,7 +549,7 @@ void FormatTools::reposition_window(int &init_x, int &init_y)
                if(prompt_audio) audio_switch->reposition_window(x, y);
 
                x = init_x;
-               y += aparams_button->get_h() + 20;
+               y += aparams_button->get_h() + 10;
                if(prompt_audio_channels)
                {
                        channels_title->reposition_window(x, y);
index c80a8e916ee99abc3eb7e6bdadb2f61dd3af88a2..a9944e953779901412ca1cc939980b1408052077 100644 (file)
@@ -160,7 +160,6 @@ void InterfacePrefs::create_objects()
                MEDIUMFONT, 
                resources->text_default));
        sprintf(string, "%jd", pwindow->thread->preferences->index_size);
-       x1 = x + 230;
        add_subwindow(isize = new IndexSize(x + 230, y, pwindow, string));
        add_subwindow(new ScanCommercials(pwindow, 350,y));
        y += 30;
@@ -179,11 +178,16 @@ void InterfacePrefs::create_objects()
 
        add_subwindow(new BC_Title(x, y, _("Editing"), LARGEFONT, resources->text_default));
 
+       int y1 = y + 5;
        y += 35;
-
-       add_subwindow(thumbnails = new ViewThumbnails(x, y, pwindow));
+       add_subwindow(title = new BC_Title(x, y, _("Keyframe reticle:")));
+       x1 = x + title->get_w() + 10;
+       keyframe_reticle = new KeyframeReticle(x1, y, &pwindow->thread->preferences->keyframe_reticle);
+       add_subwindow(keyframe_reticle);
+       keyframe_reticle->create_objects();
 
        int x2 = x + 400, y2 = y;
+       add_subwindow(thumbnails = new ViewThumbnails(x2, y1, pwindow));
        AndroidRemote *android_remote = new AndroidRemote(pwindow, x2, y2);
        add_subwindow(android_remote);
        y2 += android_remote->get_h() + 10;
@@ -795,3 +799,50 @@ int StillImageDuration::handle_event()
        return 1;
 }
 
+
+HairlineItem::HairlineItem(KeyframeReticle *popup, int hairline)
+ : BC_MenuItem(popup->hairline_to_string(hairline))
+{
+       this->popup = popup;
+       this->hairline = hairline;
+}
+
+HairlineItem::~HairlineItem()
+{
+}
+
+int HairlineItem::handle_event()
+{
+       popup->set_text(get_text());
+       *(popup->output) = hairline;
+       return 1;
+}
+
+
+KeyframeReticle::KeyframeReticle(int x, int y, int *output)
+ : BC_PopupMenu(x, y, 175, hairline_to_string(*output))
+{
+       this->output = output;
+}
+
+KeyframeReticle::~KeyframeReticle()
+{
+}
+
+const char *KeyframeReticle::hairline_to_string(int type)
+{
+       switch( type ) {
+       case HAIRLINE_NEVER:    return _("Never");
+       case HAIRLINE_DRAGGING: return _("Dragging");
+       case HAIRLINE_ALWAYS:   return _("Always");
+       }
+       return _("Unknown");
+}
+
+void KeyframeReticle::create_objects()
+{
+       add_item(new HairlineItem(this, HAIRLINE_NEVER));
+       add_item(new HairlineItem(this, HAIRLINE_DRAGGING));
+       add_item(new HairlineItem(this, HAIRLINE_ALWAYS));
+}
+
index 062e533d58207bac4c29475cf51358b4b42126d9..51028d1a97e8f6e1b36557da57d5f309db5814f3 100644 (file)
@@ -43,6 +43,7 @@ class ViewThemeItem;
 class UseTipWindow;
 class StillImageUseDuration;
 class StillImageDuration;
+class KeyframeReticle;
 
 #include "browsebutton.h"
 #include "deleteallindexes.inc"
@@ -84,6 +85,7 @@ public:
        ViewBehaviourText *button1, *button2, *button3;
        ViewThumbnails *thumbnails;
        ShBtnEditDialog *shbtn_dialog;
+       KeyframeReticle *keyframe_reticle;
 };
 
 
@@ -349,5 +351,26 @@ public:
        PreferencesWindow *pwindow;
 };
 
+class KeyframeReticle : public BC_PopupMenu
+{
+public:
+       KeyframeReticle(int x, int y, int *output);
+       ~KeyframeReticle();
+
+       const char* hairline_to_string(int type);
+       void create_objects();
+       int *output;
+};
+
+class HairlineItem : public BC_MenuItem
+{
+public:
+       HairlineItem(KeyframeReticle *popup, int hairline);
+       ~HairlineItem();
+
+       KeyframeReticle *popup;
+       int handle_event();
+       int hairline;
+};
 
 #endif
index 737c54bd90ee2b3f746b9c30b40eb81938e450c8..fcb79890e6890cd727aa21f2173c082c6a76ac9d 100644 (file)
@@ -830,7 +830,7 @@ int PasteDefaultKeyframe::handle_event()
 }
 
 ClearDefaultKeyframe::ClearDefaultKeyframe(MWindow *mwindow)
- : BC_MenuItem(_("Clear default keyframe"), _("Alt-Del"), BACKSPACE)
+ : BC_MenuItem(_("Clear default keyframe"), _("Alt-Del"), DELETE)
 {
        set_alt();
        this->mwindow = mwindow;
@@ -879,7 +879,7 @@ int Paste::handle_event()
 }
 
 Clear::Clear(MWindow *mwindow)
- : BC_MenuItem(_("Clear"), _("Del"), BACKSPACE)
+ : BC_MenuItem(_("Clear"), _("Del"), DELETE)
 {
        this->mwindow = mwindow;
 }
index 59e2bff24cd4ba5b21e529573f5cbd72b55db127..61256910e0f3772246184802984450b506c803fe 100644 (file)
@@ -315,8 +315,8 @@ void MainSession::default_window_positions(int window_config)
        swindow_w = 600;
        swindow_h = 400;
 
-       batchrender_w = 540;
-       batchrender_h = 340;
+       batchrender_w = 750;
+       batchrender_h = 400;
        batchrender_x = root_w / 2 - batchrender_w / 2;
        batchrender_y = root_h / 2 - batchrender_h / 2;
 }
index 9a77005bd0001615caa91a7caab3dc24d4dbc026..b9615c1f7073f76de53edd2d48cd033a4be7f169 100644 (file)
@@ -1661,9 +1661,9 @@ if(debug) printf("MWindow::load_filenames %d\n", __LINE__);
        }
 
        // if just opening one new resource in replace mode
-       if( load_mode == LOADMODE_REPLACE && new_edls.size() == 1 &&
-               ftype != FILE_IS_XML )
-       {
+       if( ftype != FILE_IS_XML &&
+           ( load_mode == LOADMODE_REPLACE ||
+             load_mode == LOADMODE_REPLACE_CONCATENATE ) ) {
                select_asset(0, 0);
                edl->local_session->preview_start = 0;
                edl->local_session->preview_end = edl->tracks->total_playable_length();
index d3f890b7bd03bab28c9f9061ef8602fab6ffb6a6..2ad6a095a2930b88e446f7c1bead9de4bbde87b6 100644 (file)
 // Index of vwindow that always exists
 #define DEFAULT_VWINDOW 0
 
+// keyframe reticle
+#define HAIRLINE_NEVER 0
+#define HAIRLINE_DRAGGING 1
+#define HAIRLINE_ALWAYS 2
+
 class MWindow;
 
 #if 0
index 63511e6d047df9f2cad5b9bfc19e6bdd4af44135..76efb7efeb81e0897ec85a0ec8503bfcd1ea33a9 100644 (file)
@@ -1018,7 +1018,7 @@ int MWindowGUI::drag_stop()
                if(pane[i]) result |= pane[i]->canvas->drag_stop(
                        &redraw);
        }
-
+       mwindow->edl->optimize();
 
 // since we don't have subwindows we have to terminate any drag operation
        if(result)
index a3f3b391f3062f05fe988b9ec14c0943d9b38680..89bf4424cbf11e4d3385a18bace9c77a2337ff2b 100644 (file)
@@ -65,6 +65,7 @@ Preferences::Preferences()
        index_size = 0x400000;
        index_count = 500;
        use_thumbnails = 1;
+       keyframe_reticle = HAIRLINE_DRAGGING;
        trap_sigsegv = 1;
        trap_sigintr = 1;
        theme[0] = 0;
@@ -165,6 +166,7 @@ void Preferences::copy_from(Preferences *that)
        index_size = that->index_size;
        index_count = that->index_count;
        use_thumbnails = that->use_thumbnails;
+       keyframe_reticle = that->keyframe_reticle;
        strcpy(theme, that->theme);
 
        use_tipwindow = that->use_tipwindow;
@@ -294,6 +296,7 @@ int Preferences::load_defaults(BC_Hash *defaults)
        index_size = defaults->get("INDEX_SIZE", index_size);
        index_count = defaults->get("INDEX_COUNT", index_count);
        use_thumbnails = defaults->get("USE_THUMBNAILS", use_thumbnails);
+       keyframe_reticle = defaults->get("KEYFRAME_RETICLE", keyframe_reticle);
        trap_sigsegv = defaults->get("TRAP_SIGSEGV", trap_sigsegv);
        trap_sigintr = defaults->get("TRAP_SIGINTR", trap_sigintr);
 
@@ -409,6 +412,7 @@ int Preferences::save_defaults(BC_Hash *defaults)
        defaults->update("INDEX_SIZE", index_size);
        defaults->update("INDEX_COUNT", index_count);
        defaults->update("USE_THUMBNAILS", use_thumbnails);
+       defaults->update("KEYFRAME_RETICLE", keyframe_reticle);
        defaults->update("TRAP_SIGSEGV", trap_sigsegv);
        defaults->update("TRAP_SIGINTR", trap_sigintr);
 //     defaults->update("GLOBAL_PLUGIN_DIR", global_plugin_dir);
index d18c7c69d8ea91f3edcb0be7af240ee9f7dd8bf9..7cc90b5a46289e255face8e24a361cdb80c9c692 100644 (file)
@@ -85,6 +85,7 @@ public:
        int index_count;
 // Use thumbnails in AWindow assets.
        int use_thumbnails;
+       int keyframe_reticle;
        int trap_sigsegv;
        int trap_sigintr;
 // Title of theme
index 6d0fee37cbd5d08f7668cf48904d560dc8e2fed8..e9511d2ded9d2ce2bd8db076495483394eb0a384 100644 (file)
@@ -204,14 +204,24 @@ int TrackCanvas::drag_motion(Track **over_track,
                                        int64_t edit_x, edit_y, edit_w, edit_h;
                                        edit_dimensions(edit, edit_x, edit_y, edit_w, edit_h);
 
-                                       if(cursor_x >= edit_x &&
-                                               cursor_y >= edit_y &&
-                                               cursor_x < edit_x + edit_w &&
-                                               cursor_y < edit_y + edit_h)
-                                       {
+                                       if( cursor_x >= edit_x && cursor_x < edit_x + edit_w &&
+                                           cursor_y >= edit_y && cursor_y < edit_y + edit_h ) {
                                                *over_edit = edit;
                                                break;
                                        }
+                                       if( edit != track->edits->last ) continue;
+                                       if( edit->silence() ) continue;
+                                       if( mwindow->session->current_operation != DRAG_ATRANSITION &&
+                                           mwindow->session->current_operation != DRAG_VTRANSITION ) continue;
+                                       if( cursor_x >= edit_x + edit_w &&
+                                           cursor_y >= edit_y && cursor_y < edit_y + edit_h ) {
+                                               // add silence to allow drag transition past last edit
+                                               //  will be deleted by Edits::optimize if not used
+                                               double length = mwindow->edl->session->default_transition_length;
+                                               int64_t start = edit->startproject+edit->length;
+                                               int64_t units = track->to_units(length, 1); 
+                                               track->edits->create_silence(start, start+units);
+                                       }
                                }
 
                                for(int i = 0; i < track->plugin_set.total; i++)
@@ -2091,6 +2101,45 @@ int TrackCanvas::do_keyframes(int cursor_x,
        return result;
 }
 
+void TrackCanvas::draw_keyframe_reticle()
+{
+       int keyframe_hairline = mwindow->preferences->keyframe_reticle;
+       if( keyframe_hairline == HAIRLINE_NEVER ) return;
+
+       int current_op = mwindow->session->current_operation, dragging = 0;
+       for( int i=0; !dragging && i<AUTOMATION_TOTAL; ++i )
+               if( current_op == auto_operations[i] ) dragging = 1;
+
+       if( keyframe_hairline == HAIRLINE_DRAGGING && dragging ) {
+               if( mwindow->session->drag_auto && get_buttonpress() == 1 ) {
+                       draw_hairline(mwindow->session->drag_auto, RED);
+                       return;
+               }
+       }
+
+       if( keyframe_hairline == HAIRLINE_ALWAYS || ( get_buttonpress() == 2 &&
+           keyframe_hairline == HAIRLINE_DRAGGING && dragging ) ) {
+               for( Track *track = mwindow->edl->tracks->first; track;
+                    track=track->next ) {
+                       Automation *automation = track->automation;
+                       for( int i=0; i<AUTOMATION_TOTAL; ++i ) {
+                               if( !mwindow->edl->session->auto_conf->autos[i] ) continue;
+                               // automation visible
+                               Autos *autos = automation->autos[i];
+                               if( !autos ) continue;
+                               for( Auto *auto_keyframe=autos->first; auto_keyframe;
+                                    auto_keyframe = auto_keyframe->next ) {
+                                       draw_hairline(auto_keyframe, GREEN);
+                               }
+                       }
+
+                       if( dragging && mwindow->session->drag_auto ) {
+                               draw_hairline(mwindow->session->drag_auto, RED);
+                       }
+               }
+       }
+}
+
 void TrackCanvas::draw_auto(Auto *current,
        int x,
        int y,
@@ -3328,6 +3377,28 @@ int TrackCanvas::do_plugin_autos(Track *track, int cursor_x, int cursor_y,
        return result;
 }
 
+int TrackCanvas::draw_hairline(Auto *auto_keyframe, int color)
+{
+       Track *track = auto_keyframe->autos->track;
+       int autogrouptype = auto_keyframe->autos->get_type();
+
+       int center_pixel;
+       double view_start, unit_start;
+       double view_end, unit_end, yscale;
+       double zoom_sample, zoom_units;
+
+       calculate_viewport(track, view_start, unit_start, view_end, unit_end,
+                       yscale, center_pixel, zoom_sample, zoom_units);
+
+       double ax = 0, ay = 0;
+       calculate_auto_position(&ax, &ay, 0, 0, 0, 0,
+               auto_keyframe, unit_start, zoom_units, yscale, autogrouptype);
+
+       set_color(color);
+       draw_line(ax, 0, ax, get_h());
+       return 0;
+}
+
 void TrackCanvas::draw_overlays()
 {
        int new_cursor, update_cursor, rerender;
@@ -3369,6 +3440,8 @@ void TrackCanvas::draw_overlays()
 // Playback cursor
        draw_playback_cursor();
 
+       draw_keyframe_reticle();
+
        show_window(0);
 }
 
index 396a7ff352047a220234faffc02dcf12a0770ed7..69318d67e58db9d05dca00d7588979252f66b26f 100644 (file)
@@ -76,6 +76,9 @@ public:
        void draw_highlight_insertion(int x, int y, int w, int h);
        void draw_playback_cursor();
        void draw_highlighting();
+       void draw_keyframe_reticle();
+       int draw_hairline(Auto *auto_keyframe, int color);
+
 // User can either call draw or draw_overlays to copy a fresh
 // canvas and just draw the overlays over it
        void draw_overlays();
index 1213f5545ebf9c02850a529695e5e2d9e56228d7..c6b6e99f85c4bcf8890559aca48b7baa325b8e04 100644 (file)
@@ -328,8 +328,8 @@ int VDeviceBUZ::close_all()
        return 0;
 }
 
-#define COMPOSITE_TEXT "Composite"
-#define SVIDEO_TEXT "S-Video"
+#define COMPOSITE_TEXT _("Composite")
+#define SVIDEO_TEXT _("S-Video")
 #define BUZ_COMPOSITE 0
 #define BUZ_SVIDEO 1
 
index 8bc65010bfea34df13b0d4adb0d58c641baa0376..eb1fb5154d120c5bce42d8a727cd19760c0abc99 100644 (file)
@@ -55,10 +55,7 @@ CFLAGS += -DHAVE_XFT
 endif
 
 ifeq ($(HAVE_ESOUND), y)
-ESOUND_DIR := $(THIRDPARTY)/esound
-AUDIOFILE_DIR := $(THIRDPARTY)/audiofile
-ESOUNDCFLAGS = -DHAVE_ESOUND -I$(ESOUND_DIR) -I$(AUDIOFILE_DIR)
-ESOUNDLIBS = $(ESOUND_DIR)/$(OBJDIR)/libesound.a
+CFLAGS += -DHAVE_ESOUND
 endif
 
 #CFLAGS += -g
index 85da65b6a4e1b40581fad12afbeb0bb1d4d362ae..f24f37742d960c4c4c23b9cfbd404f06bae6af9b 100755 (executable)
@@ -57,7 +57,7 @@ add_library() {
 inc_a52dec="include"
 add_library a52dec \
        liba52/.libs/liba52.a
-inc_audiofile="."
+inc_audiofile="libaudiofile"
 add_library audiofile \
        libaudiofile/.libs/libaudiofile.a \
        libaudiofile/modules/.libs/libmodules.a \