ffmpeg tip fix, status tweaks, clip popup tweaks
authorGood Guy <good1.2guy@gmail.com>
Sun, 16 Jul 2017 00:22:16 +0000 (18:22 -0600)
committerGood Guy <good1.2guy@gmail.com>
Sun, 16 Jul 2017 00:22:16 +0000 (18:22 -0600)
cinelerra-5.1/cinelerra/assetpopup.C
cinelerra-5.1/cinelerra/awindowgui.C
cinelerra-5.1/cinelerra/clippopup.C
cinelerra-5.1/cinelerra/clippopup.h
cinelerra-5.1/cinelerra/mwindow.C
cinelerra-5.1/cinelerra/mwindowgui.C
cinelerra-5.1/cinelerra/preferences.inc
cinelerra-5.1/cinelerra/preferencesthread.C

index 14a538bbffd9a7543f57b4c159cd897d54fde92e..5738db41a2fb2bb0d856dbd3046fe6686e101da0 100644 (file)
@@ -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;
index 049be4e800db38161dae1d66956334e51dec23fe..9a39a6fbe3094acb365242507ea6155a9f65de3a 100644 (file)
@@ -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__);
 
index e3cc1a533f0492a821dfe467a5b96ae66d2933c0..b8a235a5cedfbaff4b8ca8b4eb3087a0444f011c 100644 (file)
@@ -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"))
 {
index de6d7f6705ded1217c96e18a9ccdc2a892e94802..c641ce0f33acf06fa9cebc43b9886241d1fe82a0 100644 (file)
@@ -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
 {
index 8fc55bca298377f259094e6101bd75ae39c038c5..de0f2ea51e776811843cacae41d2cb50224548b8 100644 (file)
@@ -3135,8 +3135,8 @@ void MWindow::remove_asset_from_caches(Asset *asset)
 void MWindow::remove_assets_from_project(int push_undo, int redraw,
                ArrayList<Indexable*> *drag_assets, ArrayList<EDL*> *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
index 3c0213af123398ae6e6449d5de74f8f23270b86b..c21f83479be36845d1cf24900320a11401b41c7c 100644 (file)
@@ -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;
index 4afbc94b280a99183d2c33875857c6a64cfb62f2..d05d201e040b9c0226f847383443c7e5f84a5d8c 100644 (file)
@@ -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;
index 9393d4359f7158802ffe3c9eab8f84096863e4a0..1de73c3b092d549e96d7f5ca9a2b9af215b8fb7f 100644 (file)
@@ -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;