diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-09-16 22:13:39 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-09-16 22:13:39 +0000 |
commit | 1cd155a7287f662db0548a870d3b5de1a5f40969 (patch) | |
tree | 9f1cace9884595333cf227b1e8ca78b6924f9a30 | |
parent | 5cfbd2f7c0a2c87cd7db1eec1f164d696418ee3b (diff) |
first part of NSD changes - if no interface has been identified previously, put the audio setup tab as the first tab of the NSD
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5669 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/engine_dialog.cc | 16 | ||||
-rw-r--r-- | gtk2_ardour/engine_dialog.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/new_session_dialog.cc | 7 |
3 files changed, 21 insertions, 4 deletions
diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index 22dd1e39fd..90151fb85d 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -73,6 +73,7 @@ EngineControl::EngineControl () int row = 0; _used = false; + _interface_chosen = false; strings.push_back (_("8000Hz")); strings.push_back (_("22050Hz")); @@ -501,6 +502,7 @@ EngineControl::build_command_line (vector<string>& cmd) cmd.push_back ("-d"); cmd.push_back (device); + _interface_chosen = true; } if (hw_meter_button.get_active()) { @@ -1173,16 +1175,21 @@ EngineControl::set_state (const XMLNode& root) clist = root.children(); for (citer = clist.begin(); citer != clist.end(); ++citer) { - if ( prop && (prop->value() == "FFADO" )) - continue; + + if (prop && (prop->value() == "FFADO" )) { + continue; + } + child = *citer; prop = child->property ("val"); if (!prop || prop->value().empty()) { - if ( using_dummy && ( child->name() == "interface" || child->name() == "inputdevice" || child->name() == "outputdevice" )) + if (using_dummy && ( child->name() == "interface" || child->name() == "inputdevice" || child->name() == "outputdevice" )) { continue; + } + error << string_compose (_("AudioSetup value for %1 is missing data"), child->name()) << endmsg; continue; } @@ -1282,6 +1289,9 @@ EngineControl::set_state (const XMLNode& root) driver_combo.set_active_text(strval); } else if (child->name() == "interface") { interface_combo.set_active_text(strval); + if (!strval.empty()) { + _interface_chosen = true; + } } else if (child->name() == "timeout") { timeout_combo.set_active_text(strval); } else if (child->name() == "dither") { diff --git a/gtk2_ardour/engine_dialog.h b/gtk2_ardour/engine_dialog.h index 3a2138e4cc..c439719d75 100644 --- a/gtk2_ardour/engine_dialog.h +++ b/gtk2_ardour/engine_dialog.h @@ -24,6 +24,7 @@ class EngineControl : public Gtk::VBox { int setup_engine (); void discover_servers (); + bool interface_chosen () const { return _interface_chosen; } bool was_used() const { return _used; } XMLNode& get_state (); void set_state (const XMLNode&); @@ -77,6 +78,7 @@ class EngineControl : public Gtk::VBox { Gtk::Notebook notebook; bool _used; + bool _interface_chosen; void realtime_changed (); void driver_changed (); diff --git a/gtk2_ardour/new_session_dialog.cc b/gtk2_ardour/new_session_dialog.cc index f7634c8458..b094e3a635 100644 --- a/gtk2_ardour/new_session_dialog.cc +++ b/gtk2_ardour/new_session_dialog.cc @@ -495,7 +495,12 @@ NewSessionDialog::set_have_engine (bool yn) } else { if (!(page_set & EnginePage)) { engine_control.discover_servers (); - m_notebook->append_page (engine_control, _("Audio Setup")); + if (engine_control.interface_chosen()) { + m_notebook->append_page (engine_control, _("Audio Setup")); + } else { + /* no interface ever selected - make it the first page */ + m_notebook->prepend_page (engine_control, _("Audio Setup")); + } m_notebook->show_all_children(); page_set = Pages (page_set | EnginePage); } |