NOOP, remove trailing tabs/whitespace.
[ardour.git] / gtk2_ardour / engine_dialog.cc
index b8a95f176bf7c38b6f514d5bd693d8d7da73230e..61dbe22a7821e9a3e80e7cb8cb624175852e7fa1 100644 (file)
@@ -100,6 +100,7 @@ EngineControl::EngineControl ()
        , _desired_sample_rate (0)
        , started_at_least_once (false)
        , queue_device_changed (false)
+       , _have_control (true)
        , block_signals(0)
 {
        using namespace Notebook_Helpers;
@@ -414,10 +415,12 @@ EngineControl::on_response (int response_id)
 
        switch (response_id) {
                case RESPONSE_OK:
+                       if (push_state_to_backend (true) != 0) {
+                               return;
+                       } else {
+                               hide ();
+                       }
 #ifdef PLATFORM_WINDOWS
-                       // For some reason we don't understand, 'hide()'
-                       // needs to get called first in Windows
-                       hide ();
 
                        // But if there's no session open, this can produce
                        // a long gap when nothing appears to be happening.
@@ -429,13 +432,8 @@ EngineControl::on_response (int response_id)
                                        }
                                }
                        }
-                       push_state_to_backend (true);
-                       break;
-#else
-                       push_state_to_backend (true);
-                       hide ();
-                       break;
 #endif
+                       break;
                case RESPONSE_DELETE_EVENT:
                        {
                                GdkEventButton ev;
@@ -444,6 +442,11 @@ EngineControl::on_response (int response_id)
                                on_delete_event ((GdkEventAny*) &ev);
                                break;
                        }
+               case RESPONSE_CANCEL:
+                       if (ARDOUR_UI::instance() && ARDOUR_UI::instance()->session_loaded) {
+                               ARDOUR_UI::instance()->check_audioengine (*this);
+                       }
+                       // fall through
                default:
                        hide ();
        }
@@ -563,7 +566,7 @@ EngineControl::build_full_control_notebook ()
                basic_packer.attach (input_channels, 1, 2, row, row+1, xopt, (AttachOptions) 0);
                ++row;
        }
-       
+
        output_channels.set_name ("OutputChannels");
        output_channels.set_flags (Gtk::CAN_FOCUS);
        output_channels.set_digits (0);
@@ -576,7 +579,7 @@ EngineControl::build_full_control_notebook ()
                basic_packer.attach (output_channels, 1, 2, row, row+1, xopt, (AttachOptions) 0);
                ++row;
        }
-       
+
        input_latency.set_name ("InputLatency");
        input_latency.set_flags (Gtk::CAN_FOCUS);
        input_latency.set_digits (0);
@@ -950,7 +953,7 @@ EngineControl::backend_changed ()
        string backend_name = backend_combo.get_active_text();
        boost::shared_ptr<ARDOUR::AudioBackend> backend;
 
-       if (!(backend = ARDOUR::AudioEngine::instance()->set_backend (backend_name, downcase (PROGRAM_NAME), ""))) {
+       if (!(backend = ARDOUR::AudioEngine::instance()->set_backend (backend_name, downcase (std::string(PROGRAM_NAME)), ""))) {
                /* eh? setting the backend failed... how ? */
                /* A: stale config contains a backend that does not exist in current build */
                return;
@@ -1020,7 +1023,7 @@ EngineControl::print_channel_count (Gtk::SpinButton* sb)
        if (ARDOUR::Profile->get_mixbus()) {
                return true;
        }
-       
+
        uint32_t cnt = (uint32_t) sb->get_value();
        if (cnt == 0) {
                sb->set_text (_("all available channels"));
@@ -1430,7 +1433,7 @@ EngineControl::device_changed ()
                        queue_device_changed = true;
                }
        }
-       
+
        //the device name must be set FIRST so ASIO can populate buffersizes and the control panel button
        if (backend->use_separate_input_and_output_devices()) {
                backend->set_input_device_name (device_name_in);
@@ -1977,7 +1980,7 @@ EngineControl::set_current_state (const State& state)
        boost::shared_ptr<ARDOUR::AudioBackend> backend;
 
        if (!(backend = ARDOUR::AudioEngine::instance ()->set_backend (
-                 state->backend, downcase (PROGRAM_NAME), ""))) {
+                 state->backend, downcase (std::string(PROGRAM_NAME)), ""))) {
                DEBUG_ECONTROL (string_compose ("Unable to set backend to %1", state->backend));
                // this shouldn't happen as the invalid backend names should have been
                // removed from the list of states.