sometimes, you just have to do what a windows programmer would do. add a global signa...
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 12 Dec 2012 18:59:47 +0000 (18:59 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 12 Dec 2012 18:59:47 +0000 (18:59 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@13650 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour_ui.cc
libs/ardour/ardour/ardour.h
libs/ardour/globals.cc
libs/ardour/session.cc

index c144c930b3720830119819fb7a084621cdf63ca1..8d672e0f70eb69ae42b714544e724174da9923eb 100644 (file)
@@ -325,6 +325,8 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
        _process_thread->init ();
 
        DPIReset.connect (sigc::mem_fun (*this, &ARDOUR_UI::resize_text_widgets));
+
+       ARDOUR::GUIIdle.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&Gtkmm2ext::UI::flush_pending, this), gui_context());
 }
 
 int
@@ -3148,16 +3150,6 @@ ARDOUR_UI::add_route (Gtk::Window* float_window)
                return;
        }
 
-       if (count > 8) {
-               /* 8 is arbitrary - we just need a threshold for where
-                  we start caring that this operation might take
-                  a long time
-               */
-               flush_pending();
-               flush_pending();
-               flush_pending();
-       }
-       
        string template_path = add_route_dialog->track_template();
 
        if (!template_path.empty()) {
@@ -3170,7 +3162,6 @@ ARDOUR_UI::add_route (Gtk::Window* float_window)
        string name_template = add_route_dialog->name_template ();
        PluginInfoPtr instrument = add_route_dialog->requested_instrument ();
        RouteGroup* route_group = add_route_dialog->route_group ();
-
        AutoConnectOption oac = Config->get_output_auto_connect();
 
        if (oac & AutoConnectMaster) {
index c19d4332e8dd5356513d949f6ce404e1b131582e..03de3965ec9f82251df3cb0abb224f03052eda8a 100644 (file)
@@ -48,6 +48,7 @@ namespace ARDOUR {
        class AudioEngine;
 
        extern PBD::Signal1<void,std::string> BootMessage;
+       extern PBD::Signal0<void> GUIIdle;
 
        int init (bool with_vst, bool try_optimization);
        void init_post_engine ();
index 085dfc8e5906345d25cd5274cac2f31f9e3b8cb0..2b0bc0553441e2d5fccd3e892dc99ad4d492bad3 100644 (file)
@@ -113,6 +113,7 @@ mix_buffers_with_gain_t ARDOUR::mix_buffers_with_gain = 0;
 mix_buffers_no_gain_t   ARDOUR::mix_buffers_no_gain = 0;
 
 PBD::Signal1<void,std::string> ARDOUR::BootMessage;
+PBD::Signal0<void> ARDOUR::GUIIdle;
 
 namespace ARDOUR {
 extern void setup_enum_writer ();
index ccf4cb2b86ebd767ed45786af8bb234b1b48cf0d..3b46ad3be14258a6fd9d06b424ca4cc4a80d90cf 100644 (file)
@@ -2012,6 +2012,8 @@ Session::new_audio_route (int input_channels, int output_channels, RouteGroup* r
                        bus->add_internal_return ();
 
                        ret.push_back (bus);
+                       
+                       ARDOUR::GUIIdle ();
                }
 
 
@@ -2242,6 +2244,8 @@ Session::add_routes_inner (RouteList& new_routes, bool input_auto_connect, bool
                                order++;
                        }
                }
+
+               ARDOUR::GUIIdle ();
        }
 
        if (_monitor_out && IO::connecting_legal) {