motion draw_vectors using VFrame draw_pixel brush
[goodguy/history.git] / cinelerra-5.1 / plugins / motion / motionwindow.C
index 7d6fa43839ec6adb371259ce497b6223d437139a..b8930e206f813f612a4292e9244c3cea9dfb1db5 100644 (file)
@@ -32,7 +32,7 @@
 #include "pluginserver.h"
 
 MotionWindow::MotionWindow(MotionMain *plugin)
- : PluginClientWindow(plugin, 600, 650, 600, 650, 0)
+ : PluginClientWindow(plugin, 800, 640, 800, 640, 0)
 {
        this->plugin = plugin;
 }
@@ -43,8 +43,8 @@ MotionWindow::~MotionWindow()
 
 void MotionWindow::create_objects()
 {
-       int x1 = 10, x = 10, y = 10;
-       int x2 = 310;
+       int x = 10, y = 10;
+       int x1 = x, x2 = get_w() / 2;
        BC_Title *title;
 
        add_subwindow(global = new MotionGlobal(plugin, this, x1, y));
@@ -108,6 +108,11 @@ void MotionWindow::create_objects()
        track_direction->create_objects();
 
        y += 40;
+       add_subwindow(title = new BC_Title(x2, y, _("Tracking file:")));
+       add_subwindow(tracking_file = new MotionTrackingFile(plugin,
+               plugin->config.tracking_file, this, x2+title->get_w() + 20, y));
+
+       int y1 = y;
        add_subwindow(title = new BC_Title(x, y + 10, _("Block X:")));
        add_subwindow(block_x =
                new MotionBlockX(plugin, this, x + title->get_w() + 10, y));
@@ -115,12 +120,12 @@ void MotionWindow::create_objects()
                new MotionBlockXText(plugin, this,
                        x + title->get_w() + 10 + block_x->get_w() + 10, y + 10));
 
+       y += 40;
        add_subwindow(title = new BC_Title(x2, y, _("Rotation center:")));
        add_subwindow(rotation_center =
                new RotationCenter(plugin, x2 + title->get_w() + 10, y));
 
-       int y1 = y;
-       y += 50;
+       y += 40;
        add_subwindow(title = new BC_Title(x2, y + 10, _("Maximum angle offset:")));
        add_subwindow(rotate_magnitude =
                new MotionRMagnitude(plugin, x2 + title->get_w() + 10, y));
@@ -129,9 +134,10 @@ void MotionWindow::create_objects()
        add_subwindow(title = new BC_Title(x2, y + 10, _("Rotation settling speed:")));
        add_subwindow(rotate_return_speed =
                new MotionRReturnSpeed(plugin, x2 + title->get_w() + 10, y));
-
-       y = y1;
        y += 40;
+       add_subwindow(vectors = new MotionDrawVectors(plugin, this, x2, y));
+
+       y = y1 + 60;
        add_subwindow(title = new BC_Title(x, y + 10, _("Block Y:")));
        add_subwindow(block_y =
                new MotionBlockY(plugin, this, x + title->get_w() + 10, y));
@@ -151,40 +157,34 @@ void MotionWindow::create_objects()
                new MotionReturnSpeed(plugin, x + title->get_w() + 10, y));
 
        y += 40;
-       add_subwindow(vectors = new MotionDrawVectors(plugin, this, x, y));
-
-       add_subwindow(title = new BC_Title(x2, y, _("Tracking file:")));
-       add_subwindow(tracking_file = new MotionTrackingFile(plugin,
-               plugin->config.tracking_file, this, x2+title->get_w() + 20, y));
+       add_subwindow(track_single =
+               new TrackSingleFrame(plugin, this, x, y));
+       y += 20;
+       add_subwindow(track_previous =
+               new TrackPreviousFrame(plugin, this, x, y));
+       y += 20;
+       add_subwindow(previous_same =
+               new PreviousFrameSameBlock(plugin, this, x, y));
 
        y += 40;
        x1 = x;  y1 = y;
-       add_subwindow(track_single =
-               new TrackSingleFrame(plugin, this, x1, y1));
        add_subwindow(title =
-               new BC_Title(x1 += track_single->get_w() + 20, y1, _("Frame number:")));
+               new BC_Title(x1=x2, y1, _("Frame number:")));
        add_subwindow(track_frame_number =
                new TrackFrameNumber(plugin, this, x1 += title->get_w(), y1));
+       if(plugin->config.tracking_object != MotionScan::TRACK_SINGLE)
+               track_frame_number->disable();
+
        add_subwindow(addtrackedframeoffset =
-               new AddTrackedFrameOffset(plugin, this, x1, y1+=track_frame_number->get_h()));
+               new AddTrackedFrameOffset(plugin, this, x1=x2, y1+=track_frame_number->get_h()));
        int pef = client->server->mwindow->edl->session->video_every_frame;
-       add_subwindow(pef_title = new BC_Title(x1, y1+=addtrackedframeoffset->get_h() + 5,
+       add_subwindow(pef_title = new BC_Title(x1=x2+50, y1+=addtrackedframeoffset->get_h() + 5,
                !pef ?  _("For best results\n"
                                " Set: Play every frame\n"
                                " Preferences-> Playback-> Video Out") :
                        _("Currently using: Play every frame"), MEDIUMFONT,
                !pef ? RED : GREEN));
 
-       y += 20;
-       add_subwindow(track_previous =
-               new TrackPreviousFrame(plugin, this, x, y));
-
-       y += 20;
-       add_subwindow(previous_same =
-               new PreviousFrameSameBlock(plugin, this, x, y));
-
-       y += 40;
-       y1 = y;
        add_subwindow(title = new BC_Title(x, y, _("Master layer:")));
        add_subwindow(master_layer = new MasterLayer(plugin,
                this, x + title->get_w() + 10, y));
@@ -608,7 +608,6 @@ TrackFrameNumber::TrackFrameNumber(MotionMain *plugin,
 {
        this->plugin = plugin;
        this->gui = gui;
-       if(plugin->config.tracking_object != MotionScan::TRACK_SINGLE) disable();
 }
 
 int TrackFrameNumber::handle_event()