X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmenuattachtransition.C;h=13307fb9fc695f522a9176fa99d33788c3a24d87;hp=6971ed1d80c1829606ba4c9d466040c9ccc1eaae;hb=83c3c4b8005ee632f93844f2a81c9bbded1b69ad;hpb=21c2e6b36d6a96c2f662a89459d607b5a387f4eb diff --git a/cinelerra-5.1/cinelerra/menuattachtransition.C b/cinelerra-5.1/cinelerra/menuattachtransition.C index 6971ed1d..13307fb9 100644 --- a/cinelerra-5.1/cinelerra/menuattachtransition.C +++ b/cinelerra-5.1/cinelerra/menuattachtransition.C @@ -82,9 +82,9 @@ void TransitionDialogThread::start() mwindow->search_plugindb(data_type == TRACK_AUDIO, data_type == TRACK_VIDEO, 0, 1, 0, plugindb); for(int i = 0; i < plugindb.total; i++) { - const char *title = _(plugindb.values[i]->title); + const char *title = plugindb.values[i]->title; if( !strcmp(transition_title, title) ) number = i; - transition_names.append(new BC_ListBoxItem(title)); + transition_names.append(new BC_ListBoxItem(_(title))); } } @@ -129,6 +129,45 @@ TransitionDialog::TransitionDialog(MWindow *mwindow, this->thread = thread; } +TransitionSetDefault::TransitionSetDefault(TransitionDialog *window, int x, int y) + : BC_GenericButton(x, y, _("Set Default Transition")) +{ + this->window = window; +} + +TransitionSetDefault::~TransitionSetDefault() +{ +} + +int TransitionSetDefault::handle_event() +{ + TransitionDialogThread *thread = (TransitionDialogThread *)window->thread; + const char *transition_title = thread->transition_title; + EDL *edl = window->mwindow->edl; + switch( thread->data_type ) { + case TRACK_AUDIO: + strcpy(edl->session->default_atransition, transition_title); + break; + case TRACK_VIDEO: + strcpy(edl->session->default_vtransition, transition_title); + break; + } + window->set_default_text->update(transition_title); + return 1; +} + +TransitionDefaultText::TransitionDefaultText(TransitionDialog *window, + int x, int y, int w, const char * text) + : BC_TextBox(x, y, w, 1, text) +{ + this->window = window; +} + +TransitionDefaultText::~TransitionDefaultText() +{ +} + + void TransitionDialog::create_objects() { int x = 10; @@ -142,7 +181,22 @@ void TransitionDialog::create_objects() x, y, get_w() - x - x, - get_h() - y - BC_OKButton::calculate_h() - 10)); + get_h() - y - BC_OKButton::calculate_h() - 100)); + y += name_list->get_h() + 20; + add_subwindow(set_default = new TransitionSetDefault(this, x, y)); + y += set_default->get_h() + 10; + const char *default_transition = ""; + EDL *edl = mwindow->edl; + switch( thread->data_type ) { + case TRACK_AUDIO: + default_transition = edl->session->default_atransition; + break; + case TRACK_VIDEO: + default_transition = edl->session->default_vtransition; + break; + } + add_subwindow(set_default_text = new TransitionDefaultText(this, x, y, + get_w()-x-20, default_transition)); if( thread->number >= 0 ) { name_list->update_selection(&thread->transition_names, thread->number, 0); name_list->draw_items(0); @@ -161,11 +215,12 @@ int TransitionDialog::resize_event(int w, int h) name_title->reposition_window(x, y); y += name_title->get_h() + 5; - name_list->reposition_window(x, - y, - w - x - x, - h - y - BC_OKButton::calculate_h() - 10); - + name_list->reposition_window(x, y, + w - x - x, h - y - BC_OKButton::calculate_h() - 100); + y += name_list->get_h() + 20; + set_default->reposition_window(x, y); + y += set_default->get_h() + 10; + set_default_text->reposition_window(x, y, get_w()-x-20); return 1; }