From 6616b3b82fdbc586f5da00bf772e45d8ada3b464 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Thu, 21 Apr 2016 19:26:04 -0600 Subject: [PATCH] added keyframe reticle, fixes: DEL, transition at endtrk, DVD/BD render menu --- cinelerra-5.1/cinelerra/batchrender.C | 228 +++++++++-------------- cinelerra-5.1/cinelerra/batchrender.h | 2 +- cinelerra-5.1/cinelerra/bdcreate.C | 22 ++- cinelerra-5.1/cinelerra/dvdcreate.C | 22 ++- cinelerra-5.1/cinelerra/edits.C | 2 +- cinelerra-5.1/cinelerra/formattools.C | 34 ++-- cinelerra-5.1/cinelerra/interfaceprefs.C | 57 +++++- cinelerra-5.1/cinelerra/interfaceprefs.h | 23 +++ cinelerra-5.1/cinelerra/mainmenu.C | 4 +- cinelerra-5.1/cinelerra/mainsession.C | 4 +- cinelerra-5.1/cinelerra/mwindow.C | 6 +- cinelerra-5.1/cinelerra/mwindow.inc | 5 + cinelerra-5.1/cinelerra/mwindowgui.C | 2 +- cinelerra-5.1/cinelerra/preferences.C | 4 + cinelerra-5.1/cinelerra/preferences.h | 1 + cinelerra-5.1/cinelerra/trackcanvas.C | 83 ++++++++- cinelerra-5.1/cinelerra/trackcanvas.h | 3 + cinelerra-5.1/cinelerra/vdevicebuz.C | 4 +- cinelerra-5.1/global_config | 5 +- cinelerra-5.1/thirdparty/configure | 2 +- 20 files changed, 311 insertions(+), 202 deletions(-) diff --git a/cinelerra-5.1/cinelerra/batchrender.C b/cinelerra-5.1/cinelerra/batchrender.C index d2a7341f..20e27d59 100644 --- a/cinelerra-5.1/cinelerra/batchrender.C +++ b/cinelerra-5.1/cinelerra/batchrender.C @@ -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; } diff --git a/cinelerra-5.1/cinelerra/batchrender.h b/cinelerra-5.1/cinelerra/batchrender.h index 8e29b035..d848d989 100644 --- a/cinelerra-5.1/cinelerra/batchrender.h +++ b/cinelerra-5.1/cinelerra/batchrender.h @@ -92,7 +92,7 @@ public: int test_edl_files(); void calculate_dest_paths(ArrayList *paths, Preferences *preferences); - + void reset(); // Load batch rendering jobs void load_jobs(char *path, Preferences *preferences); // Not applicable to western civilizations diff --git a/cinelerra-5.1/cinelerra/bdcreate.C b/cinelerra-5.1/cinelerra/bdcreate.C index d1eb5741..f7453803 100644 --- a/cinelerra-5.1/cinelerra/bdcreate.C +++ b/cinelerra-5.1/cinelerra/bdcreate.C @@ -250,9 +250,10 @@ void CreateBD_Thread::handle_close_event(int result) insert_video_plugin("Inverse Telecine", &keyframe); } if( use_scale ) { - sprintf(data,"", BD_WIDTH, BD_HEIGHT); + sprintf(data,"", 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; } } diff --git a/cinelerra-5.1/cinelerra/dvdcreate.C b/cinelerra-5.1/cinelerra/dvdcreate.C index c560f208..05dde68b 100644 --- a/cinelerra-5.1/cinelerra/dvdcreate.C +++ b/cinelerra-5.1/cinelerra/dvdcreate.C @@ -324,9 +324,10 @@ void CreateDVD_Thread::handle_close_event(int result) insert_video_plugin("Inverse Telecine", &keyframe); } if( use_scale ) { - sprintf(data,"", DVD_WIDTH, DVD_HEIGHT); + sprintf(data,"", 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; } } diff --git a/cinelerra-5.1/cinelerra/edits.C b/cinelerra-5.1/cinelerra/edits.C index 7d152bc5..1face800 100644 --- a/cinelerra-5.1/cinelerra/edits.C +++ b/cinelerra-5.1/cinelerra/edits.C @@ -408,7 +408,7 @@ int Edits::optimize() current = current->next; } - if(last && last->silence()) { + if(last && last->silence() && !last->transition ) { delete last; result = 1; } diff --git a/cinelerra-5.1/cinelerra/formattools.C b/cinelerra-5.1/cinelerra/formattools.C index 28f4b556..ad6df95b 100644 --- a/cinelerra-5.1/cinelerra/formattools.C +++ b/cinelerra-5.1/cinelerra/formattools.C @@ -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); diff --git a/cinelerra-5.1/cinelerra/interfaceprefs.C b/cinelerra-5.1/cinelerra/interfaceprefs.C index c80a8e91..a9944e95 100644 --- a/cinelerra-5.1/cinelerra/interfaceprefs.C +++ b/cinelerra-5.1/cinelerra/interfaceprefs.C @@ -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)); +} + diff --git a/cinelerra-5.1/cinelerra/interfaceprefs.h b/cinelerra-5.1/cinelerra/interfaceprefs.h index 062e533d..51028d1a 100644 --- a/cinelerra-5.1/cinelerra/interfaceprefs.h +++ b/cinelerra-5.1/cinelerra/interfaceprefs.h @@ -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 diff --git a/cinelerra-5.1/cinelerra/mainmenu.C b/cinelerra-5.1/cinelerra/mainmenu.C index 737c54bd..fcb79890 100644 --- a/cinelerra-5.1/cinelerra/mainmenu.C +++ b/cinelerra-5.1/cinelerra/mainmenu.C @@ -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; } diff --git a/cinelerra-5.1/cinelerra/mainsession.C b/cinelerra-5.1/cinelerra/mainsession.C index 59e2bff2..61256910 100644 --- a/cinelerra-5.1/cinelerra/mainsession.C +++ b/cinelerra-5.1/cinelerra/mainsession.C @@ -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; } diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 9a77005b..b9615c1f 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -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(); diff --git a/cinelerra-5.1/cinelerra/mwindow.inc b/cinelerra-5.1/cinelerra/mwindow.inc index d3f890b7..2ad6a095 100644 --- a/cinelerra-5.1/cinelerra/mwindow.inc +++ b/cinelerra-5.1/cinelerra/mwindow.inc @@ -44,6 +44,11 @@ // 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 diff --git a/cinelerra-5.1/cinelerra/mwindowgui.C b/cinelerra-5.1/cinelerra/mwindowgui.C index 63511e6d..76efb7ef 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.C +++ b/cinelerra-5.1/cinelerra/mwindowgui.C @@ -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) diff --git a/cinelerra-5.1/cinelerra/preferences.C b/cinelerra-5.1/cinelerra/preferences.C index a3f3b391..89bf4424 100644 --- a/cinelerra-5.1/cinelerra/preferences.C +++ b/cinelerra-5.1/cinelerra/preferences.C @@ -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); diff --git a/cinelerra-5.1/cinelerra/preferences.h b/cinelerra-5.1/cinelerra/preferences.h index d18c7c69..7cc90b5a 100644 --- a/cinelerra-5.1/cinelerra/preferences.h +++ b/cinelerra-5.1/cinelerra/preferences.h @@ -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 diff --git a/cinelerra-5.1/cinelerra/trackcanvas.C b/cinelerra-5.1/cinelerra/trackcanvas.C index 6d0fee37..e9511d2d 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.C +++ b/cinelerra-5.1/cinelerra/trackcanvas.C @@ -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 && isession->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; iedl->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); } diff --git a/cinelerra-5.1/cinelerra/trackcanvas.h b/cinelerra-5.1/cinelerra/trackcanvas.h index 396a7ff3..69318d67 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.h +++ b/cinelerra-5.1/cinelerra/trackcanvas.h @@ -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(); diff --git a/cinelerra-5.1/cinelerra/vdevicebuz.C b/cinelerra-5.1/cinelerra/vdevicebuz.C index 1213f554..c6b6e99f 100644 --- a/cinelerra-5.1/cinelerra/vdevicebuz.C +++ b/cinelerra-5.1/cinelerra/vdevicebuz.C @@ -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 diff --git a/cinelerra-5.1/global_config b/cinelerra-5.1/global_config index 8bc65010..eb1fb515 100644 --- a/cinelerra-5.1/global_config +++ b/cinelerra-5.1/global_config @@ -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 diff --git a/cinelerra-5.1/thirdparty/configure b/cinelerra-5.1/thirdparty/configure index 85da65b6..f24f3774 100755 --- a/cinelerra-5.1/thirdparty/configure +++ b/cinelerra-5.1/thirdparty/configure @@ -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 \ -- 2.26.2