lv2 tweaks, add set dft transition, zoom fix, fs test_filter fix
authorGood Guy <[email protected]>
Fri, 15 Jun 2018 21:32:06 +0000 (15:32 -0600)
committerGood Guy <[email protected]>
Fri, 15 Jun 2018 21:32:06 +0000 (15:32 -0600)
cinelerra-5.1/cinelerra/lv2ui.C
cinelerra-5.1/cinelerra/menuattachtransition.C
cinelerra-5.1/cinelerra/menuattachtransition.h
cinelerra-5.1/cinelerra/mwindowedit.C
cinelerra-5.1/cinelerra/pluginlv2.C
cinelerra-5.1/cinelerra/pluginlv2client.C
cinelerra-5.1/cinelerra/pluginlv2ui.C
cinelerra-5.1/guicast/filesystem.C
cinelerra-5.1/plugins/zoom/zoom.C

index 23b26a3e03db20e06022e9fe85358d40ed10cb98..a025ef1c5d79e727e9738ce6f7f5391c40d6922d 100644 (file)
@@ -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");
index 143bcdb9a79655cae094ca34d4af376d39b993c8..13307fb9fc695f522a9176fa99d33788c3a24d87 100644 (file)
@@ -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;
 }
 
index 5b03561301cfcd25ca61b078d49e27579444fb74..00dcb62d68a1ebcfdb1458a382972af56508e4c0 100644 (file)
@@ -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
index cfabc9bb1c73820aad08cb905bad3bcdfcd57fa8..cf818e47a48f0c27432b7d5c2d7a59165c3eb007 100644 (file)
@@ -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);
 
index c894bd0a92e7669aa5cb8c6b64ce3b2cd4b8a17a..d5f6c079eaf5ee4500a1a692d71caaa342541718 100644 (file)
@@ -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);
index 3e204acb44cf551ebd06677bdc46409a8067dea0..20c8ed3635728c720950a7014f6754618c77006c 100644 (file)
@@ -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);
 }
 
index 24faecf1bbf9708361b7b18c5d52ef4e6f9da90a..17f072a2c6bf63b6c5960f21d7c364aa10e5199c 100644 (file)
@@ -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 ) {
index 60cdadb5f993f1fbc1a162b777ed33afcdd7c367..ebc2007da9e145744e7d5b85dc05915ff79763f3 100644 (file)
@@ -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, '*');
index c9c4301f422d26afa462d71841b20d7d8ce5d810..3a682030b9695e3293970f5c1aea3281292be423 100644 (file)
@@ -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);
        }