Oops - the previous namespace qualifier was also needed in gtk2_ardour/processor_box.cc
[ardour.git] / gtk2_ardour / engine_dialog.cc
index 7bab4659fbd9c6a11296f5980ffd2d778755b23e..8cd0473c085df0f866c1005b1667700463af3317 100644 (file)
@@ -87,7 +87,6 @@ EngineControl::EngineControl ()
        , midi_refresh_button (_("Refresh list"))
        , ignore_changes (0)
        , _desired_sample_rate (0)
-       , no_push (true)
        , started_at_least_once (false)
 {
        using namespace Notebook_Helpers;
@@ -290,8 +289,6 @@ EngineControl::EngineControl ()
        output_channels.signal_changed().connect (sigc::mem_fun (*this, &EngineControl::parameter_changed));
 
        notebook.signal_switch_page().connect (sigc::mem_fun (*this, &EngineControl::on_switch_page));
-
-       no_push = false;
  }
 
  void
@@ -330,6 +327,10 @@ EngineControl::EngineControl ()
         Gtkmm2ext::container_clear (basic_vbox);
         Gtkmm2ext::container_clear (basic_packer);
 
+        if (control_app_button.get_parent()) {
+                control_app_button.get_parent()->remove (control_app_button);
+        }
+
         label = manage (left_aligned_label (_("Audio System:")));
         basic_packer.attach (*label, 0, 1, 0, 1, xopt, (AttachOptions) 0);
         basic_packer.attach (backend_combo, 1, 2, 0, 1, xopt, (AttachOptions) 0);
@@ -822,7 +823,7 @@ EngineControl::EngineControl ()
                         set_popdown_strings (sample_rate_combo, s);
 
                         if (desired.empty()) {
-                                sample_rate_combo.set_active_text (s.front());
+                                sample_rate_combo.set_active_text (rate_as_string (backend->default_sample_rate()));
                         } else {
                                 sample_rate_combo.set_active_text (desired);
                         }
@@ -859,7 +860,7 @@ EngineControl::EngineControl ()
                         buffer_size_combo.set_sensitive (true);
                         set_popdown_strings (buffer_size_combo, s);
 
-                        buffer_size_combo.set_active_text (s.front());
+                        buffer_size_combo.set_active_text (bufsize_as_string (backend->default_buffer_size()));
                         show_buffer_duration ();
                 } else {
                         buffer_size_combo.set_sensitive (false);
@@ -874,10 +875,6 @@ EngineControl::EngineControl ()
         /* pick up any saved state for this device */
 
         maybe_display_saved_state ();
-
-        /* and push it to the backend */
-
-        push_state_to_backend (false);
  }     
 
  string
@@ -1207,14 +1204,9 @@ EngineControl::EngineControl ()
         }
  }
 
-
  int
  EngineControl::push_state_to_backend (bool start)
  {
-        if (no_push) {
-                return 0;
-        }
-
         boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend();
 
         if (!backend) {
@@ -1290,9 +1282,9 @@ EngineControl::EngineControl ()
                         /* backend never started, so we have to force a group
                            of settings.
                         */
-                        change_driver = true;
+                        change_device = true;
                         if (backend->requires_driver_selection()) {
-                                change_device = true;
+                                change_driver = true;
                         }
                         change_rate = true;
                         change_bufsize = true;