group selection rework, rm inv title clr, add titlebar alpha textbox, default proxy...
authorGood Guy <good1.2guy@gmail.com>
Sat, 22 Dec 2018 02:38:05 +0000 (19:38 -0700)
committerGood Guy <good1.2guy@gmail.com>
Sat, 22 Dec 2018 02:38:05 +0000 (19:38 -0700)
19 files changed:
cinelerra-5.1/cinelerra/edit.C
cinelerra-5.1/cinelerra/editpopup.C
cinelerra-5.1/cinelerra/edl.C
cinelerra-5.1/cinelerra/edl.h
cinelerra-5.1/cinelerra/interfaceprefs.C
cinelerra-5.1/cinelerra/mainsession.C
cinelerra-5.1/cinelerra/mainsession.inc
cinelerra-5.1/cinelerra/mwindow.h
cinelerra-5.1/cinelerra/mwindowedit.C
cinelerra-5.1/cinelerra/proxy.C
cinelerra-5.1/cinelerra/resourcepixmap.C
cinelerra-5.1/cinelerra/trackcanvas.C
cinelerra-5.1/cinelerra/trackcanvas.h
cinelerra-5.1/cinelerra/tracks.C
cinelerra-5.1/cinelerra/tracks.h
cinelerra-5.1/cinelerra/tracksedit.C
cinelerra-5.1/cinelerra/zoombar.C
cinelerra-5.1/cinelerra/zoombar.h
cinelerra-5.1/cinelerra/zoombar.inc

index fc36b187f6cca511f92b205ef4cf81709b6e58e5..8ef1735538305bc39f4729e21e76a4fca407f246 100644 (file)
@@ -389,7 +389,8 @@ int Edit::dump(FILE *fp)
                asset,
                asset ? asset->path : "");
        fflush(fp);
-       fprintf(fp,"      channel %d, color %08x, group_id %d\n", channel, color, group_id);
+       fprintf(fp,"      channel %d, color %08x, group_id %d, is_selected %d\n",
+               channel, color, group_id, is_selected);
        if(transition)
        {
                fprintf(fp,"      TRANSITION %p\n", transition);
index 34aadc468797c4eba2746b7e29b44a27a4d4359a..9d943d87caf29e353c915e1f1ae69b092f383b8a 100644 (file)
@@ -441,7 +441,7 @@ EditTitleColorDefault::EditTitleColorDefault(
 
 int EditTitleColorDefault::handle_event()
 {
-       const int color = 0, alpha = 0xff;
+       const unsigned color = 0, alpha = 0xff;
        color_picker->color = color | (~alpha << 24);
        color_picker->update_gui(color, alpha);
        return 1;
index 7966276159becb5ca866d43e8cb4051c801c8529..1c0c77b1da1a6d060e80041d7f83d02d4749b943 100644 (file)
@@ -1656,6 +1656,11 @@ double EDL::get_cursor_position(int cursor_x, int pane_no)
                (double)local_session->view_start[pane_no] *
                        local_session->zoom_sample / session->sample_rate;
 }
+int64_t EDL::get_position_cursorx(double position, int pane_no)
+{
+       return (int64_t)(position * session->sample_rate / local_session->zoom_sample)
+                       - local_session->view_start[pane_no];
+}
 
 int EDL::in_use(Indexable *indexable)
 {
index ad7e8cf996d1c7b93080ac36d769347bf3c77186..2cd5de8db1e54580d92608c70fcd83741d90d816 100644 (file)
@@ -97,8 +97,9 @@ public:
        double frame_align(double position, int round);
 // frame align if cursor alignment is enabled
        double align_to_frame(double position, int round);
-// get position under cursor in pane
+// get position under cursor in pane, and inverse
        double get_cursor_position(int cursor_x, int pane_no);
+       int64_t get_position_cursorx(double position, int pane_no);
 
 // increase track w/h to at least session w/h
        void retrack();
index 60241a77972e2723fc5d17d124ec062090560bb2..76bde5e8da7d67e9312523f4ff765fcc39c0730a 100644 (file)
@@ -180,7 +180,7 @@ void InterfacePrefs::create_objects()
        sprintf(string, "%d", pwindow->thread->edl->session->min_meter_db);
        add_subwindow(min_db = new MeterMinDB(pwindow, string, x1, y));
        x1 += min_db->get_w() + 10;
-       add_subwindow(title = new BC_Title(x1, y + 5, _("Max DB:")));
+       add_subwindow(title = new BC_Title(x1, y + 5, _("Max:")));
        x1 += title->get_w() + 10;
        sprintf(string, "%d", pwindow->thread->edl->session->max_meter_db);
        add_subwindow(max_db = new MeterMaxDB(pwindow, string, x1, y));
index acc5e4d12e9784f77ecde0103af2283fbc01d873..bd19562d367b16fd9882322fdedfa8b6c5cade39 100644 (file)
@@ -66,7 +66,6 @@ MainSession::MainSession(MWindow *mwindow)
        cwindow_controls = 1;
        trim_edits = 0;
        current_tip = -1;
-       drag_handle = 0;
        cwindow_fullscreen = 0;
        rwindow_fullscreen = 0;
        vwindow_fullscreen = 0;
index d9506c58763ecd0a75af383d11b8c86648bb7517..33b7580c305dd9a959d8166550cf0457a084e05f 100644 (file)
@@ -63,6 +63,7 @@ enum
        DRAG_PLUGINHANDLE2,         // Dragging outside drag threshold
        DRAG_SPEED,
        DRAG_GROUP,
+       DRAG_BUTTON_DOWN,
        DROP_TARGETING,
 };
 
index a69a9dca1bc590fd79cbb03aa92e4d23957a7fa7..bb02ba77f80791da11ba4d3b5b18c4ef886ea406 100644 (file)
@@ -403,7 +403,7 @@ public:
        void move_edits(ArrayList<Edit*> *edits, Track *track, double position,
 // 0 - old style (cut and insert elswhere), 1- new style - (clear and overwrite elsewere)
                int behaviour);
-       void move_group(EDL *group, Track *first_track, double position);
+       void move_group(EDL *group, Track *first_track, double position, int overwrite);
 // Move effect to position
        void move_effect(Plugin *plugin, Track *track, int64_t position);
        void move_effect(Plugin *plugin, PluginSet *plugin_set, int64_t position);
index d458a78b0d5a8ad4f3a26b30f4b9eae8618489aa..b38a563ecdcb63e5d9d8c0c901b4d6c9d0c32ec3 100644 (file)
@@ -1063,10 +1063,10 @@ void MWindow::move_edits(ArrayList<Edit*> *edits,
        gui->update(1, NORMAL_DRAW, 1, 0, 0, 0, 0);
 }
 
-void MWindow::move_group(EDL *group, Track *first_track, double position)
+void MWindow::move_group(EDL *group, Track *first_track, double position, int overwrite)
 {
        undo->update_undo_before();
-       edl->tracks->move_group(group, first_track, position);
+       edl->tracks->move_group(group, first_track, position, overwrite);
        save_backup();
        undo->update_undo_after(_("move group"), LOAD_ALL);
        restart_brender();
index e368c17c0a860c3d2e56918c0855de2af39bb49c..a53dcf6c6bf29aba38d0eae04c26b196658d091d 100644 (file)
@@ -50,7 +50,6 @@
 #define WIDTH 400
 #define HEIGHT 330
 #define MAX_SCALE 16
-#define PROXY_DEFAULT_VCODEC "h265.mp4"
 
 ProxyMenuItem::ProxyMenuItem(MWindow *mwindow)
  : BC_MenuItem(_("Proxy settings..."),  _("Alt-r"), 'r')
@@ -83,7 +82,13 @@ ProxyDialog::ProxyDialog(MWindow *mwindow)
        this->mwindow = mwindow;
        gui = 0;
        asset = new Asset;
-       strcpy(asset->vcodec, PROXY_DEFAULT_VCODEC);
+
+// quicker than some, not as good as others
+       asset->format = FILE_FFMPEG;
+       strcpy(asset->fformat, "mpeg");
+       strcpy(asset->vcodec, "mpeg.mpeg");
+       asset->ff_video_bitrate = 2000000;
+
        bzero(size_text, sizeof(char*) * MAX_SIZES);
        bzero(size_factors, sizeof(int) * MAX_SIZES);
        size_text[0] = cstrdup(_("Original size"));
@@ -632,6 +637,11 @@ void ProxyClient::process_package(LoadPackage *ptr)
        int jobs = proxy_render->needed_proxies.size();
        int processors = preferences->project_smp / jobs + 1, result = 0;
 
+// each cpu should process at least about 1 MB, or it thrashes
+       int size = edl->session->output_w * edl->session->output_h * 4;
+       int cpus = size / 0x100000 + 1;
+       if( processors > cpus ) processors = cpus;
+
        if( orig->is_asset ) {
                src_file = new File;
                src_file->set_processors(processors);
index 4915a023c2db779ed2f020bf4b7aa5b63830b21e..79a4e94374d1c53ff03d22f0b4f00ed388c2699e 100644 (file)
@@ -306,8 +306,7 @@ void ResourcePixmap::draw_title(TrackCanvas *canvas,
 
        char title[BCTEXTLEN];
        edit->get_title(title);
-       color = color ? ~color & 0xffffff : mwindow->theme->title_color;
-       canvas->set_color(color);
+       canvas->set_color(mwindow->theme->title_color);
        canvas->set_font(mwindow->theme->title_font);
 
 // Justify the text on the left boundary of the edit if it is visible.
index dbcab8880b4a759cd1446d3ce9858bf0c002da46..ca9c1004da1a2d11290e36df857b435e011b1a5d 100644 (file)
@@ -512,14 +512,22 @@ int TrackCanvas::drag_stop(int *redraw)
                                        edit_track = edit_track->previous;
                                        drop_track = drop_track->previous;
                                }
-                               if( drop_track && test_track_group(drag_group, drop_track) ) {
-                                       double position = mwindow->edl->get_cursor_position(cursor_x, pane->number);
-                                       position = mwindow->edl->align_to_frame(position, 0);
-                                       position -= mwindow->session->drag_group_position;
-                                       mwindow->move_group(drag_group, drop_track, position);
+                               if( drop_track ) {
+                                       double cur_pos = mwindow->session->drag_group_position;
+                                       double new_pos = mwindow->edl->get_cursor_position(cursor_x, pane->number);
+                                       new_pos -= mwindow->session->drag_position - cur_pos;
+                                       new_pos = mwindow->edl->align_to_frame(new_pos, 0);
+                                       double drop_position = new_pos;
+                                       int ret = test_track_group(drag_group, drop_track, new_pos);
+                                       if( !ret && new_pos != drop_position ) {
+                                               ret = test_track_group(drag_group, drop_track, new_pos);
+                                       }
+                                       if( ret )
+                                               mwindow->move_group(drag_group, drop_track, new_pos, 1);
+                                       drag_group->remove_user();
+                                       mwindow->session->drag_group = 0;
+                                       mwindow->edl->tracks->clear_selected_edits();
                                }
-                               drag_group->remove_user();
-                               mwindow->session->drag_group = 0;
                        }
                        result = 1;
                        break;
@@ -536,7 +544,10 @@ int TrackCanvas::drag_start_event()
        int rerender = 0;
        int new_cursor, update_cursor;
 
-       if(mwindow->session->current_operation != NO_OPERATION) return 0;
+       if( mwindow->session->current_operation == DRAG_BUTTON_DOWN )
+               mwindow->session->current_operation = NO_OPERATION;
+       else if( mwindow->session->current_operation != NO_OPERATION )
+               return 0;
 
        if(is_event_win()) {
                if(do_plugins(get_drag_x(), get_drag_y(),
@@ -1572,9 +1583,25 @@ void TrackCanvas::draw_highlighting()
                                        edit_track = edit_track->previous;
                                        track = track->previous;
                                }
-                               int color = track && test_track_group(drag_group, track) ? GREEN : RED;
+                               int cx = get_cursor_x();
+                               double cur_pos = mwindow->session->drag_group_position;
+                               double new_pos = mwindow->edl->get_cursor_position(cx, pane->number);
+                               new_pos -= mwindow->session->drag_position - cur_pos;
+                               new_pos = mwindow->edl->align_to_frame(new_pos, 0);
+                               double drop_position = new_pos;
+                               int color = GREEN;
+                               int ret = test_track_group(drag_group, track, new_pos);
+                               if( !ret && new_pos != drop_position ) {
+                                       double pos = new_pos;
+                                       pos += mwindow->session->drag_position - cur_pos;
+                                       cx = mwindow->edl->get_position_cursorx(pos, pane->number);
+                                       ret = test_track_group(drag_group, track, new_pos);
+                                       color = ret ? YELLOW : RED;
+                               }
+                               else if( !ret )
+                                       color = RED;
                                track_dimensions(mwindow->session->track_highlighted, x, y, w, h);
-                               int dx = get_cursor_x() - mwindow->session->drag_origin_x;
+                               int dx = cx - mwindow->session->drag_origin_x;
                                int dy = y - mwindow->session->drag_origin_y;
                                draw_selected_edits(mwindow->edl, dx, dy, color, -1);
                        }
@@ -1663,6 +1690,7 @@ void TrackCanvas::draw_selected_edits(EDL *edl, int dx, int dy, int color0, int
                        int outer = color1 < 0 ? color0 : !edit->group_id ? color1 : inner;
                        set_color(outer);
                        draw_rectangle(x-1, y-1, w+2, h+2);
+                       draw_rectangle(x-2, y-2, w+1, h+1);
                }
        }
 }
@@ -4526,16 +4554,43 @@ int TrackCanvas::button_release_event()
                        result = 1;
                        break; }
 
+               case DRAG_BUTTON_DOWN: {
+                       Edit *edit = mwindow->session->drag_edit;
+                       if( edit ) {
+                               if( shift_down() && edit->is_selected ) {
+                                       if( edit->group_id > 0 ) {
+                                               mwindow->edl->tracks->clear_selected_edits();
+                                               mwindow->edl->tracks->del_group(edit->group_id);
+                                       }
+                                       else {
+                                               int id = mwindow->session->group_number++;
+                                               mwindow->edl->tracks->new_group(id);
+                                       }
+                                       redraw = 0;
+                               }
+                               else {
+                                       if( edit->group_id )
+                                               mwindow->edl->tracks->set_group_selected(edit->group_id, -1);
+                                       else
+                                               edit->is_selected = !edit->is_selected ? 1 : 0;
+                               }
+                       }
+                       mwindow->session->current_operation = NO_OPERATION;
+                       update_overlay = 1;
+                       result = 1;
+                       drag_scroll = 0;
+                       break; }
+
                default:
-                       if(mwindow->session->current_operation) {
+                       if( mwindow->session->current_operation ) {
 //                             if(mwindow->session->current_operation == SELECT_REGION) {
 //                                     mwindow->undo->update_undo_after(_("select"), LOAD_SESSION, 0, 0);
 //                             }
 
                                mwindow->session->current_operation = NO_OPERATION;
                                drag_scroll = 0;
-// Traps button release events
-//                             result = 1;
+                               //result = 0;
+                               break;
                        }
                        break;
                }
@@ -4786,42 +4841,27 @@ int TrackCanvas::do_edits(int cursor_x, int cursor_y, int button_press, int drag
 // Cursor inside an edit
                        if(cursor_x >= edit_x && cursor_x < edit_x + edit_w &&
                                cursor_y >= edit_y && cursor_y < edit_y + edit_h) {
+                               if( button_press ) {
+                                       if( mwindow->edl->session->editing_mode == EDITING_IBEAM &&
+                                           get_double_click() ) {
 // Select duration of edit
-                               if(button_press) {
-                                       if( get_double_click() ) {
-                                               if( shift_down() ) {
-                                                       if( edit->group_id > 0 ) {
-                                                               mwindow->edl->tracks->clear_selected_edits();
-                                                               mwindow->edl->tracks->del_group(edit->group_id);
-                                                       }
-                                                       else {
-                                                               int id = mwindow->session->group_number++;
-                                                               mwindow->edl->tracks->new_group(id);
-                                                       }
-                                                       mwindow->session->current_operation = NO_OPERATION;
-                                                       result = 1;
-                                               }
-                                               else if( !drag_start ) {
-                                                       double start = edit->track->from_units(edit->startproject);
-                                                       start = mwindow->edl->align_to_frame(start, 0);
-                                                       mwindow->edl->local_session->set_selectionstart(start);
-                                                       double end = edit->track->from_units(edit->startproject+edit->length);
-                                                       end = mwindow->edl->align_to_frame(end, 0);
-                                                       mwindow->edl->local_session->set_selectionend(end);
-                                                       result = 1;
-                                               }
-                                       }
-                                       else if( ctrl_down() && get_buttonpress() == 1 &&
-                                           mwindow->edl->session->editing_mode == EDITING_ARROW ) {
-                                               int v = !edit->is_selected ? 1 : 0;
-                                               if( !edit->group_id )
-                                                       edit->is_selected = v;
-                                               else
-                                                       mwindow->edl->tracks->set_group_selected(edit->group_id, v);
+                                               double start = edit->track->from_units(edit->startproject);
+                                               start = mwindow->edl->align_to_frame(start, 0);
+                                               mwindow->edl->local_session->set_selectionstart(start);
+                                               double end = edit->track->from_units(edit->startproject+edit->length);
+                                               end = mwindow->edl->align_to_frame(end, 0);
+                                               mwindow->edl->local_session->set_selectionend(end);
+                                               mwindow->edl->tracks->clear_selected_edits();
+                                               mwindow->edl->tracks->select_affected_edits(
+                                                       edit->track->from_units(edit->startproject),
+                                                       edit->track, 1);
                                                result = 1;
                                        }
+                                       else if( mwindow->edl->session->editing_mode == EDITING_ARROW ) {
+                                               mwindow->session->drag_edit = edit;
+                                               mwindow->session->current_operation = DRAG_BUTTON_DOWN;
+                                       }
                                        if( result ) {
-                                               redraw = 1;
                                                rerender = 1;
                                                update_cursor = -1;
                                        }
@@ -4836,16 +4876,8 @@ int TrackCanvas::do_edits(int cursor_x, int cursor_y, int button_press, int drag
                                                mwindow->session->drag_position =
                                                        mwindow->edl->get_cursor_position(cursor_x, pane->number);
 // Construct list of all affected edits
-                                               if( !shift_down() ) {
+                                               if( ctrl_down() ) {
                                                        mwindow->session->current_operation = DRAG_EDIT;
-                                                       mwindow->edl->tracks->clear_selected_edits();
-                                                       if( !ctrl_down() ) {
-                                                               mwindow->edl->tracks->select_affected_edits(
-                                                                       edit->track->from_units(edit->startproject),
-                                                                       edit->track);
-                                                       }
-                                                       else
-                                                               edit->is_selected = 1;
                                                        mwindow->edl->tracks->get_selected_edits(mwindow->session->drag_edits);
                                                        int cx, cy;  get_abs_cursor(cx, cy);
                                                        gui->drag_popup = new BC_DragWindow(gui,
@@ -4861,8 +4893,7 @@ int TrackCanvas::do_edits(int cursor_x, int cursor_y, int button_press, int drag
                                                                        &mwindow->session->drag_group_first_track);
                                                        if( mwindow->session->drag_group ) {
                                                                mwindow->session->current_operation = DRAG_GROUP;
-                                                               mwindow->session->drag_group_position =
-                                                                       mwindow->session->drag_position - start_position;
+                                                               mwindow->session->drag_group_position = start_position;
                                                                mwindow->session->drag_group_edit = edit;
                                                                mwindow->session->drag_origin_y = edit_y;
                                                        }
@@ -4877,17 +4908,49 @@ int TrackCanvas::do_edits(int cursor_x, int cursor_y, int button_press, int drag
 }
 
 
-int TrackCanvas::test_track_group(EDL *group, Track *first_track)
+int TrackCanvas::test_track_group(EDL *group, Track *first_track, double &pos)
 {
        Track *src = group->tracks->first;
        for( Track *track=first_track; track && src; track=track->next ) {
                if( !track->record ) continue;
                if( src->data_type != track->data_type ) return 0;
+               for( Edit *src_edit=src->edits->first; src_edit; src_edit=src_edit->next ) {
+                       if( src_edit->silence() ) continue;
+                       if( edit_intersects(track, src_edit, pos) ) return 0;
+               }
                src = src->next;
        }
        return !src ? 1 : 0;
 }
 
+int TrackCanvas::edit_intersects(Track *track, Edit *src_edit, double &pos)
+{
+       int64_t src_start = src_edit->startproject;
+       int64_t src_end = src_start + src_edit->length;
+       double new_start = src_edit->track->from_units(src_start) + pos;
+       double new_end = src_edit->track->from_units(src_end) + pos;
+       int64_t trk_start = track->to_units(new_start, 0);
+       int64_t trk_end = track->to_units(new_end, 0);
+       for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
+               if( edit->is_selected || edit->silence() ) continue;
+               int64_t edit_start = edit->startproject;
+               if( edit_start >= trk_end ) continue;
+               int64_t edit_end = edit_start + edit->length;
+               if( trk_start >= edit_end ) continue;
+               int lt_dist = abs(trk_end - edit_start);
+               int rt_dist = abs(edit_end - trk_start);
+               if( lt_dist < rt_dist ) {
+                       pos = edit->track->from_units(edit_start) -
+                               src_edit->track->from_units(src_end);
+               }
+               else {
+                       pos = edit->track->from_units(edit_end);
+               }
+               return 1;
+       }
+       return 0;
+}
+
 int TrackCanvas::test_resources(int cursor_x, int cursor_y)
 {
        return 0;
index 88d764160922b615b28eeb18be04d9e252d5621a..8a123c964029f2801cf27706ab0d373d2e44009e 100644 (file)
@@ -305,7 +305,8 @@ public:
        int do_tracks(int cursor_x,
                int cursor_y,
                int button_press);
-       int test_track_group(EDL *group, Track *first_track);
+       int test_track_group(EDL *group, Track *first_track, double &pos);
+       int edit_intersects(Track *track, Edit *src_edit, double &pos);
        int test_resources(int cursor_x, int cursor_y);
        int do_plugins(int cursor_x,
                int cursor_y,
index 0f53df742895db789f82963b445cd5331dbeceb1..b70b2b8a5543d4b6ca451081710e3b8c4b8fb358 100644 (file)
@@ -113,14 +113,15 @@ void Tracks::clear_selected_edits()
        }
 }
 
-void Tracks::select_affected_edits(double position, Track *start_track)
+void Tracks::select_affected_edits(double position, Track *start_track, int sense)
 {
        for( Track *track=start_track; track; track=track->next ) {
                if( !track->record ) continue;
                for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
                        double startproject = track->from_units(edit->startproject);
                        if( edl->equivalent(startproject, position) ) {
-                               edit->is_selected = 1;
+                               edit->is_selected = sense >= 0 ? sense :
+                                       edit->is_selected ? 0 : 1;
                                break;
                        }
                }
@@ -672,7 +673,7 @@ int Tracks::set_group_selected(int id, int v)
        for( Track *track=first; track; track=track->next ) {
                for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
                        if( edit->group_id != id ) continue;
-                       edit->is_selected = v;
+                       edit->is_selected = v >= 0 ? v : !edit->is_selected ? 1 : 0;
                        ++count;
                }
        }
index 4d3bef901665b06644c0af5d94abbf33823554ef..0cc248d060abcec0cdbd4751d63c50f97e194159 100644 (file)
@@ -51,13 +51,13 @@ public:
                uint32_t load_flags);
        void move_edits(ArrayList<Edit*> *edits, Track *track, double position,
                int edit_labels, int edit_plugins, int edit_autos, int behaviour);
-       void move_group(EDL *group, Track *first_track, double position);
+       void move_group(EDL *group, Track *first_track, double position, int overwrite);
        void move_effect(Plugin *plugin, Track *track, int64_t position);
        void move_effect(Plugin *plugin, PluginSet *plugin_set, int64_t position);
 
 // Construct a list of all the recordable edits which start on position
        void clear_selected_edits();
-       void select_affected_edits(double position, Track *start_track);
+       void select_affected_edits(double position, Track *start_track, int sense);
        void get_selected_edits(ArrayList<Edit*> *drag_edits);
        int next_group_id();
        int new_group(int id);
index 0aa3634c0bb336f8628ad83f7e9a5839c4f79b73..d97800ce9a750458f694fde3d8bef4fa304eda2f 100644 (file)
@@ -208,7 +208,8 @@ void Tracks::set_edit_length(double start, double end, double length)
                                        int64_t length_units = current_track->to_units(end_time, 0) -
                                                total_units;
                                        if(length_units < 1) length_units = 1;
-printf("Tracks::set_edit_length %d %f %f\n", __LINE__, end_time, current_track->from_units(total_units));
+//printf("Tracks::set_edit_length %d %f %f\n", __LINE__,
+// end_time, current_track->from_units(total_units));
                                        total_units += length_units;
 
 // Go in using the edit handle interface
@@ -740,7 +741,7 @@ void Tracks::move_edits(ArrayList<Edit*> *edits,
        }
 }
 
-void Tracks::move_group(EDL *group, Track *first_track, double position)
+void Tracks::move_group(EDL *group, Track *first_track, double position, int overwrite)
 {
        for( Track *track=first; track; track=track->next ) {
                if( !track->record ) continue;
@@ -759,7 +760,8 @@ void Tracks::move_group(EDL *group, Track *first_track, double position)
                        if( edit->silence() ) continue;
                        int64_t start = pos + edit->startproject;
                        int64_t end = start + edit->length;
-                       track->edits->clear(start, end);
+                       if( overwrite )
+                               track->edits->clear(start, end);
                        Edit *dst = track->edits->insert_new_edit(start);
                        dst->copy_from(edit);
                        dst->startproject = start;
index 9f1c95bcb0e9d596f7562176179350e226ec2fe9..274961c0473df18b7d21dd1742a4d40ae9baa296 100644 (file)
@@ -104,7 +104,9 @@ void ZoomBar::create_objects()
        x += length_value->get_w() + 5;
        add_subwindow(to_value = new ToTextBox(mwindow, this, x, y));
        x += to_value->get_w() + 5;
-       add_subwindow(title_alpha = new TitleBarAlpha(mwindow, this, x, y));
+       add_subwindow(title_alpha_bar = new TitleAlphaBar(mwindow, this, x, y));
+       x += title_alpha_bar->get_w() + 5;
+       add_subwindow(title_alpha_text = new TitleAlphaText(mwindow, this, x, y));
 
        update_formatting(from_value);
        update_formatting(length_value);
@@ -193,18 +195,38 @@ int ZoomBar::update_clocks()
        return 0;
 }
 
-TitleBarAlpha::TitleBarAlpha(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
+TitleAlphaBar::TitleAlphaBar(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
  : BC_FSlider(x, y, 0, 150, 200, 0, 1.0, mwindow->session->title_bar_alpha, 0)
 {
        this->mwindow = mwindow;
        this->zoombar = zoombar;
        set_precision(0.01);
-       set_tooltip(_("TitleBar Alpha"));
+       set_tooltip(_("Title Alpha"));
 }
 
-int TitleBarAlpha::handle_event()
+int TitleAlphaBar::handle_event()
 {
-       mwindow->session->title_bar_alpha = get_value();
+       float v = get_value();
+       mwindow->session->title_bar_alpha = v;
+       zoombar->title_alpha_text->update(v);
+       mwindow->gui->draw_trackmovement();
+       mwindow->gui->flush();
+       return 1;
+}
+
+TitleAlphaText::TitleAlphaText(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
+ : BC_TextBox(x, y, 48, 1, mwindow->session->title_bar_alpha, 0, MEDIUMFONT, 2)
+{
+       this->mwindow = mwindow;
+       this->zoombar = zoombar;
+       set_tooltip(_("Title Alpha"));
+}
+
+int TitleAlphaText::handle_event()
+{
+       float v = atof(get_text())*100;
+       mwindow->session->title_bar_alpha = v;
+       zoombar->title_alpha_bar->update(v);
        mwindow->gui->draw_trackmovement();
        mwindow->gui->flush();
        return 1;
index c013b019cc33ed240d7745a80f736fd6f3c8ab1c..9026e31626731156cd30b6b6d7a186ff9fb4dece 100644 (file)
@@ -59,7 +59,8 @@ public:
        LengthTextBox *length_value;
        FromTextBox *from_value;
        ToTextBox *to_value;
-       TitleBarAlpha *title_alpha;
+       TitleAlphaBar *title_alpha_bar;
+       TitleAlphaText *title_alpha_text;
        char string[256], string2[256];
 };
 
@@ -161,10 +162,19 @@ public:
        ZoomBar *zoombar;
 };
 
-class TitleBarAlpha : public BC_FSlider
+class TitleAlphaBar : public BC_FSlider
 {
 public:
-       TitleBarAlpha(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
+       TitleAlphaBar(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
+       int handle_event();
+       MWindow *mwindow;
+       ZoomBar *zoombar;
+};
+
+class TitleAlphaText : public BC_TextBox
+{
+public:
+       TitleAlphaText(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
        int handle_event();
        MWindow *mwindow;
        ZoomBar *zoombar;
index ceb7c66bfa030731d772336ddbed1fb7ccc5fb27..29c89aa76e94b754bae7fac7c11a15b752f2414a 100644 (file)
@@ -32,7 +32,8 @@ class ZoomTextBox;
 class FromTextBox;
 class LengthTextBox;
 class ToTextBox;
-class TitleBarAlpha;
+class TitleAlphaBar;
+class TitleAlphaText;
 
 #define ZOOMBAR_PIXELS 24