dynamic keyframes, textbox rework, andrea ffmpeg.opts, perpetual chkpt undo, lv2...
[goodguy/history.git] / cinelerra-5.1 / plugins / descratch / descratch.C
index b94fc9dab4962052a6815ff6e49557a1f7dec9ba..f22023e5328c3443d6018b12094b034e496f49f5 100644 (file)
@@ -123,7 +123,7 @@ void DeScratchMain::save_data(KeyFrame *keyframe)
 {
        FileXML output;
 // cause data to be stored directly in text
-       output.set_shared_output(keyframe->get_data(), MESSAGESIZE);
+       output.set_shared_output(keyframe->xbuf);
 // Store data
        output.tag.set_title("DESCRATCH");
        output.tag.set_property("THRESHOLD", config.threshold);
@@ -152,7 +152,7 @@ void DeScratchMain::save_data(KeyFrame *keyframe)
 void DeScratchMain::read_data(KeyFrame *keyframe)
 {
        FileXML input;
-       input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));
+       input.set_shared_input(keyframe->xbuf);
 
        int result = 0;
 
@@ -474,7 +474,7 @@ NEW_WINDOW_MACRO(DeScratchMain, DeScratchWindow)
 
 
 DeScratchWindow::DeScratchWindow(DeScratchMain *plugin)
- : PluginClientWindow(plugin, 512, 256, 512, 256, 0)
+ : PluginClientWindow(plugin, 512, 270, 512, 270, 0)
 {
        this->plugin = plugin;
 }
@@ -491,7 +491,11 @@ void DeScratchWindow::create_objects()
 
        BC_Title *title;
        add_tool(title = new BC_Title(x, y, _("DeScratch:")));
-       y += title->get_h() + 5;
+
+       int w1 = DeScratchReset::calculate_w(this, _("Reset"));
+       add_tool(reset = new DeScratchReset(this, get_w()-w1-15, y));
+
+       y += title->get_h() + 15;
        int x1 = x, x2 = get_w()/2;
        add_tool(title = new BC_Title(x1=x, y, _("threshold:")));
        x1 += title->get_w()+16;
@@ -504,7 +508,7 @@ void DeScratchWindow::create_objects()
        add_tool(title = new BC_Title(x1=x, y, _("Mode:")));
        x1 += title->get_w()+16;
        add_tool(title = new BC_Title(x1, y, _("y:")));
-       int w1 = title->get_w()+16;
+       w1 = title->get_w()+16;
        add_tool(y_mode = new DeScratchMode(this, (x1+=w1), y, &config.mode_y));
        y_mode->create_objects();  x1 += y_mode->get_w()+16;
        add_tool(title = new BC_Title(x1, y, _("u:")));
@@ -560,10 +564,6 @@ void DeScratchWindow::create_objects()
        x1 += mark->get_w() + 10;
        add_tool(edge_only = new DeScratchEdgeOnly(this, x1, y));
 
-       w1 = DeScratchReset::calculate_w(this, _("Reset"));
-       int h1 = DeScratchReset::calculate_h();
-       add_tool(reset = new DeScratchReset(this, get_w()-w1-15, get_h()-h1-15));
-
        show_window();
 }