X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fassetedit.C;h=3eee273f20ea946e090df7228b71958e4d522b66;hb=51fdff4109828a112ac1006a92bdbdd1ba9b18a5;hp=eb76149b3b1eca5364e460a2165a4054ad36bc50;hpb=190b4810ec184c74ceab3fcd6faf09a91c92c53c;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/assetedit.C b/cinelerra-5.1/cinelerra/assetedit.C index eb76149b..3eee273f 100644 --- a/cinelerra-5.1/cinelerra/assetedit.C +++ b/cinelerra-5.1/cinelerra/assetedit.C @@ -95,14 +95,14 @@ void AssetEdit::edit_asset(Indexable *indexable) { EDL *nested_edl = (EDL*)indexable; - strcpy(changed_params->path, nested_edl->path); + strcpy(changed_params->path, nested_edl->path); changed_params->sample_rate = nested_edl->session->sample_rate; - changed_params->channels = nested_edl->session->audio_channels; + changed_params->channels = nested_edl->session->audio_channels; //printf("AssetEdit::edit_asset %d %f\n", __LINE__, nested_edl->session->frame_rate); changed_params->frame_rate = nested_edl->session->frame_rate; - changed_params->width = nested_edl->session->output_w; - changed_params->height = nested_edl->session->output_h; + changed_params->width = nested_edl->session->output_w; + changed_params->height = nested_edl->session->output_h; } BC_DialogThread::start(); @@ -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(); @@ -227,7 +212,7 @@ AssetEditWindow::AssetEditWindow(MWindow *mwindow, AssetEdit *asset_edit) mwindow->gui->get_abs_cursor_y(1) - (128 + 64 + (!asset_edit->indexable->have_audio() ? 0 : 180) + (!asset_edit->indexable->have_video() ? 0 : 350)) / 2, - 400, (128 + 64 + + 450, (128 + 64 + (!asset_edit->indexable->have_audio() ? 0 : 180) + (!asset_edit->indexable->have_video() ? 0 : 350)), 0, 0, 1) { @@ -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; } @@ -259,7 +250,7 @@ AssetEditWindow::~AssetEditWindow() void AssetEditWindow::create_objects() { - int y = 10, x = 10, x1 = 10, x2 = 160; + int y = 10, x = 10, x1 = 10, x2 = 190; char string[BCTEXTLEN]; int vmargin; FileSystem fs; @@ -577,11 +568,11 @@ void AssetEditWindow::create_objects() y += ilacefixoption_chkboxw->get_h() + 5; // -------------------- add_subwindow(title = new BC_Title(x1, y, _("Asset's interlacing:"))); - add_subwindow(textboxw = new AssetEditILacemode(this, "", BC_ILACE_ASSET_MODEDEFAULT, x2, y, 200)); + add_subwindow(textboxw = new AssetEditILacemode(this, "", ILACE_ASSET_MODEDEFAULT, x2, y, 200)); ilacefixoption_chkboxw->ilacemode_textbox = textboxw; add_subwindow(listboxw = new AssetEditInterlacemodePulldown(mwindow, textboxw, - &asset->interlace_mode, + &asset_edit->changed_params->interlace_mode, (ArrayList*)&mwindow->interlace_asset_modes, ilacefixoption_chkboxw, x2 + textboxw->get_w(), @@ -591,11 +582,11 @@ void AssetEditWindow::create_objects() // -------------------- add_subwindow(title = new BC_Title(x1, y, _("Interlace correction:"))); - add_subwindow(textboxw = new AssetEditILacefixmethod(this, "", BC_ILACE_FIXDEFAULT, x2, y, 200)); + add_subwindow(textboxw = new AssetEditILacefixmethod(this, "", ILACE_FIXDEFAULT, x2, y, 200)); ilacefixoption_chkboxw->ilacefixmethod_textbox = textboxw; add_subwindow(listboxw = new InterlacefixmethodPulldown(mwindow, textboxw, - &asset->interlace_fixmethod, + &asset_edit->changed_params->interlace_fixmethod, (ArrayList*)&mwindow->interlace_asset_fixmethods, x2 + textboxw->get_w(), y)); @@ -621,8 +612,11 @@ void AssetEditWindow::create_objects() // Calculate values to enter into textboxes char text[32], *tc = text; - Units::totext(tc, asset->tcstart / asset->frame_rate, - TIME_HMSF, asset->sample_rate, asset->frame_rate); + if( asset ) + Units::totext(tc, asset->tcstart / asset->frame_rate, + TIME_HMSF, asset->sample_rate, asset->frame_rate); + else + strcpy(tc, "0:00:00:00"); const char *tc_hours = tc, *tc_minutes, *tc_seconds, *tc_rest; tc = strchr(tc, ':'); *tc++ = 0; tc_minutes = tc; @@ -704,7 +698,7 @@ int AssetEditFRate::handle_event() Interlaceautofix::Interlaceautofix(MWindow *mwindow,AssetEditWindow *fwindow, int x, int y) : BC_CheckBox(x, y, - ((Asset *)fwindow->asset_edit->indexable)->interlace_autofixoption, + fwindow->asset_edit->changed_params->interlace_autofixoption, _("Automatically Fix Interlacing")) { this->fwindow = fwindow; @@ -717,7 +711,7 @@ Interlaceautofix::~Interlaceautofix() int Interlaceautofix::handle_event() { - Asset *asset = (Asset *)fwindow->asset_edit->indexable; + Asset *asset = fwindow->asset_edit->changed_params; asset->interlace_autofixoption = get_value(); showhideotherwidgets(); return 1; @@ -727,8 +721,8 @@ void Interlaceautofix::showhideotherwidgets() { int thevalue = get_value(); - Asset *asset = (Asset *)fwindow->asset_edit->indexable; - if (thevalue == BC_ILACE_AUTOFIXOPTION_AUTO) + Asset *asset = fwindow->asset_edit->changed_params; + if (thevalue == ILACE_AUTOFIXOPTION_AUTO) { this->ilacemode_textbox->enable(); this->ilacemode_listbox->enable(); @@ -738,7 +732,7 @@ void Interlaceautofix::showhideotherwidgets() ilacefixmethod_to_text(string,xx); this->ilacefixmethod_textbox->update(string); } - if (thevalue == BC_ILACE_AUTOFIXOPTION_MANUAL) + if (thevalue == ILACE_AUTOFIXOPTION_MANUAL) { this->ilacemode_textbox->disable(); this->ilacemode_listbox->disable(); @@ -788,7 +782,7 @@ AssetEditILaceautofixoption::AssetEditILaceautofixoption(AssetEditWindow *fwindo int AssetEditILaceautofixoption::handle_event() { - Asset *asset = (Asset *)fwindow->asset_edit->indexable; + Asset *asset = fwindow->asset_edit->changed_params; asset->interlace_autofixoption = ilaceautofixoption_from_text(get_text(), this->thedefault); return 1; } @@ -803,7 +797,7 @@ AssetEditILacemode::AssetEditILacemode(AssetEditWindow *fwindow, const char *tex int AssetEditILacemode::handle_event() { - Asset *asset = (Asset *)fwindow->asset_edit->indexable; + Asset *asset = fwindow->asset_edit->changed_params; asset->interlace_mode = ilacemode_from_text(get_text(),this->thedefault); return 1; } @@ -950,7 +944,7 @@ int AssetEditPathText::handle_event() AssetEditPath::AssetEditPath(MWindow *mwindow, AssetEditWindow *fwindow, BC_TextBox *textbox, int y, const char *text, const char *window_title, const char *window_caption) - : BrowseButton(mwindow, fwindow, textbox, 310, y, text, + : BrowseButton(mwindow->theme, fwindow, textbox, 310, y, text, window_title, window_caption, 0) { this->fwindow = fwindow; @@ -1036,8 +1030,8 @@ void DetailAssetThread::stop() dwindow->lock_window("DetailAssetThread::stop"); dwindow->set_done(1); dwindow->unlock_window(); - Thread::join(); } + Thread::join(); } void DetailAssetWindow::create_objects() @@ -1086,8 +1080,7 @@ void DetailAssetThread::run() AssetEditReelName::AssetEditReelName(AssetEditWindow *fwindow, int x, int y) - : BC_TextBox(x, y, 220, 1, - ((Asset *)fwindow->asset_edit->indexable)->reel_name, + : BC_TextBox(x, y, 220, 1, fwindow->asset_edit->changed_params->reel_name, 1, MEDIUMFONT, 1) { this->fwindow = fwindow; @@ -1107,7 +1100,7 @@ int AssetEditReelName::handle_event() AssetEditReelNumber::AssetEditReelNumber(AssetEditWindow *fwindow, int x, int y) - : BC_TextBox(x, y, 200, 1, ((Asset *)fwindow->asset_edit->indexable)->reel_number) + : BC_TextBox(x, y, 200, 1, fwindow->asset_edit->changed_params->reel_number) { this->fwindow = fwindow; }