ffmpeg api3 upgrade, rework bs filts, rm faac/d, fixes
[goodguy/history.git] / cinelerra-5.1 / cinelerra / assetedit.C
index 0b77d919afc216fcf5260de5337f7df732edd324..3eee273f20ea946e090df7228b71958e4d522b66 100644 (file)
@@ -110,7 +110,7 @@ void AssetEdit::edit_asset(Indexable *indexable)
 
 void AssetEdit::handle_done_event(int result)
 {
-       if( !result ) {
+       if( !result && window->tc_hours_textbox ) {
                changed_params->tcstart = ceil(indexable->get_frame_rate() *
                        (atoi(window->tc_hours_textbox->get_text()) * 3600 +
                         atoi(window->tc_minutes_textbox->get_text()) * 60 +
@@ -121,46 +121,37 @@ void AssetEdit::handle_done_event(int result)
 
 void AssetEdit::handle_close_event(int result)
 {
-       if(!result)
-       {
+       if(!result) {
                int changed = 0;
                Asset *asset = 0;
                EDL *nested_edl = 0;
 
-               if(indexable->is_asset)
-               {
+               if(indexable->is_asset) {
                        asset = (Asset*)indexable;
-                       if(!changed_params->equivalent(*asset, 1, 1))
+                       if( !changed_params->equivalent(*asset, 1, 1, mwindow->edl) )
                                changed = 1;
                }
-               else
-               {
+               else {
                        nested_edl = (EDL*)indexable;
-                       if(strcmp(changed_params->path, nested_edl->path)
-//                ||
-//                changed_params->sample_rate != nested_edl->session->sample_rate ||
-//                             !EQUIV(changed_params->frame_rate, nested_edl->session->frame_rate)
-                )
+                       if( strcmp(changed_params->path, nested_edl->path)
+//                          || changed_params->sample_rate != nested_edl->session->sample_rate
+//                          || !EQUIV(changed_params->frame_rate, nested_edl->session->frame_rate
+                       )
                                changed = 1;
                }
-//printf("AssetEdit::handle_close_event %d\n", __LINE__);
-
-               if(changed)
-               {
+               if(changed) {
                        mwindow->gui->lock_window();
 //printf("AssetEdit::handle_close_event %d\n", __LINE__);
 
 // Omit index status from copy since an index rebuild may have been
 // happening when new_asset was created but not be happening anymore.
-                       if(asset)
-                       {
+                       if(asset) {
                                mwindow->remove_asset_from_caches(asset);
 //printf("AssetEdit::handle_close_event %d %f\n", __LINE__, asset->get_frame_rate());
                                asset->copy_from(changed_params, 0);
 //printf("AssetEdit::handle_close_event %d %d %d\n", __LINE__, changed_params->bits, asset->bits);
                        }
-                       else
-                       {
+                       else {
                                strcpy(nested_edl->path, changed_params->path);
 // Other parameters can't be changed because they're defined in the other EDL
 //                nested_edl->session->frame_rate = changed_params->frame_rate;
@@ -168,18 +159,11 @@ void AssetEdit::handle_close_event(int result)
                        }
 //printf("AssetEdit::handle_close_event %d\n", __LINE__);
 
-                       mwindow->gui->update(0,
-                               2,
-                               0,
-                               0,
-                               0,
-                               0,
-                               0);
+                       mwindow->gui->update(0, 2, 0, 0, 0, 0, 0);
 //printf("AssetEdit::handle_close_event %d\n", __LINE__);
 
 // Start index rebuilding
-                       if( (asset && asset->audio_data) || nested_edl)
-                       {
+                       if( (asset && asset->audio_data) || nested_edl) {
                                char source_filename[BCTEXTLEN];
                                char index_filename[BCTEXTLEN];
                                IndexFile::get_index_filename(source_filename,
@@ -193,6 +177,7 @@ void AssetEdit::handle_close_event(int result)
                        }
                        mwindow->gui->unlock_window();
 //printf("AssetEdit::handle_close_event %d\n", __LINE__);
+                       mwindow->awindow->gui->update_picon(indexable);
                        mwindow->awindow->gui->async_update_assets();
 
                        mwindow->restart_brender();
@@ -240,6 +225,12 @@ AssetEditWindow::AssetEditWindow(MWindow *mwindow, AssetEdit *asset_edit)
        lohi = 0;
        allow_edits = 0;
        detail_thread = 0;
+       tc_hours_textbox = 0;
+       tc_minutes_textbox = 0;
+       tc_seconds_textbox = 0;
+       tc_rest_textbox = 0;
+       win_width = 0;
+       win_height = 0;
 }