merge: fixes to speed autos, draw float autos, edit params, render format tool
authorGood Guy <good1.2guy@gmail.com>
Mon, 21 Mar 2016 21:13:00 +0000 (15:13 -0600)
committerGood Guy <good1.2guy@gmail.com>
Mon, 21 Mar 2016 21:13:00 +0000 (15:13 -0600)
cinelerra-5.1/cinelerra/automation.C
cinelerra-5.1/cinelerra/keyframepopup.C
cinelerra-5.1/cinelerra/keyframepopup.h
cinelerra-5.1/cinelerra/render.C
cinelerra-5.1/cinelerra/render.h
cinelerra-5.1/cinelerra/trackcanvas.C

index b7c04bdf6801066ef39e672781b73747716d6aab..fd2de32255718b163389b2ee930cf71ce82f3ee0 100644 (file)
@@ -76,6 +76,7 @@ int Automation::autogrouptype(int autoidx, Track *track)
                        break;
                case AUTOMATION_CAMERA_Z:
                case AUTOMATION_PROJECTOR_Z:
+               case AUTOMATION_SPEED:
                        autogrouptype = AUTOGROUPTYPE_ZOOM;
                        break;
                case AUTOMATION_FADE:
index 303f599ed1ee5c1abd063acad9ba882963d050f0..d8528ae2c43370dbed48ed8370c0e0fb49cd5da4 100644 (file)
@@ -54,6 +54,7 @@ KeyframePopup::KeyframePopup(MWindow *mwindow, MWindowGUI *gui)
        key_free = 0;
        key_mbar = 0;
        key_mode_displayed = false;
+       key_edit_displayed = false;
 }
 
 KeyframePopup::~KeyframePopup()
@@ -65,6 +66,9 @@ KeyframePopup::~KeyframePopup()
                delete key_free_t;
                delete key_free;
        }
+       if( !key_edit_displayed ) {
+               delete key_edit;
+       }
 }
 
 void KeyframePopup::create_objects()
@@ -72,8 +76,8 @@ void KeyframePopup::create_objects()
        add_item(key_show = new KeyframePopupShow(mwindow, this));
        add_item(key_delete = new KeyframePopupDelete(mwindow, this));
        add_item(key_copy = new KeyframePopupCopy(mwindow, this));
-       add_item(key_edit = new KeyframePopupEdit(mwindow, this));
 
+       key_edit   = new KeyframePopupEdit(mwindow, this);
        key_mbar   = new BC_MenuItem("-");
        key_smooth = new KeyframePopupCurveMode(mwindow, this, FloatAuto::SMOOTH);
        key_linear = new KeyframePopupCurveMode(mwindow, this, FloatAuto::LINEAR);
@@ -119,6 +123,15 @@ void KeyframePopup::handle_curve_mode(Autos *autos, Auto *auto_keyframe)
 // determines the type of automation node. if floatauto, adds
 // menu entries showing the curve mode of the node
 {
+       if( !key_edit_displayed && keyframe_plugin ) {
+               add_item(key_edit);
+               key_edit_displayed = true;
+       }
+       else if( key_edit_displayed && !keyframe_plugin ) {
+               remove_item(key_mbar);
+               key_edit_displayed = false;
+       }
+
        if(!key_mode_displayed && autos && autos->get_type() == AUTOMATION_TYPE_FLOAT)
        { // append additional menu entries showing the curve_mode
                add_item(key_mbar);
@@ -190,9 +203,8 @@ int KeyframePopupShow::handle_event()
        {
                mwindow->update_plugin_guis();
                mwindow->show_plugin(popup->keyframe_plugin);
-       } else
-       if (popup->keyframe_automation)
-       {
+       }
+       else if( popup->keyframe_automation ) {
 /*
 
                mwindow->cwindow->gui->lock_window();
index d774686b77fc503023fe398956472bbef23d4031..c512d0e025c8b0f5130c7083dcc80380e4d4245c 100644 (file)
@@ -68,6 +68,7 @@ private:
        KeyframePopupCurveMode *key_linear;
        KeyframePopupCurveMode *key_free_t;
        KeyframePopupCurveMode *key_free;
+       bool key_edit_displayed;
        bool key_mode_displayed;
 
        void handle_curve_mode(Autos *autos, Auto *auto_keyframe);
index ded88a3f033f920d20c25ac85a1f0a0f24996839..a1160a6463633600b88bc6cb2e5a7b9a03255ce2 100644 (file)
@@ -350,6 +350,15 @@ BC_Window* Render::new_gui()
        return render_window;
 }
 
+void Render::handle_done_event(int result)
+{
+       if(!result) {
+               // add to recentlist only on OK
+               render_window->format_tools->path_recent->
+                       add_item(File::formattostr(asset->format), asset->path);
+       }
+       render_window = 0;
+}
 
 void Render::handle_close_event(int result)
 {
@@ -357,9 +366,6 @@ void Render::handle_close_event(int result)
        const int debug = 0;
 
        if(!result) {
-               // add to recentlist only on OK
-               render_window->format_tools->path_recent->
-                       add_item(File::formattostr(asset->format), asset->path);
 // Check the asset format for errors.
                FormatCheck format_check(asset);
                format_error = format_check.check_format();
@@ -379,7 +385,6 @@ void Render::handle_close_event(int result)
                if(debug) printf("Render::handle_close_event %d\n", __LINE__);
        }
 //PRINT_TRACE
-       render_window = 0;
 }
 
 
index 638aaabbd88f933bf6ba1254037c92bc4a15dace..357af62fee957d8e207464cca0c08ae4c515c126 100644 (file)
@@ -118,6 +118,7 @@ public:
        void stop_operation();
        BC_Window* new_gui();
 
+       void handle_done_event(int result);
        void handle_close_event(int result);
        void start_render();
 
index 3a5bdadeeb22e17f599c3562c862e3498b625d9d..28f149f351ff84f7830e8ed2035e975aa59f5800 100644 (file)
@@ -2842,7 +2842,6 @@ int TrackCanvas::do_float_autos(Track *track, Autos *autos, int cursor_x, int cu
        double view_start, unit_start;
        double view_end, unit_end, yscale;
        double zoom_sample, zoom_units;
-       double ax, ay, ax2, ay2, ax0, ay0;
        double in_x2, in_y2, out_x2, out_y2;
        double slope;
        //int skip = 0;
@@ -2857,25 +2856,24 @@ int TrackCanvas::do_float_autos(Track *track, Autos *autos, int cursor_x, int cu
 // Get first auto before start
        Auto *current = 0, *previous = 0;
 
-       ax0 = ay0 = -1;
        for( current = autos->last;
                current && current->position >= unit_start;
                current = PREVIOUS ) ;
 
-       if( !current ) {
-               current = autos->first ? autos->first : autos->default_auto;
-               ax0 = 0;
-       }
-       if( current ) {
+       Auto *first_auto = current ? current :
+                autos->first ? autos->first : autos->default_auto;
+
+       double ax = 0, ay = 0, ax2 = 0, ay2 = 0;
+       if( first_auto )
                calculate_auto_position(&ax, &ay, 0, 0, 0, 0,
-                       current, unit_start, zoom_units, yscale, autogrouptype);
-               if( ax0 < 0 ) current = NEXT;
-       }
-       else
-               ay0 = 0;
+                       first_auto, unit_start, zoom_units, yscale, autogrouptype);
 
-       if( ax0 >= 0 ) ax = ax0;
-       if( ay0 >= 0 ) ay = ay0;
+       if( current )
+               current = NEXT;
+       else {
+               current = autos->first;
+               ax = 0;
+       }
 
        do {
                //skip = 0;
@@ -2891,17 +2889,15 @@ int TrackCanvas::do_float_autos(Track *track, Autos *autos, int cursor_x, int cu
                        //skip = 1;
                }
 
-               slope = (ay2 - ay) / (ax2 - ax);
+               slope = ax2 > ax ? (ay2 - ay) / (ax2 - ax) : 0;
 
-               if(ax2 > get_w())
-               {
+               if(ax2 > get_w()) {
                        draw_auto = 0;
                        ax2 = get_w();
                        ay2 = ay + slope * (get_w() - ax);
                }
 
-               if(ax < 0)
-               {
+               if(ax < 0) {
                        ay = ay + slope * (0 - ax);
                        ax = 0;
                }