color coded keyframe curves, keyframe popups, cwin scrollbar fixes
[goodguy/history.git] / cinelerra-5.1 / cinelerra / trackcanvas.C
index 1c2c50fc6d36bc8f4fefaa4ae64f7efb839c90c3..2e21511e31aad2d68ac5bf6d1908607259c78b21 100644 (file)
@@ -38,6 +38,7 @@
 #include "edlsession.h"
 #include "floatauto.h"
 #include "floatautos.h"
+#include "gwindowgui.h"
 #include "indexstate.h"
 #include "intauto.h"
 #include "intautos.h"
@@ -1868,24 +1869,8 @@ void TrackCanvas::draw_brender_start()
        }
 }
 
-static int auto_colors[AUTOMATION_TOTAL] =
-{
-       BLUE,
-       RED,
-       GREEN,
-       BLUE,
-       RED,
-       GREEN,
-       BLUE,
-       WHITE,
-       0,
-       0,
-       0,
-       WHITE
-};
-
 // The operations which correspond to each automation type
-static int auto_operations[AUTOMATION_TOTAL] =
+int TrackCanvas::auto_operations[AUTOMATION_TOTAL] =
 {
        DRAG_MUTE,
        DRAG_CAMERA_X,
@@ -1990,8 +1975,8 @@ int TrackCanvas::do_keyframes(int cursor_x,
                                                                auto_keyframe, grouptype);
 
                                                result = do_float_autos(track, autos,
-                                                       cursor_x, cursor_y, draw, 
-                                                       buttonpress, 0, 0, auto_colors[i],
+                                                       cursor_x, cursor_y, draw, buttonpress,
+                                                       0, 0, GWindowGUI::auto_colors[i],
                                                        auto_keyframe, grouptype);
                                                break; }
 
@@ -2002,8 +1987,8 @@ int TrackCanvas::do_keyframes(int cursor_x,
                                                                buttonpress, 1, 1, MDGREY,
                                                                auto_keyframe);
                                                result = do_int_autos(track, autos,
-                                                       cursor_x, cursor_y, draw, 
-                                                       buttonpress, 0, 0, auto_colors[i],
+                                                       cursor_x, cursor_y, draw, buttonpress,
+                                                       0, 0, GWindowGUI::auto_colors[i],
                                                        auto_keyframe);
                                                break; }
                                        }
@@ -4217,11 +4202,7 @@ int TrackCanvas::button_release_event()
 
 
                default:
-                       if( !mwindow->session->current_operation ) {
-                               if( get_buttonpress() == 3 )
-                                       result = do_edit_popup();
-                       }
-                       else {
+                       if(mwindow->session->current_operation) {
 //                             if(mwindow->session->current_operation == SELECT_REGION) {
 //                                     mwindow->undo->update_undo_after(_("select"), LOAD_SESSION, 0, 0);
 //                             }
@@ -4392,14 +4373,9 @@ int TrackCanvas::do_plugin_handles(int cursor_x,
 
 
 int TrackCanvas::do_tracks(int cursor_x, int cursor_y, int button_press)
-{
-       return 0;
-}
-
-int TrackCanvas::do_edit_popup()
 {
        int result = 0;
-       int cursor_y = get_cursor_y();
+
 //     if(!mwindow->edl->session->show_assets) return 0;
 
        for(Track *track = mwindow->edl->tracks->first;
@@ -4408,7 +4384,8 @@ int TrackCanvas::do_edit_popup()
                int64_t track_x, track_y, track_w, track_h;
                track_dimensions(track, track_x, track_y, track_w, track_h);
 
-               if( cursor_y >= track_y && cursor_y < track_y + track_h ) {
+               if(button_press && get_buttonpress() == 3 &&
+                       cursor_y >= track_y && cursor_y < track_y + track_h) {
                        gui->edit_menu->update(track, 0);
                        gui->edit_menu->activate_menu();
                        result = 1;