Fix track height, partial merge of recent 2.0 updates (speed up track resizing, fix...
authorNick Mainsbridge <beatroute@iprimus.com.au>
Wed, 17 Sep 2008 19:04:16 +0000 (19:04 +0000)
committerNick Mainsbridge <beatroute@iprimus.com.au>
Wed, 17 Sep 2008 19:04:16 +0000 (19:04 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@3744 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/automation_time_axis.cc
gtk2_ardour/editor.h
gtk2_ardour/editor_canvas.cc
gtk2_ardour/editor_route_list.cc
gtk2_ardour/editor_rulers.cc
gtk2_ardour/time_axis_view.cc
libs/ardour/analyser.cc
libs/ardour/ardour/export_status.h
libs/ardour/export_file_io.cc
libs/ardour/export_utilities.cc
libs/glibmm2/glib/glibmmconfig.h

index 47d0ebe61e698c10e697d122de22f2ecf8d4ae4d..bc371a5826e3a1090006a8360692fd59291398db 100644 (file)
@@ -444,6 +444,11 @@ AutomationTimeAxisView::set_height (uint32_t h)
                        clear_button.hide();
                        hide_button.hide();
                }
+       } else  if (h >= hNormal){
+                       auto_button.show();
+                       height_button.show();
+                       clear_button.show();
+                       hide_button.show_all();
        }
 
        if (changed) {
index 6385b37ef826dd20205fb436f88117a6d2b0c867..32de17a8a11bba32b5261b1546b9e20ce2da113c 100644 (file)
@@ -643,9 +643,6 @@ class Editor : public PublicEditor
        /** The group containing all items that require horizontal scrolling. */
        ArdourCanvas::Group* _master_group;
 
-       /** The group containiner marker bars */
-       ArdourCanvas::Group* _bar_group;
-
        /* The group containing all trackviews.  Only scrolled vertically. */
        ArdourCanvas::Group* _trackview_group;
        
index 51093f3bcfa6091bf9e54bc9be8f886a21f8db4b..b74ece99be09819f83bd2b9b9672a2b7d30a0623 100644 (file)
@@ -113,34 +113,6 @@ Editor::initialize_canvas ()
        track_canvas->set_center_scroll_region (false);
        track_canvas->set_dither (Gdk::RGB_DITHER_NONE);
 
-       /* need to handle 4 specific types of events as catch-alls */
-
-       track_canvas->signal_scroll_event().connect (mem_fun (*this, &Editor::track_canvas_scroll_event));
-       track_canvas->signal_motion_notify_event().connect (mem_fun (*this, &Editor::track_canvas_motion_notify_event));
-       track_canvas->signal_button_press_event().connect (mem_fun (*this, &Editor::track_canvas_button_press_event));
-       track_canvas->signal_button_release_event().connect (mem_fun (*this, &Editor::track_canvas_button_release_event));
-
-       track_canvas->set_name ("EditorMainCanvas");
-       track_canvas->add_events (Gdk::POINTER_MOTION_HINT_MASK|Gdk::SCROLL_MASK);
-       track_canvas->signal_leave_notify_event().connect (mem_fun(*this, &Editor::left_track_canvas));
-       track_canvas->signal_enter_notify_event().connect (mem_fun(*this, &Editor::entered_track_canvas));
-       track_canvas->set_flags (CAN_FOCUS);
-
-       /* set up drag-n-drop */
-
-       vector<TargetEntry> target_table;
-       
-       // Drag-N-Drop from the region list can generate this target
-       target_table.push_back (TargetEntry ("regions"));
-       target_table.push_back (TargetEntry ("routes"));
-
-       target_table.push_back (TargetEntry ("text/plain"));
-       target_table.push_back (TargetEntry ("text/uri-list"));
-       target_table.push_back (TargetEntry ("application/x-rootwin-drop"));
-
-       track_canvas->drag_dest_set (target_table);
-       track_canvas->signal_drag_data_received().connect (mem_fun(*this, &Editor::track_canvas_drag_data_received));
-
        /* stuff for the verbose canvas cursor */
 
        Pango::FontDescription* font = get_font_for_style (N_("VerboseCanvasCursor"));
@@ -163,52 +135,55 @@ Editor::initialize_canvas ()
                logo_item->show ();
        }
 
-       _master_group = new ArdourCanvas::Group (*track_canvas->root());
-       _bar_group = new ArdourCanvas::Group (*_master_group);
-       _trackview_group = new ArdourCanvas::Group (*_master_group);
-       _region_motion_group = new ArdourCanvas::Group (*_master_group);
+       _master_group = new ArdourCanvas::Group (*track_canvas->root(), 0.0, 0.0);
+
+       transport_loop_range_rect = new ArdourCanvas::SimpleRect (*_master_group, 0.0, 0.0, 0.0, 0.0);
+       transport_loop_range_rect->property_outline_pixels() = 1;
+       transport_loop_range_rect->hide();
+
+       /* a group to hold time (measure) lines */
+       time_line_group = new ArdourCanvas::Group (*_master_group, 0.0, 0.0);
+
+       _trackview_group = new ArdourCanvas::Group (*_master_group, 0.0, 0.0);
+       _region_motion_group = new ArdourCanvas::Group (*_master_group, 0.0, 0.0);
 
        /* el barrio */
 
-       meter_bar_group = new ArdourCanvas::Group (*_bar_group);
+       meter_bar_group = new ArdourCanvas::Group (*track_canvas->root());
        meter_bar = new ArdourCanvas::SimpleRect (*meter_bar_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
        meter_bar->property_outline_what() = (0x1 | 0x8);
        meter_bar->property_outline_pixels() = 1;
 
-       tempo_bar_group = new ArdourCanvas::Group (*_bar_group);
+       tempo_bar_group = new ArdourCanvas::Group (*track_canvas->root());
        tempo_bar = new ArdourCanvas::SimpleRect (*tempo_bar_group, 0.0, 0.0, max_canvas_coordinate, (timebar_height-1.0));
        tempo_bar->property_outline_what() = (0x1 | 0x8);
        tempo_bar->property_outline_pixels() = 1;
 
-       range_marker_bar_group = new ArdourCanvas::Group (*_bar_group);
+       range_marker_bar_group = new ArdourCanvas::Group (*track_canvas->root());
        range_marker_bar = new ArdourCanvas::SimpleRect (*range_marker_bar_group, 0.0, 0.0, max_canvas_coordinate, (timebar_height-1.0));
        range_marker_bar->property_outline_what() = (0x1 | 0x8);
        range_marker_bar->property_outline_pixels() = 1;
        
-       transport_marker_bar_group = new ArdourCanvas::Group (*_bar_group);
+       transport_marker_bar_group = new ArdourCanvas::Group (*track_canvas->root());
        transport_marker_bar = new ArdourCanvas::SimpleRect (*transport_marker_bar_group, 0.0, 0.0, max_canvas_coordinate, (timebar_height-1.0));
        transport_marker_bar->property_outline_what() = (0x1 | 0x8);
        transport_marker_bar->property_outline_pixels() = 1;
 
-       marker_bar_group = new ArdourCanvas::Group (*_bar_group);
+       marker_bar_group = new ArdourCanvas::Group (*track_canvas->root());
        marker_bar = new ArdourCanvas::SimpleRect (*marker_bar_group, 0.0, 0.0, max_canvas_coordinate, (timebar_height-1.0));
        marker_bar->property_outline_what() = (0x1 | 0x8);
        marker_bar->property_outline_pixels() = 1;
        
-       cd_marker_bar_group = new ArdourCanvas::Group (*_bar_group);
+       cd_marker_bar_group = new ArdourCanvas::Group (*track_canvas->root());
        cd_marker_bar = new ArdourCanvas::SimpleRect (*cd_marker_bar_group, 0.0, 0.0, max_canvas_coordinate, (timebar_height-1.0));
        cd_marker_bar->property_outline_what() = (0x1 | 0x8);
        cd_marker_bar->property_outline_pixels() = 1;
 
-       /* a group to hold time (measure) lines */
-       
-       time_line_group = new ArdourCanvas::Group(*_master_group, 0.0, 0.0);
-
        range_marker_drag_rect = new ArdourCanvas::SimpleRect (*time_line_group, 0.0, 0.0, 0.0, 0.0);
        //range_marker_drag_rect = new ArdourCanvas::SimpleRect (*_master_group, 0.0, 0.0, 0.0, 0.0);
        range_marker_drag_rect->hide ();
 
-       timebar_group =  new ArdourCanvas::Group (*_master_group);
+       timebar_group =  new ArdourCanvas::Group (*track_canvas->root());
        cursor_group = new ArdourCanvas::Group (*track_canvas->root(), 0.0, 0.0);
 
        meter_group = new ArdourCanvas::Group (*timebar_group, 0.0, timebar_height * 5.0);
@@ -237,21 +212,11 @@ Editor::initialize_canvas ()
        transport_bar_drag_rect->property_outline_pixels() = 0;
        transport_bar_drag_rect->hide ();
 
-       transport_loop_range_rect = new ArdourCanvas::SimpleRect (*_master_group, 0.0, 0.0, 0.0, 0.0);
-       transport_loop_range_rect->property_outline_pixels() = 1;
-       transport_loop_range_rect->hide();
-
        transport_punch_range_rect = new ArdourCanvas::SimpleRect (*_master_group, 0.0, 0.0, 0.0, 0.0);
        transport_punch_range_rect->property_outline_pixels() = 0;
        transport_punch_range_rect->hide();
        
-       transport_loop_range_rect->lower_to_bottom (); // loop on the bottom
-       
-       time_line_group->lower_to_bottom();
-       _trackview_group->raise_to_top();
-       _bar_group->raise_to_top();
-       timebar_group->raise_to_top();
-       timebar_group->raise(1);
+//     transport_loop_range_rect->lower_to_bottom (); // loop on the bottom
 
        transport_punchin_line = new ArdourCanvas::SimpleLine (*_master_group);
        transport_punchin_line->property_x1() = 0.0;
@@ -293,12 +258,41 @@ Editor::initialize_canvas ()
        playhead_cursor = new Cursor (*this, &Editor::canvas_playhead_cursor_event);
 
        initial_ruler_update_required = true;
-       track_canvas->signal_size_allocate().connect (mem_fun(*this, &Editor::track_canvas_allocate));
 
        if (logo_item) {
                logo_item->lower_to_bottom ();
        }
 
+       /* need to handle 4 specific types of events as catch-alls */
+
+       track_canvas->signal_scroll_event().connect (mem_fun (*this, &Editor::track_canvas_scroll_event));
+       track_canvas->signal_motion_notify_event().connect (mem_fun (*this, &Editor::track_canvas_motion_notify_event));
+       track_canvas->signal_button_press_event().connect (mem_fun (*this, &Editor::track_canvas_button_press_event));
+       track_canvas->signal_button_release_event().connect (mem_fun (*this, &Editor::track_canvas_button_release_event));
+
+       track_canvas->set_name ("EditorMainCanvas");
+       track_canvas->add_events (Gdk::POINTER_MOTION_HINT_MASK|Gdk::SCROLL_MASK);
+       track_canvas->signal_leave_notify_event().connect (mem_fun(*this, &Editor::left_track_canvas));
+       track_canvas->signal_enter_notify_event().connect (mem_fun(*this, &Editor::entered_track_canvas));
+       track_canvas->set_flags (CAN_FOCUS);
+
+       /* set up drag-n-drop */
+
+       vector<TargetEntry> target_table;
+       
+       // Drag-N-Drop from the region list can generate this target
+       target_table.push_back (TargetEntry ("regions"));
+       target_table.push_back (TargetEntry ("routes"));
+
+       target_table.push_back (TargetEntry ("text/plain"));
+       target_table.push_back (TargetEntry ("text/uri-list"));
+       target_table.push_back (TargetEntry ("application/x-rootwin-drop"));
+
+       track_canvas->drag_dest_set (target_table);
+       track_canvas->signal_drag_data_received().connect (mem_fun(*this, &Editor::track_canvas_drag_data_received));
+
+       track_canvas->signal_size_allocate().connect (mem_fun(*this, &Editor::track_canvas_allocate));
+
        ColorsChanged.connect (mem_fun (*this, &Editor::color_handler));
        color_handler();
 
@@ -407,32 +401,30 @@ Editor::controls_layout_size_request (Requisition* req)
                screen = Gdk::Screen::get_default();
        }
 
-       edit_controls_vbox.check_resize();
-       req->width = max (edit_controls_vbox.get_width(),  controls_layout.get_width());
+       gint width = max (edit_controls_vbox.get_width(),  controls_layout.get_width());
 
        /* don't get too big. the fudge factors here are just guesses */
-       
-       req->width = min (req->width, screen->get_width() - 300);
-       req->height = min ((gint) pos, (screen->get_height() - 400));
 
-       /* this one is important: it determines how big the layout thinks it really is, as 
-          opposed to what it displays on the screen
-       */
-       
-       controls_layout.set_size (edit_controls_vbox.get_width(), (gint) pos);
-       controls_layout.set_size_request(edit_controls_vbox.get_width(), -1);
-       zoom_box.set_size_request(edit_controls_vbox.get_width(), -1);
-       time_button_event_box.set_size_request(edit_controls_vbox.get_width(), -1);
-
-       if ((vertical_adjustment.get_value() + canvas_height) >= vertical_adjustment.get_upper()) {
-               /* 
-                  We're increasing the size of the canvas while the bottom is visible.
-                  We scroll down to keep in step with the controls layout.
+       width =  min (width, screen->get_width() - 300);
+
+       if (req->width != width) {
+               req->width = width;
+       }
+
+       gint height = min ( (gint) pos, (screen->get_height() - 400));
+       if (req->height != height) {
+               req->height = height;
+       }
+
+       if ((width != edit_controls_vbox.get_width()) || height !=  pos) {
+
+               /* this one is important: it determines how big the layout thinks it really is, as 
+                  opposed to what it displays on the screen
                */
-               vertical_adjustment.set_upper (pos + canvas_timebars_vsize);
-               vertical_adjustment.set_value (pos + canvas_timebars_vsize - canvas_height);
-       } else {
-               vertical_adjustment.set_upper (pos + canvas_timebars_vsize);
+               controls_layout.set_size (edit_controls_vbox.get_width(), pos );
+               controls_layout.set_size_request(edit_controls_vbox.get_width(), -1);
+               time_button_event_box.set_size_request(edit_controls_vbox.get_width(), -1);
+               zoom_box.set_size_request(edit_controls_vbox.get_width(), -1);
        }
 }
 
index 64e6660a5ad51cd58d5e85132ed394fd3865a8b1..f2b8456fd9b3a58a7f292bb830ef2d719a39c11f 100644 (file)
@@ -150,10 +150,10 @@ Editor::handle_gui_changes (const string & what, void *src)
        ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::handle_gui_changes), what, src));
        
        if (what == "track_height") {
-               /* make tracks change height while it happens, instead 
+               /* Optional :make tracks change height while it happens, instead 
                   of on first-idle
                */
-               track_canvas->update_now ();
+               //track_canvas->update_now ();
                redisplay_route_list ();
        }
 
@@ -364,11 +364,14 @@ Editor::redisplay_route_list ()
 
        full_canvas_height = position;
 
-       /* make sure the cursors stay on top of every newly added track */
-
-       cursor_group->raise_to_top ();
-
-       //reset_scrolling_region ();
+       vertical_adjustment.set_upper (position + canvas_timebars_vsize);
+       if ((vertical_adjustment.get_value() + canvas_height) > vertical_adjustment.get_upper()) {
+               /* 
+                  We're increasing the size of the canvas while the bottom is visible.
+                  We scroll down to keep in step with the controls layout.
+               */
+               vertical_adjustment.set_value (position + canvas_timebars_vsize - canvas_height);
+       } 
 
        if (Config->get_sync_all_route_ordering() && !ignore_route_list_reorder) {
                ignore_route_order_sync = true;
index 47ea8d01a093c43b0967076550b7c69e3da02118..30a1ac992bcd989bd7dbc9e9a8430de7077849b5 100644 (file)
@@ -90,6 +90,7 @@ Editor::initialize_rulers ()
 
        visible_timebars = 1; /*this will be changed below */
        ruler_pressed_button = 0;
+       canvas_timebars_vsize = 0;
 }
 
 bool
index f1d5eb1c67e77fc3014b468c97f8df75267ad1e6..d852fc1277cf2229bac4ec0798916eb7e46a4e7c 100644 (file)
@@ -224,53 +224,55 @@ TimeAxisView::~TimeAxisView()
 guint32
 TimeAxisView::show_at (double y, int& nth, VBox *parent)
 {
-       gdouble ix1, ix2, iy1, iy2;
-       effective_height = 0;
-       
        if (control_parent) {
                control_parent->reorder_child (controls_hbox, nth);
-       } else {
+       } else {        
                control_parent = parent;
                parent->pack_start (controls_hbox, false, false);
                parent->reorder_child (controls_hbox, nth);
        }
-       //controls_frame.show ();
-       controls_hbox.show ();
-       controls_ebox.show ();
-       
-       /* the coordinates used here are in the system of the
-          item's parent ...
-       */
 
-       canvas_display->get_bounds (ix1, iy1, ix2, iy2);
-       iy1 += editor.get_trackview_group_vertical_offset ();
-       Group* pg = canvas_display->property_parent();
-       pg->i2w (ix1, iy1);
+       order = nth;
+
+       if (y_position != y) {
+               /* the coordinates used here are in the system of the
+                  item's parent ...
+               */
+               canvas_display->property_y () = y;
+//             canvas_display->move (0.0, 0.0);
+
+               Group* pg;
+               double ix1, iy1, ix2, iy2;
+               canvas_display->get_bounds (ix1, iy1, ix2, iy2);
+               iy1 += editor.get_trackview_group_vertical_offset ();
+               pg = canvas_display->property_parent();
+               pg->i2w (ix1, iy1);
+               
+               if (iy1 < 0) {
+                       iy1 = 0;
+               }
+
+               canvas_display->move (0.0, y - iy1);
+
+               y_position = y;
 
-       if (iy1 < 0) {
-               iy1 = 0;
        }
 
-       canvas_display->move (0.0, y - iy1);
-       canvas_display->show();/* XXX not necessary */
-       y_position = y;
-       order = nth;
-       _hidden = false;
-       
-       /* height in pixels depends on _order, so update it now we've changed _order */
+       canvas_display->raise_to_top ();
 
-       set_height (height);
+       if (_marked_for_display) {
+               canvas_display->show();
+               controls_hbox.show ();
+               controls_ebox.show ();
+       }
 
+       _hidden = false;
+       
        effective_height = current_height();
 
        /* now show children */
        
        for (Children::iterator i = children.begin(); i != children.end(); ++i) {
-               
-               if ((*i)->marked_for_display()) {
-                       (*i)->canvas_display->show();
-               }
-               
                if (canvas_item_visible ((*i)->canvas_display)) {
                        ++nth;
                        effective_height += (*i)->show_at (y + effective_height, nth, parent);
@@ -391,6 +393,7 @@ TimeAxisView::set_heights (uint32_t h)
 void
 TimeAxisView::set_height(uint32_t h)
 {
+       controls_ebox.property_height_request () = h;
        height = h;
 
        for (list<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
@@ -1046,7 +1049,7 @@ TimeAxisView::compute_controls_size_info ()
        Gtk::Table one_row_table (1, 8);
        Button* buttons[5];
        const int border_width = 2;
-       const int extra_height = (2 * border_width) 
+       const int extra_height = (2 * border_width); 
                + 2   // 2 pixels for the hseparator between TimeAxisView control areas
                + 10; // resizer button (3 x 2 pixel elements + 2 x 2 pixel gaps)
 
index 2e14c74b86e267016340b9d7764e5f41c33b3694..823d425bcfd12690cf758491fbe174b51401e125 100644 (file)
@@ -16,6 +16,7 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 */
+#include <cassert>
 
 #include <ardour/analyser.h>
 #include <ardour/audiofilesource.h>
index f207268155a48e608524b88af7489c3942892a41..210e9585a4ebce6468a4f8fc62bb4fd1954fe4a8 100644 (file)
@@ -24,6 +24,7 @@
 #include <list>
 #include <stdint.h>
 
+#include <stdint.h>
 #include <sigc++/signal.h>
 
 namespace ARDOUR
index 7da6e8a60c881ab51cd71894276ef2eacaf825ec..d4e871075995e806a4e23fa87d7f56e0178b08ff 100644 (file)
@@ -17,6 +17,7 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 */
+#include <cstring>
 
 #include <string.h>
 
index 64fa62ded5df91cec2c7d381e1e5f6df2a930199..bd6677e3631b0e7116400cb15befb46945973d47 100644 (file)
@@ -29,6 +29,7 @@
 #include <cstdlib>
 #undef  __USE_SVID
 
+#include <cstring>
 #include <unistd.h>
 #include <inttypes.h>
 #include <float.h>
index 140cc376afb3a11ce6f1372512f68f90f190410e..4e4bfa308f1b44e428741fc9b5ae5c1900e365ff 100644 (file)
@@ -1,4 +1,4 @@
-/* glib/glibmmconfig.h.  Generated by configure.  */
+/* glib/glibmmconfig.h.  Generated from glibmmconfig.h.in by configure.  */
 #ifndef _GLIBMM_CONFIG_H
 #define _GLIBMM_CONFIG_H 1
 
@@ -78,7 +78,7 @@
 #ifdef GLIBMM_DLL
   #if defined(GLIBMM_BUILD) && defined(_WINDLL)
     /* Do not dllexport as it is handled by gendef on MSVC */
-    #define GLIBMM_API
+    #define GLIBMM_API 
   #elif !defined(GLIBMM_BUILD)
     #define GLIBMM_API __declspec(dllimport)
   #else