Index: gtk2_ardour/editing.h =================================================================== --- gtk2_ardour/editing.h (revision 1640) +++ gtk2_ardour/editing.h (working copy) @@ -15,6 +15,19 @@ #define DISPLAYCONTROL(a) /*empty*/ #define IMPORTMODE(a) /*empty*/ +// compile time switch +#define OSC_CANVAS + +#ifdef OSC_CANVAS +# include +// this is a placeholder for OSC config chars.. +# define OSC_CANVAS_HOST "localhost" +# define OSC_CANVAS_PORT "5280" +# define OSC_CANVAS_CMDC "/ardour2/info/canvas" +// ..and a boolean or int to en/disable during runtime +# define OSC_CANVAS_TX 1 +#endif + namespace Editing { // SNAPTYPE Index: gtk2_ardour/editor_canvas.cc =================================================================== --- gtk2_ardour/editor_canvas.cc (revision 1640) +++ gtk2_ardour/editor_canvas.cc (working copy) @@ -724,5 +724,13 @@ update_fixed_rulers (); tempo_map_changed (Change (0), !_dragging_hscrollbar); +#ifdef OSC_CANVAS + //printf("DEBUG: hscroll! %lu %lu\n",(long unsigned) leftmost_frame,(long unsigned) rightmost_frame); + if (OSC_CANVAS_TX) { + lo_address a= lo_address_new (OSC_CANVAS_HOST, OSC_CANVAS_PORT); + lo_send(a, OSC_CANVAS_CMDC, "ii", (unsigned long) leftmost_frame, (unsigned long) rightmost_frame); + lo_address_free(a); + } +#endif } Index: gtk2_ardour/editor.cc =================================================================== --- gtk2_ardour/editor.cc (revision 1640) +++ gtk2_ardour/editor.cc (working copy) @@ -3669,6 +3669,16 @@ } } +#ifdef OSC_CANVAS + nframes_t my_leftmost_frame = (nframes_t) floor (horizontal_adjustment.get_value() * frames_per_unit); + nframes_t my_rightmost_frame = leftmost_frame + current_page_frames (); + //printf("DEBUG: zoom: %lu %lu\n",(long unsigned) my_leftmost_frame,(long unsigned) my_rightmost_frame); + if (OSC_CANVAS_TX) { + lo_address a= lo_address_new (OSC_CANVAS_HOST, OSC_CANVAS_PORT); + lo_send(a, OSC_CANVAS_CMDC, "ii", (unsigned long) my_leftmost_frame, (unsigned long) my_rightmost_frame); + lo_address_free(a); + } +#endif return 0; }