Credit Andrew - fix vorbis audio which was scratchy and ensure aging plugin does...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / trackcanvas.h
index 88d764160922b615b28eeb18be04d9e252d5621a..7fa89832ff939d7bd03d7e8c3cc070f0182a341c 100644 (file)
@@ -2,6 +2,7 @@
 /*
  * CINELERRA
  * Copyright (C) 2008-2014 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2003-2016 Cinelerra CV contributors
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -62,6 +63,19 @@ public:
        int drag_start_event();
        int cursor_leave_event();
        int keypress_event();
+
+// *** CONTEXT_HELP ***
+       int help_transitions(int cursor_x, int cursor_y);
+       int help_transition_handles(int cursor_x, int cursor_y);
+       int help_keyframes(int cursor_x, int cursor_y);
+       int help_edit_handles(int cursor_x, int cursor_y);
+       int help_plugin_handles(int cursor_x, int cursor_y);
+       int help_plugins(int cursor_x, int cursor_y);
+       int help_plugin_autos(Track *track, int cursor_x, int cursor_y);
+       int help_autos(Track *track, Autos *autos, int cursor_x, int cursor_y, BC_Pixmap *pixmap);
+       int help_float_autos(Track *track, Autos *autos, int cursor_x, int cursor_y, int autogrouptype);
+       int help_int_autos(Track *track, Autos *autos, int cursor_x, int cursor_y);
+
        void draw_resources(int mode = 0,
                int indexes_only = 0,     // Redraw only certain audio resources with indexes
                Indexable *indexable = 0);
@@ -71,6 +85,8 @@ public:
        void draw_highlighting();
        void draw_keyframe_reticle();
        int draw_hairline(Auto *auto_keyframe, int color, int show);
+       void draw_speed_highlight();
+       void draw_speed_track(Track *track);
 
 // User can either call draw or draw_overlays to copy a fresh
 // canvas and just draw the overlays over it
@@ -99,41 +115,18 @@ public:
        void draw_automation();
        void draw_hard_edges();
        void draw_inout_points();
-       void draw_auto(Auto *current,
-               int x,
-               int y,
-               int center_pixel,
-               int zoom_track);
+       void draw_auto(Auto *current, int x, int y,
+               int center_pixel, int data_h);
        void draw_floatauto(FloatAuto *current,
-               int x,
-               int y,
-               int in_x,
-               int in_y,
-               int out_x,
-               int out_y,
-               int center_pixel,
-               int zoom_track,
-               int color);
-       int test_auto(Auto *current,
-               int x,
-               int y,
-               int center_pixel,
-               int zoom_track,
-               int cursor_x,
-               int cursor_y,
-               int buttonpress);
-       int test_floatauto(FloatAuto *current,
-               int x,
-               int y,
-               int in_x,
-               int in_y,
-               int out_x,
-               int out_y,
-               int center_pixel,
-               int zoom_track,
-               int cursor_x,
-               int cursor_y,
-               int buttonpress,
+               int x_offset, int center_pixel, int data_h, int color,
+               double unit_start, double zoom_units, double yscale,
+               int autogrouptype);
+       int test_auto(Auto *current, int x, int y,
+               int center_pixel, int data_h,
+               int cursor_x, int cursor_y, int buttonpress);
+       int test_floatauto(FloatAuto *current, int buttonpress,
+               int center_pixel, int data_h, int cursor_x, int cursor_y,
+               double unit_start, double zoom_units, double yscale,
                int autogrouptype);
        void draw_floatline(int center_pixel,
                FloatAuto *previous,
@@ -235,24 +228,13 @@ public:
 // if reference is nonzero and a FloatAuto,
 //     the result is made relative to the value in reference.
        float percentage_to_value(float percentage,
-               int is_toggle,
-               Auto *reference,
-               int autogrouptype);
-
+               int is_toggle, Auto *reference, int autogrouptype);
 // Get x and y of a FloatAuto relative to center_pixel
-       void calculate_auto_position(double *x,
-               double *y,
-               double *in_x,
-               double *in_y,
-               double *out_x,
-               double *out_y,
-               Auto *current,
-               double unit_start,
-               double zoom_units,
-               double yscale,
-               int autogrouptype);
-
-       void fill_ganged_autos(int all, float change, Track *skip, FloatAuto *fauto);
+       void calculate_auto_position(int edge, double *x, double *y,
+               double *in_x, double *in_y, double *out_x, double *out_y,
+               Auto *current, double unit_start, double zoom_units,
+               double yscale, int autogrouptype);
+       void fill_ganged_autos(int gang, float change, Track *skip, FloatAuto *fauto);
        void update_ganged_autos(float change, Track *skip, FloatAuto *fauto);
        void clear_ganged_autos();
 
@@ -277,53 +259,33 @@ public:
        void get_pixmap_size(Edit *edit, int64_t edit_x, int64_t edit_w, int64_t &pixmap_x, int64_t &pixmap_w, int64_t &pixmap_h);
        ResourcePixmap* create_pixmap(Edit *edit, int64_t edit_x, int64_t pixmap_x, int64_t pixmap_w, int64_t pixmap_h);
        void update_cursor(int flush);
+       void draw_selected(int x, int y, int w, int h);
+       int arrow_mode();
+       int ibeam_mode();
+
 // Get edit and handle the cursor is over
-       int do_edit_handles(int cursor_x,
-               int cursor_y,
-               int button_press,
-               int &rerender,
-               int &update_overlay,
-               int &new_cursor,
-               int &update_cursor);
+       int do_edit_handles(int cursor_x, int cursor_y, int button_press,
+               int &rerender, int &update_overlay, int &new_cursor, int &update_cursor);
 // Get plugin and handle the cursor if over
-       int do_plugin_handles(int cursor_x,
-               int cursor_y,
-               int button_press,
-               int &rerender,
-               int &update_overlay,
-               int &new_cursor,
-               int &update_cursor);
+       int do_plugin_handles(int cursor_x, int cursor_y, int button_press,
+               int &rerender, int &update_overlay, int &new_cursor, int &update_cursor);
+       int do_transition_handles(int cursor_x, int cursor_y, int button_press,
+               int &rerender, int &update_overlay, int &new_cursor, int &update_cursor);
+       int drag_transition_handle(double position);
 // Get edit the cursor is over
-       int do_edits(int cursor_x,
-               int cursor_y,
-               int button_press,
-               int drag_start,
-               int &redraw,
-               int &rerender,
-               int &new_cursor,
-               int &update_cursor);
+       int do_edits(int cursor_x, int cursor_y, int button_press,
+               int drag_start, int &redraw, int &rerender, int &new_cursor, int &update_cursor);
        int do_tracks(int cursor_x,
                int cursor_y,
                int button_press);
-       int test_track_group(EDL *group, Track *first_track);
+       int test_track_group(EDL *group, Track *first_track, double &pos);
+       int edit_intersects(Track *track, Edit *src_edit, double &pos);
        int test_resources(int cursor_x, int cursor_y);
-       int do_plugins(int cursor_x,
-               int cursor_y,
-               int drag_start,
-               int button_press,
-               int &redraw,
-               int &rerender);
-       int do_transitions(int cursor_x,
-               int cursor_y,
-               int button_press,
-               int &new_cursor,
-               int &update_cursor);
-       void draw_cropped_line(int x1,
-               int y1,
-               int x2,
-               int y2,
-               int min_y,
-               int max_y);
+       int do_plugins(int cursor_x, int cursor_y, int drag_start, int button_press,
+               int &redraw, int &rerender);
+       int do_transitions(int cursor_x, int cursor_y, int button_press,
+               int &new_cursor, int &update_cursor);
+       void draw_cropped_line(int x1, int y1, int x2, int y2, int min_y, int max_y);
        int button_press_event();
        int button_release_event();
        int cursor_update(int in_motion);
@@ -346,6 +308,7 @@ public:
        int64_t drop_plugin_position(PluginSet *plugin_set, Plugin *moved_plugin);
        void end_edithandle_selection();
        void end_pluginhandle_selection();
+       void end_transnhandle_selection();
 // Number of seconds spanned by the trackcanvas
        double time_visible();
        void update_drag_handle();
@@ -355,13 +318,13 @@ public:
        int update_drag_toggleauto(int cursor_x, int cursor_y);
        int update_drag_auto(int cursor_x, int cursor_y);
        int update_drag_pluginauto(int cursor_x, int cursor_y);
-       void show_message(Auto *current, int show_curve_type, const char *fmt, ...);
+       void show_message(Auto *current, int box_color, const char *fmt, ...);
 
 // Update status bar to reflect drag operation
        void update_drag_caption();
+       void drag_edit_select(Edit *over_edit, int select, int draw);
 
        int get_title_h();
-       int resource_h();
 
 // Display hourglass if timer expired
        void test_timer();