From: Good Guy Date: Fri, 15 Jun 2018 21:32:06 +0000 (-0600) Subject: lv2 tweaks, add set dft transition, zoom fix, fs test_filter fix X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=83c3c4b8005ee632f93844f2a81c9bbded1b69ad;p=goodguy%2Fhistory.git lv2 tweaks, add set dft transition, zoom fix, fs test_filter fix --- diff --git a/cinelerra-5.1/cinelerra/lv2ui.C b/cinelerra-5.1/cinelerra/lv2ui.C index 23b26a3e..a025ef1c 100644 --- a/cinelerra-5.1/cinelerra/lv2ui.C +++ b/cinelerra-5.1/cinelerra/lv2ui.C @@ -34,7 +34,7 @@ int PluginLV2ChildUI::run(int ac, char **av) ForkBase::ppid = atoi(av[3]); } else { - int sample_rate = 48000, bfrsz = 4096; + int sample_rate = samplerate, bfrsz = block_length; if( ac > 2 ) sample_rate = atoi(av[2]); if( init_ui(av[1], sample_rate, bfrsz) ) { fprintf(stderr," init_ui failed\n"); diff --git a/cinelerra-5.1/cinelerra/menuattachtransition.C b/cinelerra-5.1/cinelerra/menuattachtransition.C index 143bcdb9..13307fb9 100644 --- a/cinelerra-5.1/cinelerra/menuattachtransition.C +++ b/cinelerra-5.1/cinelerra/menuattachtransition.C @@ -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; } diff --git a/cinelerra-5.1/cinelerra/menuattachtransition.h b/cinelerra-5.1/cinelerra/menuattachtransition.h index 5b035613..00dcb62d 100644 --- a/cinelerra-5.1/cinelerra/menuattachtransition.h +++ b/cinelerra-5.1/cinelerra/menuattachtransition.h @@ -46,6 +46,25 @@ public: }; +class TransitionSetDefault : public BC_GenericButton +{ +public: + TransitionSetDefault(TransitionDialog *window, int x, int y); + ~TransitionSetDefault(); + int handle_event(); + + TransitionDialog *window; +}; + +class TransitionDefaultText : public BC_TextBox +{ +public: + TransitionDefaultText(TransitionDialog *window, + int x, int y, int w, const char *text); + ~TransitionDefaultText(); + + TransitionDialog *window; +}; class TransitionDialogThread : public BC_DialogThread @@ -81,6 +100,8 @@ public: TransitionDialogThread *thread; TransitionDialogName *name_list; BC_Title *name_title; + TransitionSetDefault *set_default; + TransitionDefaultText *set_default_text; }; class TransitionDialogName : public BC_ListBox diff --git a/cinelerra-5.1/cinelerra/mwindowedit.C b/cinelerra-5.1/cinelerra/mwindowedit.C index cfabc9bb..cf818e47 100644 --- a/cinelerra-5.1/cinelerra/mwindowedit.C +++ b/cinelerra-5.1/cinelerra/mwindowedit.C @@ -1677,6 +1677,15 @@ void MWindow::paste_transitions(int track_type, char *title) double end = edl->local_session->get_selectionend(); edl->tracks->paste_transitions(start, end, track_type, title); + switch( track_type ) { + case TRACK_AUDIO: + strcpy(edl->session->default_atransition, title); + break; + case TRACK_VIDEO: + strcpy(edl->session->default_vtransition, title); + break; + } + save_backup(); undo->update_undo_after(_("attach transitions"), LOAD_EDITS); diff --git a/cinelerra-5.1/cinelerra/pluginlv2.C b/cinelerra-5.1/cinelerra/pluginlv2.C index c894bd0a..d5f6c079 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2.C +++ b/cinelerra-5.1/cinelerra/pluginlv2.C @@ -180,7 +180,7 @@ int PluginLV2::init_lv2(PluginLV2ClientConfig &conf, int sample_rate, int bfrsz) features.append(new Lv2Feature(LV2_BUF_SIZE__boundedBlockLength, 0)); features.append(new Lv2Feature(LV2_WORKER__schedule, &schedule)); - if( sample_rate < 64 ) sample_rate = 44100; + if( sample_rate < 64 ) sample_rate = samplerate; atom_int = uri_table.map(LV2_ATOM__Int); atom_float = uri_table.map(LV2_ATOM__Float); diff --git a/cinelerra-5.1/cinelerra/pluginlv2client.C b/cinelerra-5.1/cinelerra/pluginlv2client.C index 3e204acb..20c8ed36 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2client.C +++ b/cinelerra-5.1/cinelerra/pluginlv2client.C @@ -167,14 +167,14 @@ NEW_WINDOW_MACRO(PluginLV2Client, PluginLV2ClientWindow) int PluginLV2Client::init_lv2() { - int bfrsz = 4096; + int bfrsz = block_length; EDL *edl = server->edl; if( edl ) { PlaybackConfig *playback_config = edl->session->playback_config; bfrsz = playback_config->aconfig->fragment_size; } int sample_rate = get_project_samplerate(); - if( sample_rate < 64 ) sample_rate = 48000; + if( sample_rate < 64 ) sample_rate = samplerate; return PluginLV2::init_lv2(config, sample_rate, bfrsz); } diff --git a/cinelerra-5.1/cinelerra/pluginlv2ui.C b/cinelerra-5.1/cinelerra/pluginlv2ui.C index 24faecf1..17f072a2 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2ui.C +++ b/cinelerra-5.1/cinelerra/pluginlv2ui.C @@ -263,8 +263,8 @@ void PluginLV2ChildUI::reset_gui() // main loop int PluginLV2ChildUI::run_ui() { - double last_time = 0, fps = 30; - int64_t frame_usecs = 1e6 / fps; + double last_time = 0; + int64_t frame_usecs = 1e6 / refreshrate; running = 1; done = 0; while( !done ) { diff --git a/cinelerra-5.1/guicast/filesystem.C b/cinelerra-5.1/guicast/filesystem.C index 60cdadb5..ebc2007d 100644 --- a/cinelerra-5.1/guicast/filesystem.C +++ b/cinelerra-5.1/guicast/filesystem.C @@ -316,6 +316,7 @@ int FileSystem::test_filter(const char *url, const char *filter) const char *path = url; const char *subfilter1 = string, *subfilter2 = 0; int token_done = 0; + result = 0; do { string2[0] = 0; subfilter2 = strchr(subfilter1, '*'); diff --git a/cinelerra-5.1/plugins/zoom/zoom.C b/cinelerra-5.1/plugins/zoom/zoom.C index c9c4301f..3a682030 100644 --- a/cinelerra-5.1/plugins/zoom/zoom.C +++ b/cinelerra-5.1/plugins/zoom/zoom.C @@ -267,7 +267,7 @@ int ZoomMain::process_realtime(VFrame *incoming, VFrame *outgoing) outgoing->clear_frame(); overlayer->overlay(outgoing, incoming, in_x, in_y, in_x + in_w, in_y + in_h, - 0, 0, temp->get_w(), temp->get_h(), + 0, 0, outgoing->get_w(), outgoing->get_h(), 1.0, TRANSFER_REPLACE, CUBIC_LINEAR); }