dvb chan tuner api upgrade, slip/ripple handle drag keyfrm fix, load menu tweaks
authorGood Guy <good1.2guy@gmail.com>
Wed, 20 Feb 2019 21:34:16 +0000 (14:34 -0700)
committerGood Guy <good1.2guy@gmail.com>
Wed, 20 Feb 2019 21:34:16 +0000 (14:34 -0700)
cinelerra-5.1/cinelerra/dcraw.C
cinelerra-5.1/cinelerra/devicedvbinput.C
cinelerra-5.1/cinelerra/edit.C
cinelerra-5.1/cinelerra/shuttle.C
cinelerra-5.1/cinelerra/track.C
cinelerra-5.1/guicast/bcfilebox.C
cinelerra-5.1/guicast/bcfilebox.h

index 12e36160e3f0bccd55ae405ee0dfbfa35d225e6f..dcb561d5609e4724a11feeb2be7a4d657bf77c8a 100644 (file)
@@ -4106,7 +4106,7 @@ void CLASS hat_transform (float *temp, float *base, int st, int size, int sc)
 void CLASS wavelet_denoise()
 {
   float *fimg=0, *temp, thold, mul[2], avg, diff;
-  int scale=1, size, lev, hpass, lpass, row, col, nc, c, i, wlast, blk[2];
+  int scale=1, size, lev, hpass, lpass=0, row, col, nc, c, i, wlast, blk[2];
   ushort *window[4];
   static const float noise[] =
   { 0.8002,0.2735,0.1202,0.0585,0.0291,0.0152,0.0080,0.0044 };
index 1f38b838627a2b7a4b940a425e7501ffe79d0f2e..7943108949682fd287a621eb4e1915b9fec80aba 100644 (file)
@@ -254,6 +254,79 @@ int DeviceDVBInput::dvb_open()
        if( !ret && table >= CHANLIST_SIZE ) ret = 1;
 
        struct dvb_frontend_parameters frontend_param;
+#if 1
+       if( !ret ) {
+               uint32_t frequency = chanlists[table].list[index].freq * 1000;
+               class dtv_props : public ArrayList<dtv_property> {
+               public:
+                       void add(int c, int d) {
+                               dtv_property &p = append();
+                               memset(&p, 0, sizeof(p));
+                               p.cmd = c;  p.u.data = d;
+                       }
+               } props;
+
+               switch( table ) {
+               case NTSC_DVB:
+               case NTSC_BCAST:
+               case NTSC_HRC:
+               case NTSC_BCAST_JP:
+                       props.add(DTV_DELIVERY_SYSTEM, SYS_ATSC);
+                       props.add(DTV_FREQUENCY, frequency);
+                       props.add(DTV_INVERSION, INVERSION_AUTO);
+                       props.add(DTV_MODULATION, VSB_8);
+//                     frontend_param.u.vsb.modulation = VSB_8;
+                       break;
+               case PAL_EUROPE:
+               case PAL_E_EUROPE:
+               case PAL_ITALY:
+               case PAL_NEWZEALAND:
+               case PAL_AUSTRALIA:
+               case PAL_IRELAND:
+               case CATV_DVB:
+               case NTSC_CABLE:
+               case NTSC_CABLE_JP:
+//                     props.add(DTV_DELIVERY_SYSTEM, SYS_DVBT);
+//                     if( t->delsys == SYS_DVBT2 ) { props.add(DTV_STREAM_ID, 0 /* id */); }
+                       props.add(DTV_FREQUENCY, frequency /* 174.00MHz ... 862.00MHz */);
+//                     props.add(DTV_INVERSION, INVERSION_AUTO);
+                       props.add(DTV_BANDWIDTH_HZ, 6000000 /* 6/7/8 Mhz */);
+                       props.add(DTV_CODE_RATE_HP, FEC_AUTO);
+                       props.add(DTV_CODE_RATE_LP, FEC_AUTO);
+                       props.add(DTV_MODULATION, QAM_AUTO);
+                       props.add(DTV_TRANSMISSION_MODE, TRANSMISSION_MODE_AUTO);
+                       props.add(DTV_GUARD_INTERVAL, GUARD_INTERVAL_AUTO);
+                       props.add(DTV_HIERARCHY, HIERARCHY_AUTO);
+//                     frontend_param.u.qam.modulation = QAM_AUTO;
+                       break;
+               default:
+                       fprintf(stderr,
+                               "DeviceDVBInput::dvb_open bad table index=%d\n", table);
+                       ret = 2;
+                       break;
+               }
+               struct dtv_properties dtv_props;
+               memset(&dtv_props, 0, sizeof(dtv_props));
+               props.add(DTV_TUNE, 0);
+               dtv_props.num = props.size();
+               dtv_props.props = &props[0];
+               if( ioctl(frontend_fd, FE_SET_PROPERTY, &dtv_props) < 0 ) {
+                       fprintf(stderr,
+                               "DeviceDVBInput::dvb_open FE_SET_PROPERY frequency=%d: %s\n",
+                               frequency, strerror(errno));
+                       ret = 2;
+               }
+       }
+
+#else
+// older version
+       if( !ret && ioctl(frontend_fd, FE_SET_FRONTEND, &frontend_param) < 0 ) {
+               fprintf(stderr,
+                       "DeviceDVBInput::dvb_open FE_SET_FRONTEND frequency=%d: %s\n",
+                       frontend_param.frequency, strerror(errno));
+               ret = 2;
+       }
+
        if( !ret ) {
                uint32_t frequency = chanlists[table].list[index].freq * 1000;
                if( frequency < fe_info.frequency_min ||
@@ -299,6 +372,7 @@ int DeviceDVBInput::dvb_open()
                        frontend_param.frequency, strerror(errno));
                ret = 2;
        }
+#endif
 
        if( !ret && wait_signal(333,3) ) {
                fprintf(stderr,
index 5321209acd68b7233a3b23d2ac1bb4da9edcadfe..47ca63c3ffe915a28469da28700988e616b28186 100644 (file)
@@ -452,9 +452,10 @@ int Edit::shift_start(int edit_mode, int64_t newposition, int64_t oldposition,
        case MOVE_RIPPLE:
                edits_moved = rest_moved = 1;
                startsource += cut_length;
-               length -= cut_length;
+               cut_length = -cut_length;
+               length += cut_length;
                for( Edit *edit=next; edit; edit=edit->next )
-                       edit->startproject -= cut_length;
+                       edit->startproject += cut_length;
                break;
        case MOVE_ROLL:
                if( prev ) prev->trim(cut_length);
@@ -579,11 +580,11 @@ int Edit::follow_edits(int64_t start, int64_t end, int64_t cut_length,
                }
                if( edit_plugins ) {
                        if( cut_length > 0 ) {
-                               track->clear(end, end+cut_length, 0, 0, 1, 0, 0);
+                               track->clear(end, end+cut_length, 0, 0, -1, 0, 0);
                                track->shift_effects(start, cut_length, 1, 0);
                        }
                        else if( cut_length < 0 ) {
-                               track->clear(start+cut_length, start, 0, 0, 1, 0, 0);
+                               track->clear(start+cut_length, start, 0, 0, -1, 0, 0);
                                track->shift_effects(end+cut_length, -cut_length, 1, 0);
                        }
                }
index 7bf3c5e486df18739192dce8119758274b3c7f6f..df2850dc8e4f22a5c6915e7062ddb151378b74d4 100644 (file)
@@ -619,6 +619,8 @@ static const struct shuttle_dev {
                0x0b33, 0x0030 },
        { "/dev/input/by-id/usb-Contour_Design_ShuttlePro-event-if00",
                0x0b33, 0x0030 },
+       { "/dev/input/by-id/usb-Contour_Design_ShuttlePRO_v2-event-joystick",
+               0x0b33, 0x0030 },
 };
 
 #ifdef HAVE_SHUTTLE_USB
index 3c092b73f7188ec8ea2080cdceb15a7e88f7de6f..24de614f43d48fb788fffe1c7a21e0e053ce6649 100644 (file)
@@ -1186,9 +1186,10 @@ int Track::clear(int64_t start, int64_t end,
        if( edit_autos )
                automation->clear(start, end, 0, 1);
        if( edit_plugins ) {
+               int edit_keyframes = edit_plugins < 0 ? 1 : edit_autos;
                for(int i = 0; i < plugin_set.total; i++) {
                        if(!trim_edits || trim_edits == (Edits*)plugin_set.values[i])
-                               plugin_set.values[i]->clear(start, end, edit_autos);
+                               plugin_set.values[i]->clear(start, end, edit_keyframes);
                }
        }
        if( edit_edits )
index 7fba2ec63dfa468d6569d9073cabbf0dace5cc0e..3ff3010119e17a1a3217def57405a319c45f23f0 100644 (file)
@@ -51,6 +51,7 @@ BC_FileBoxRecent::BC_FileBoxRecent(BC_FileBox *filebox, int x, int y)
                0, 0, 1, 0, 1)
 {
        this->filebox = filebox;
+       set_tooltip(_("Recent paths"));
 }
 
 int BC_FileBoxRecent::handle_event()
@@ -173,7 +174,7 @@ int BC_FileBoxListBox::evaluate_query(char *string)
 
 
 BC_FileBoxTextBox::BC_FileBoxTextBox(int x, int y, BC_FileBox *filebox)
- : BC_TextBox(x, y, filebox->get_w() - 20, 1,
+ : BC_TextBox(x, y, filebox->get_w() - x - 20, 1,
        filebox->want_directory ?  filebox->directory : filebox->filename)
 {
        this->filebox = filebox;
@@ -194,8 +195,8 @@ int BC_FileBoxTextBox::handle_event()
 }
 
 
-BC_FileBoxDirectoryText::BC_FileBoxDirectoryText(int x, int y, BC_FileBox *filebox)
- : BC_TextBox(x, y, filebox->get_w() - 40, 1, filebox->fs->get_current_dir())
+BC_FileBoxDirectoryText::BC_FileBoxDirectoryText(int x, int y, int w, BC_FileBox *filebox)
+ : BC_TextBox(x, y, w, 1, filebox->fs->get_current_dir())
 {
        this->filebox = filebox;
 }
@@ -624,10 +625,12 @@ void BC_FileBox::create_objects()
        y += directory_title_margin + 3;
 
        add_subwindow(recent_popup = new BC_FileBoxRecent(this, x, y));
-       add_subwindow(directory_title = new BC_FileBoxDirectoryText(x, y, this));
-       directory_title->reposition_window(x, y, get_w() - recent_popup->get_w() -  20, 1);
-       x += directory_title->get_w() + 8;
-       recent_popup->reposition_window(x, y, directory_title->get_w(), 200);
+       BC_Title *dir_title;
+       add_subwindow(dir_title = new BC_Title(x, y, _("Directory:")));
+       int x1 = x + dir_title->get_w() + 10, w1 = get_w()-x1 - recent_popup->get_w()-20;
+       add_subwindow(directory_title = new BC_FileBoxDirectoryText(x1, y, w1, this));
+       x1 += directory_title->get_w() + 8;
+       recent_popup->reposition_window(x1, y, directory_title->get_w(), 200);
 
        x = 10;
        y += directory_title->get_h() + 5;
@@ -665,7 +668,9 @@ void BC_FileBox::create_objects()
        listbox = 0;
        create_listbox(x, y, get_display_mode());
        y += listbox->get_h() + 10;
-       add_subwindow(textbox = new BC_FileBoxTextBox(x, y, this));
+       add_subwindow(file_title = new BC_Title(x, y, _("File:")));
+       x1 = x + file_title->get_w() + 10;
+       add_subwindow(textbox = new BC_FileBoxTextBox(x1, y, this));
        y += textbox->get_h() + 10;
 
        if(!want_directory) {
@@ -741,10 +746,8 @@ int BC_FileBox::resize_event(int w, int h)
                w - (get_w() - filter_text->get_w()),
                1);
        directory_title->reposition_window(
-               directory_title->get_x(),
-               directory_title->get_y(),
-               get_w() - recent_popup->get_w() -  20,
-               1);
+               directory_title->get_x(), directory_title->get_y(),
+               get_w()-directory_title->get_x() - recent_popup->get_w()-20, 1);
        recent_popup->reposition_window(
                directory_title->get_x() + directory_title->get_w() + 8,
                directory_title->get_y(),
@@ -754,6 +757,8 @@ int BC_FileBox::resize_event(int w, int h)
                search_text->get_y(),
                get_w() - search_text->get_x() -  40,
                1);
+       file_title->reposition_window(file_title->get_x(),
+               h - (get_h() - file_title->get_y()));
        textbox->reposition_window(textbox->get_x(),
                h - (get_h() - textbox->get_y()),
                w - (get_w() - textbox->get_w()),
index f450ec5c52f97eaba1eea855e3e3489506cf5d1b..115ac8b1a53bf2e82ed22cd2f79124cc39577d30 100644 (file)
@@ -121,7 +121,7 @@ public:
 class BC_FileBoxDirectoryText : public BC_TextBox
 {
 public:
-       BC_FileBoxDirectoryText(int x, int y, BC_FileBox *filebox);
+       BC_FileBoxDirectoryText(int x, int y, int w, BC_FileBox *filebox);
        int handle_event();
        BC_FileBox *filebox;
 };
@@ -314,6 +314,7 @@ private:
 
        BC_Pixmap *icons[TOTAL_ICONS];
        BC_FileBoxRecent *recent_popup;
+       BC_Title *file_title;
        BC_FileBoxTextBox *textbox;
        BC_FileBoxListBox *listbox;
        BC_Title *filter_title;