anonymous contribution for much improved ChromakeyHSV plugin menu with boxes to set...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / mixersalign.C
index 8092b14aeb38ccde548a30c495a085fe497d7620..bd4116f39bd0a595443f4f39da4e73792b46b14e 100644 (file)
@@ -85,7 +85,7 @@ MixersAlignMixerList::MixersAlignMixerList(MixersAlignWindow *gui,
        this->dialog = dialog;
        this->gui = gui;
        for( int i=MIX_SZ; --i>=0; ) {
-               col_widths[i] = mix_widths[i];
+               col_widths[i] = xS(mix_widths[i]);
                col_titles[i] = _(mix_titles[i]);
        }
 }
@@ -200,7 +200,7 @@ MixersAlignMTrackList::MixersAlignMTrackList(MixersAlignWindow *gui,
        this->dialog = dialog;
        this->gui = gui;
        for( int i=MTK_SZ; --i>=0; ) {
-               col_widths[i] = mtk_widths[i];
+               col_widths[i] = xS(mtk_widths[i]);
                col_titles[i] = _(mtk_titles[i]);
        }
 }
@@ -273,7 +273,7 @@ MixersAlignATrackList::MixersAlignATrackList(MixersAlignWindow *gui,
        this->dialog = dialog;
        this->gui = gui;
        for( int i=ATK_SZ; --i>=0; ) {
-               col_widths[i] = atk_widths[i];
+               col_widths[i] = xS(atk_widths[i]);
                col_titles[i] = _(atk_titles[i]);
        }
 }
@@ -479,7 +479,7 @@ int MixersAlignUndoItem::handle_event()
 
 MixersAlignUndo::MixersAlignUndo(MixersAlignWindow *gui,
                MixersAlign *dialog, int x, int y)
- : BC_PopupMenu(x, y, 100, _("Undo"))
+ : BC_PopupMenu(x, y, xS(100), _("Undo"))
 {
        this->gui = gui;
        this->dialog = dialog;
@@ -505,7 +505,7 @@ void MixersAlignUndo::add_undo_item(int no)
 
 MixersAlignCheckPoint::MixersAlignCheckPoint(MixersAlignWindow *gui,
                MixersAlign *dialog, int x, int y)
- : BC_GenericButton(x, y, 100, _("CheckPoint"))
+ : BC_GenericButton(x, y, xS(100), _("CheckPoint"))
 {
        this->gui = gui;
        this->dialog = dialog;
@@ -518,9 +518,11 @@ int MixersAlignCheckPoint::handle_event()
 }
 
 MixersAlignWindow::MixersAlignWindow(MixersAlign *dialog, int x, int y)
- : BC_Window(_("Align Mixers"), x, y, 880, 380, 880, 380, 1)
+ : BC_Window(_("Align Mixers"), x, y, xS(880), yS(380), xS(880), yS(380), 1)
 {
        this->dialog = dialog;
+// *** CONTEXT_HELP ***
+       context_help_set_keyword("Video sync using Waveforms");
 }
 MixersAlignWindow::~MixersAlignWindow()
 {
@@ -528,7 +530,9 @@ MixersAlignWindow::~MixersAlignWindow()
 
 void MixersAlignWindow::create_objects()
 {
-       int x = 10, y = 10, w4 = (get_w()-x-10)/4, lw = w4 + 20;
+       int xs10 = xS(10), xs20 = xS(20);
+       int ys10 = yS(10), ys20 = yS(20);
+       int x = xs10, y = ys10, w4 = (get_w()-x-xs10)/4, lw = w4 + xs20;
        int x1 = x, x2 = x1 + lw , x3 = x2 + lw, x4 = get_w()-x;
        mixer_title = new BC_Title(x1,y, _("Mixers:"), MEDIUMFONT, YELLOW);
        add_subwindow(mixer_title);
@@ -536,25 +540,25 @@ void MixersAlignWindow::create_objects()
        add_subwindow(mtrack_title);
        atrack_title = new BC_Title(x3,y, _("Audio Tracks:"), MEDIUMFONT, YELLOW);
        add_subwindow(atrack_title);
-       y += mixer_title->get_h() + 10;
-       int y1 = y, y2 = get_h() - BC_OKButton::calculate_h() - 32;
+       y += mixer_title->get_h() + ys10;
+       int y1 = y, y2 = get_h() - BC_OKButton::calculate_h() - yS(32);
        int lh = y2 - y1;
-       mixer_list = new MixersAlignMixerList(this, dialog, x1, y, x2-x1-20, lh);
+       mixer_list = new MixersAlignMixerList(this, dialog, x1, y, x2-x1-xs20, lh);
        add_subwindow(mixer_list);
-       mtrack_list = new MixersAlignMTrackList(this, dialog, x2, y, x3-x2-20, lh);
+       mtrack_list = new MixersAlignMTrackList(this, dialog, x2, y, x3-x2-xs20, lh);
        add_subwindow(mtrack_list);
-       atrack_list = new MixersAlignATrackList(this, dialog, x3, y, x4-x3-20, lh);
+       atrack_list = new MixersAlignATrackList(this, dialog, x3, y, x4-x3-xs20, lh);
        add_subwindow(atrack_list);
-       int xr = x2-10 - MixersAlignReset::calculate_width(this);
-       y1 = y2+20;
+       int xr = x2-xs10 - MixersAlignReset::calculate_width(this);
+       y1 = y2+ys20;
        add_subwindow(reset = new MixersAlignReset(this, dialog, xr, y1));
-       add_subwindow(match = new MixersAlignMatch(this, dialog, x2+10, y1));
-       int xa = x3-10 - MixersAlignNudgeTracks::calculate_width(this);
+       add_subwindow(match = new MixersAlignMatch(this, dialog, x2+xs10, y1));
+       int xa = x3-xs10 - MixersAlignNudgeTracks::calculate_width(this);
        add_subwindow(nudge_tracks = new MixersAlignNudgeTracks(this, dialog, xa, y1));
-       y2 = y1 + nudge_tracks->get_h() + 10;
+       y2 = y1 + nudge_tracks->get_h() + ys10;
        add_subwindow(match_all = new MixersAlignMatchAll(this, dialog, xr, y2));
        add_subwindow(nudge_selected = new MixersAlignNudgeSelected(this, dialog, xa, y2));
-       int xu = x3+10;
+       int xu = x3+xs10;
        add_subwindow(check_point = new MixersAlignCheckPoint(this, dialog, xu, y1));
        add_subwindow(undo = new MixersAlignUndo(this, dialog, xu, y2));
        undo->create_objects();
@@ -565,27 +569,29 @@ void MixersAlignWindow::create_objects()
 
 int MixersAlignWindow::resize_event(int w, int h)
 {
-       int x = 10, y = 10, w4 = (w-x-10)/4, lw = w4 + 20;
+       int xs10 = xS(10), xs20 = xS(20);
+       int ys10 = yS(10), ys20 = yS(20);
+       int x = xs10, y = ys10, w4 = (w-x-xs10)/4, lw = w4 + xs20;
        int x1 = x, x2 = x1 + lw , x3 = x2 + lw, x4 = w-x;
        mixer_title->reposition_window(x1, y);
        mtrack_title->reposition_window(x2, y);
        atrack_title->reposition_window(x3, y);
-       y += mixer_title->get_h() + 10;
-       int y1 = y, y2 = h - BC_OKButton::calculate_h() - 32;
+       y += mixer_title->get_h() + ys10;
+       int y1 = y, y2 = h - BC_OKButton::calculate_h() - yS(32);
        int lh = y2 - y1;
-       mixer_list->reposition_window(x1, y, x2-x1-20, lh);
-       mtrack_list->reposition_window(x2, y, x3-x2-20, lh);
-       atrack_list->reposition_window(x3, y, x4-x3-20, lh);
-       int xr = x2-10 - MixersAlignReset::calculate_width(this);
-       y1 = y2+20;
+       mixer_list->reposition_window(x1, y, x2-x1-xs20, lh);
+       mtrack_list->reposition_window(x2, y, x3-x2-xs20, lh);
+       atrack_list->reposition_window(x3, y, x4-x3-xs20, lh);
+       int xr = x2-xs10 - MixersAlignReset::calculate_width(this);
+       y1 = y2+ys20;
        reset->reposition_window(xr, y1);
-       match->reposition_window(x2+10, y1);
-       int xa = x3-10 - MixersAlignNudgeTracks::calculate_width(this);
+       match->reposition_window(x2+xs10, y1);
+       int xa = x3-xs10 - MixersAlignNudgeTracks::calculate_width(this);
        nudge_tracks->reposition_window(xa, y1);
-       y2 = y1 + nudge_tracks->get_h() + 10;
+       y2 = y1 + nudge_tracks->get_h() + ys10;
        match_all->reposition_window(xr, y2);
        nudge_selected->reposition_window(xa, y2);
-       int xu = x3+10;
+       int xu = x3+xs10;
        check_point->reposition_window(xu, y1);
        undo->reposition_window(xu, y2);
        return 0;
@@ -700,7 +706,7 @@ void MixersAlign::nudge_tracks()
                        while( track && track->mixer_id != id ) track = track->next;
                        if( !track ) continue;
                        double nudge = mix->nudge;
-                       int record = track->record;  track->record = 1;
+                       int armed = track->armed;  track->armed = 1;
                        if( nudge < 0 ) {
                                track->clear(0, -nudge, 1,
                                        edl->session->labels_follow_edits,
@@ -712,7 +718,7 @@ void MixersAlign::nudge_tracks()
                                        edl->session->plugins_follow_edits,
                                        edl->session->autos_follow_edits);
                        }
-                       track->record = record;
+                       track->armed = armed;
                }
        }
        edl->optimize();
@@ -732,8 +738,8 @@ void MixersAlign::nudge_selected()
 
        ArrayList<int> track_arms;  // ugly
        for( Track *track=edl->tracks->first; track; track=track->next ) {
-               track_arms.append(track->record);
-               track->record = 0;
+               track_arms.append(track->armed);
+               track->armed = 0;
        }
        for( int m, i=0; (m=ma_gui->mixer_list->get_selection_number(0,i))>=0; ++i ) {
                if( m == midx ) continue;  // master does not move
@@ -745,7 +751,7 @@ void MixersAlign::nudge_selected()
                        while( track && track->mixer_id != id ) track = track->next;
                        if( !track ) continue;
                        double nudge = mix->nudge;
-                       track->record = 1;
+                       track->armed = 1;
                        double position = 0;  Track *first_track = 0;
                        EDL *clip = edl->selected_edits_to_clip(0, &position, &first_track);
                        if( clip ) {
@@ -771,12 +777,12 @@ void MixersAlign::nudge_selected()
                                position += nudge;
                                edl->paste_edits(clip, first_track, position, 1);
                        }
-                       track->record = 0;
+                       track->armed = 0;
                }
        }
        int i = 0;
        for( Track *track=edl->tracks->first; track; track=track->next )
-               track->record = track_arms[i++];
+               track->armed = track_arms[i++];
        edl->optimize();
 
        mwindow->update_gui(1);
@@ -1005,7 +1011,7 @@ void MixersAlign::apply_undo(int no)
 MixersAlignARender::MixersAlignARender(MWindow *mwindow, EDL *edl)
  : RenderEngine(0, mwindow->preferences, 0, 0)
 {
-       TransportCommand command;
+       TransportCommand command(mwindow->preferences);
        command.command = NORMAL_FWD;
        command.get_edl()->copy_all(edl);
        command.change_type = CHANGE_ALL;