From ab958f323d68316c450ef81ba296536580620163 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Wed, 20 Feb 2019 14:34:16 -0700 Subject: [PATCH] dvb chan tuner api upgrade, slip/ripple handle drag keyfrm fix, load menu tweaks --- cinelerra-5.1/cinelerra/dcraw.C | 2 +- cinelerra-5.1/cinelerra/devicedvbinput.C | 74 ++++++++++++++++++++++++ cinelerra-5.1/cinelerra/edit.C | 9 +-- cinelerra-5.1/cinelerra/shuttle.C | 2 + cinelerra-5.1/cinelerra/track.C | 3 +- cinelerra-5.1/guicast/bcfilebox.C | 29 ++++++---- cinelerra-5.1/guicast/bcfilebox.h | 3 +- 7 files changed, 103 insertions(+), 19 deletions(-) diff --git a/cinelerra-5.1/cinelerra/dcraw.C b/cinelerra-5.1/cinelerra/dcraw.C index 12e36160..dcb561d5 100644 --- a/cinelerra-5.1/cinelerra/dcraw.C +++ b/cinelerra-5.1/cinelerra/dcraw.C @@ -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 }; diff --git a/cinelerra-5.1/cinelerra/devicedvbinput.C b/cinelerra-5.1/cinelerra/devicedvbinput.C index 1f38b838..79431089 100644 --- a/cinelerra-5.1/cinelerra/devicedvbinput.C +++ b/cinelerra-5.1/cinelerra/devicedvbinput.C @@ -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 { + 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, diff --git a/cinelerra-5.1/cinelerra/edit.C b/cinelerra-5.1/cinelerra/edit.C index 5321209a..47ca63c3 100644 --- a/cinelerra-5.1/cinelerra/edit.C +++ b/cinelerra-5.1/cinelerra/edit.C @@ -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); } } diff --git a/cinelerra-5.1/cinelerra/shuttle.C b/cinelerra-5.1/cinelerra/shuttle.C index 7bf3c5e4..df2850dc 100644 --- a/cinelerra-5.1/cinelerra/shuttle.C +++ b/cinelerra-5.1/cinelerra/shuttle.C @@ -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 diff --git a/cinelerra-5.1/cinelerra/track.C b/cinelerra-5.1/cinelerra/track.C index 3c092b73..24de614f 100644 --- a/cinelerra-5.1/cinelerra/track.C +++ b/cinelerra-5.1/cinelerra/track.C @@ -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 ) diff --git a/cinelerra-5.1/guicast/bcfilebox.C b/cinelerra-5.1/guicast/bcfilebox.C index 7fba2ec6..3ff30101 100644 --- a/cinelerra-5.1/guicast/bcfilebox.C +++ b/cinelerra-5.1/guicast/bcfilebox.C @@ -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()), diff --git a/cinelerra-5.1/guicast/bcfilebox.h b/cinelerra-5.1/guicast/bcfilebox.h index f450ec5c..115ac8b1 100644 --- a/cinelerra-5.1/guicast/bcfilebox.h +++ b/cinelerra-5.1/guicast/bcfilebox.h @@ -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; -- 2.26.2