From 8b0d4fea3dbf5321d0688eb75f25be77f751d003 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Sat, 15 Jul 2017 18:22:16 -0600 Subject: [PATCH] ffmpeg tip fix, status tweaks, clip popup tweaks --- cinelerra-5.1/cinelerra/assetpopup.C | 3 +- cinelerra-5.1/cinelerra/awindowgui.C | 10 ++++-- cinelerra-5.1/cinelerra/clippopup.C | 34 ++++----------------- cinelerra-5.1/cinelerra/clippopup.h | 17 ++--------- cinelerra-5.1/cinelerra/mwindow.C | 25 ++++++--------- cinelerra-5.1/cinelerra/mwindowgui.C | 10 ++---- cinelerra-5.1/cinelerra/preferences.inc | 2 ++ cinelerra-5.1/cinelerra/preferencesthread.C | 2 +- 8 files changed, 33 insertions(+), 70 deletions(-) diff --git a/cinelerra-5.1/cinelerra/assetpopup.C b/cinelerra-5.1/cinelerra/assetpopup.C index 14a538bb..5738db41 100644 --- a/cinelerra-5.1/cinelerra/assetpopup.C +++ b/cinelerra-5.1/cinelerra/assetpopup.C @@ -328,8 +328,7 @@ AssetPopupProjectRemove::~AssetPopupProjectRemove() int AssetPopupProjectRemove::handle_event() { - mwindow->remove_assets_from_project(1, - 1, + mwindow->remove_assets_from_project(1, 1, mwindow->session->drag_assets, mwindow->session->drag_clips); return 1; diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index 049be4e8..9a39a6fb 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -279,7 +279,11 @@ void AssetPicon::create_objects() asset->width, asset->height, BC_RGB888, -1); } - + { char string[BCTEXTLEN]; + sprintf(string, _("Reading %s"), name); + mwindow->gui->lock_window("AssetPicon::create_objects"); + mwindow->gui->show_message(string); + mwindow->gui->unlock_window(); } file->read_frame(gui->temp_picon); if( debug ) printf("AssetPicon::create_objects %d\n", __LINE__); mwindow->video_cache->check_in(asset); @@ -1068,7 +1072,9 @@ void AWindowGUI::update_asset_list() } } - + mwindow->gui->lock_window("AWindowGUI::update_asset_list"); + mwindow->gui->default_message(); + mwindow->gui->unlock_window(); //printf("AWindowGUI::update_asset_list %d\n", __LINE__); diff --git a/cinelerra-5.1/cinelerra/clippopup.C b/cinelerra-5.1/cinelerra/clippopup.C index e3cc1a53..b8a235a5 100644 --- a/cinelerra-5.1/cinelerra/clippopup.C +++ b/cinelerra-5.1/cinelerra/clippopup.C @@ -69,10 +69,7 @@ void ClipPopup::create_objects() submenu->add_submenuitem(new ClipMatchSize(mwindow, this)); submenu->add_submenuitem(new ClipMatchRate(mwindow, this)); submenu->add_submenuitem(new ClipMatchAll(mwindow, this)); - add_item(menu_item = new BC_MenuItem(_("Remove..."))); - menu_item->add_submenu(submenu = new BC_SubMenu()); - submenu->add_submenuitem(new ClipPopupProjectRemove(mwindow, this)); - submenu->add_submenuitem(new ClipPopupDiskRemove(mwindow, this)); + add_item(new ClipPopupDelete(mwindow, this)); } void ClipPopup::paste_assets() @@ -325,46 +322,27 @@ int ClipMatchAll::handle_event() } -ClipPopupProjectRemove::ClipPopupProjectRemove(MWindow *mwindow, ClipPopup *popup) - : BC_MenuItem(_("Remove from project")) +ClipPopupDelete::ClipPopupDelete(MWindow *mwindow, ClipPopup *popup) + : BC_MenuItem(_("Delete")) { this->mwindow = mwindow; this->popup = popup; } -ClipPopupProjectRemove::~ClipPopupProjectRemove() +ClipPopupDelete::~ClipPopupDelete() { } -int ClipPopupProjectRemove::handle_event() +int ClipPopupDelete::handle_event() { - mwindow->remove_assets_from_project(1, - 1, + mwindow->remove_assets_from_project(1, 1, mwindow->session->drag_assets, mwindow->session->drag_clips); return 1; } -ClipPopupDiskRemove::ClipPopupDiskRemove(MWindow *mwindow, ClipPopup *popup) - : BC_MenuItem(_("Remove from disk")) -{ - this->mwindow = mwindow; - this->popup = popup; -} - -ClipPopupDiskRemove::~ClipPopupDiskRemove() -{ -} - -int ClipPopupDiskRemove::handle_event() -{ - mwindow->awindow->asset_remove->start(); - return 1; -} - - ClipPasteToFolder::ClipPasteToFolder(MWindow *mwindow) : BC_MenuItem(_("Paste Clip")) { diff --git a/cinelerra-5.1/cinelerra/clippopup.h b/cinelerra-5.1/cinelerra/clippopup.h index de6d7f67..c641ce0f 100644 --- a/cinelerra-5.1/cinelerra/clippopup.h +++ b/cinelerra-5.1/cinelerra/clippopup.h @@ -163,11 +163,11 @@ public: ClipPopup *popup; }; -class ClipPopupProjectRemove : public BC_MenuItem +class ClipPopupDelete : public BC_MenuItem { public: - ClipPopupProjectRemove(MWindow *mwindow, ClipPopup *popup); - ~ClipPopupProjectRemove(); + ClipPopupDelete(MWindow *mwindow, ClipPopup *popup); + ~ClipPopupDelete(); int handle_event(); @@ -175,17 +175,6 @@ public: ClipPopup *popup; }; -class ClipPopupDiskRemove : public BC_MenuItem -{ -public: - ClipPopupDiskRemove(MWindow *mwindow, ClipPopup *popup); - ~ClipPopupDiskRemove(); - - int handle_event(); - - MWindow *mwindow; - ClipPopup *popup; -}; class ClipPasteToFolder : public BC_MenuItem { diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 8fc55bca..de0f2ea5 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -3135,8 +3135,8 @@ void MWindow::remove_asset_from_caches(Asset *asset) void MWindow::remove_assets_from_project(int push_undo, int redraw, ArrayList *drag_assets, ArrayList *drag_clips) { - for(int i = 0; i < session->drag_assets->total; i++) { - Indexable *indexable = session->drag_assets->get(i); + for(int i = 0; i < drag_assets->total; i++) { + Indexable *indexable = drag_assets->get(i); if(indexable->is_asset) remove_asset_from_caches((Asset*)indexable); } @@ -3153,11 +3153,11 @@ void MWindow::remove_assets_from_project(int push_undo, int redraw, } } - for(int i = 0; i < session->drag_assets->size(); i++) { + for(int i = 0; i < drag_assets->size(); i++) { for(int j = 0; j < vwindows.size(); j++) { VWindow *vwindow = vwindows[j]; if( !vwindow->is_running() ) continue; - if(session->drag_assets->get(i) == vwindow->get_source()) { + if(drag_assets->get(i) == vwindow->get_source()) { vwindow->gui->lock_window("MWindow::remove_assets_from_project 2"); vwindow->delete_source(1, 1); vwindow->gui->unlock_window(); @@ -3165,29 +3165,22 @@ void MWindow::remove_assets_from_project(int push_undo, int redraw, } } - for(int i = 0; i < session->drag_assets->size(); i++) { - Indexable *indexable = session->drag_assets->get(i); + for(int i = 0; i < drag_assets->size(); i++) { + Indexable *indexable = drag_assets->get(i); remove_indexfile(indexable); } //printf("MWindow::rebuild_indices 1 %s\n", indexable->path); if(push_undo) undo->update_undo_before(); if(drag_assets) edl->remove_from_project(drag_assets); - if(drag_clips) edl->remove_from_project(session->drag_clips); + if(drag_clips) edl->remove_from_project(drag_clips); if(redraw) save_backup(); if(push_undo) undo->update_undo_after(_("remove assets"), LOAD_ALL); - if(redraw) - { + if(redraw) { restart_brender(); gui->lock_window("MWindow::remove_assets_from_project 3"); - gui->update(1, - 1, - 1, - 1, - 0, - 1, - 0); + gui->update(1, 1, 1, 1, 0, 1, 0); gui->unlock_window(); // Removes from playback here diff --git a/cinelerra-5.1/cinelerra/mwindowgui.C b/cinelerra-5.1/cinelerra/mwindowgui.C index 3c0213af..c21f8347 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.C +++ b/cinelerra-5.1/cinelerra/mwindowgui.C @@ -2283,9 +2283,7 @@ FFMpegToggle::FFMpegToggle(MWindow *mwindow, MButtons *mbuttons, int x, int y) { this->mwindow = mwindow; this->mbuttons = mbuttons; - set_tooltip(!get_value() ? - _("Currently: Try FFMpeg last\n Click to: Try FFMpeg first") : - _("Currently: Try FFMpeg first\n Click to: Try FFMpeg last")); + set_tooltip(get_value() ? FFMPEG_EARLY_TIP : FFMPEG_LATE_TIP); } FFMpegToggle::~FFMpegToggle() @@ -2295,12 +2293,10 @@ FFMpegToggle::~FFMpegToggle() int FFMpegToggle::handle_event() { int ffmpeg_early_probe = get_value(); - set_tooltip(!ffmpeg_early_probe ? - _("Currently: Try FFMpeg last\n Click to: Try FFMpeg first") : - _("Currently: Try FFMpeg first\n Click to: Try FFMpeg last")); + set_tooltip(ffmpeg_early_probe ? FFMPEG_EARLY_TIP : FFMPEG_LATE_TIP); mwindow->preferences->set_file_probe_armed("FFMPEG_Early", ffmpeg_early_probe); mwindow->preferences->set_file_probe_armed("FFMPEG_Late", !ffmpeg_early_probe); - + mwindow->show_warning(&mwindow->preferences->warn_indexes, _("Changing the base codecs may require rebuilding indexes.")); return 1; diff --git a/cinelerra-5.1/cinelerra/preferences.inc b/cinelerra-5.1/cinelerra/preferences.inc index 4afbc94b..d05d201e 100644 --- a/cinelerra-5.1/cinelerra/preferences.inc +++ b/cinelerra-5.1/cinelerra/preferences.inc @@ -25,6 +25,8 @@ // Run-time configuration directory #define DEAMON_PORT 400 #define BACKUP_FILE "backup.xml" +#define FFMPEG_EARLY_TIP _("Currently: Try FFMpeg first\n Click to: Try FFMpeg last") +#define FFMPEG_LATE_TIP _("Currently: Try FFMpeg last\n Click to: Try FFMpeg first") class Preferences; class PlaybackConfig; diff --git a/cinelerra-5.1/cinelerra/preferencesthread.C b/cinelerra-5.1/cinelerra/preferencesthread.C index 9393d435..1de73c3b 100644 --- a/cinelerra-5.1/cinelerra/preferencesthread.C +++ b/cinelerra-5.1/cinelerra/preferencesthread.C @@ -232,7 +232,7 @@ int PreferencesThread::apply_settings() int ffmpeg_early_probe = mwindow->preferences->get_file_probe_armed("FFPMEG_Early"); mwindow->gui->ffmpeg_toggle->update(ffmpeg_early_probe); mwindow->gui->ffmpeg_toggle->set_tooltip(ffmpeg_early_probe ? - _("Try FFMpeg first") : _("Try FFMpeg last") ); + FFMPEG_EARLY_TIP : FFMPEG_LATE_TIP); mwindow->gui->mainshbtns->load(mwindow->preferences); double tc_position = mwindow->edl->session->get_frame_offset() / mwindow->edl->session->frame_rate; -- 2.26.2