dynamic keyframes, textbox rework, andrea ffmpeg.opts, perpetual chkpt undo, lv2...
[goodguy/history.git] / cinelerra-5.1 / plugins / graphic / graphic.C
index 0fbf84eec9f984f35e992c4f2becd6c243ffab8f..ad2eae77d9dca3fc2d0c18390c559a5b3c513253 100644 (file)
@@ -1045,7 +1045,7 @@ GraphicEQ::~GraphicEQ()
 
 int GraphicEQ::is_realtime() { return 1; }
 
-const char* GraphicEQ::plugin_title() { return _("EQ Graphic"); }
+const char* GraphicEQ::plugin_title() { return N_("EQ Graphic"); }
 
 NEW_WINDOW_MACRO(GraphicEQ, GraphicGUI)
 
@@ -1063,7 +1063,7 @@ void GraphicEQ::read_data(KeyFrame *keyframe)
        FileXML input;
        int result = 0;
 
-       input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));
+       input.set_shared_input(keyframe->xbuf);
        config.points.remove_all_objects();
 
        while(!result)
@@ -1101,7 +1101,7 @@ void GraphicEQ::read_data(KeyFrame *keyframe)
 void GraphicEQ::save_data(KeyFrame *keyframe)
 {
        FileXML output;
-       output.set_shared_output(keyframe->get_data(), MESSAGESIZE);
+       output.set_shared_output(keyframe->xbuf);
 
        output.tag.set_title("GRAPHICEQ");
        output.tag.set_property("WINDOW_SIZE", config.window_size);
@@ -1129,28 +1129,23 @@ void GraphicEQ::save_data(KeyFrame *keyframe)
 
 void GraphicEQ::update_gui()
 {
-       if(thread)
-       {
-               if(load_configuration() &&
-                       ((GraphicGUI*)thread->window)->canvas->state != GraphicCanvas::DRAG_POINT)
-               {
-                       ((GraphicGUI*)thread->window)->lock_window("GraphicEQ::update_gui");
-                       ((GraphicGUI*)thread->window)->update_canvas();
-                       ((GraphicGUI*)thread->window)->update_textboxes();
-                       ((GraphicGUI*)thread->window)->unlock_window();
-               }
-               else
-               {
-                       int total_frames = get_gui_update_frames();
+       if( !thread ) return;
+       GraphicGUI *window = (GraphicGUI *)thread->window;
+//lock here for points, needed by window cursor_motion callback
+//  deleted in load_configuration by read_data
+       window->lock_window("GraphicEQ::update_gui");
+       if( load_configuration() &&
+           window->canvas->state != GraphicCanvas::DRAG_POINT ) {
+               window->update_canvas();
+               window->update_textboxes();
+       }
+       else {
+               int total_frames = get_gui_update_frames();
 //printf("ParametricEQ::update_gui %d %d\n", __LINE__, total_frames);
-                       if(total_frames)
-                       {
-                               ((GraphicGUI*)thread->window)->lock_window("GraphicEQ::update_gui");
-                               ((GraphicGUI*)thread->window)->update_canvas();
-                               ((GraphicGUI*)thread->window)->unlock_window();
-                       }
-               }
+               if( total_frames )
+                       window->update_canvas();
        }
+       window->unlock_window();
 }
 
 void GraphicEQ::reconfigure()