summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-09-12 12:26:59 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-09-12 12:26:59 -0400
commit6b3907d57f3f69df420529af308412eeb80306a4 (patch)
tree8c3039216a269f8ad9398cf696c35bbe83697076 /gtk2_ardour
parent4df3666738607039445ebc9fa083bf5c23ac5539 (diff)
change names, add comment, improve return type to avoid extra call to get EngineControl::State*
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/engine_dialog.cc15
-rw-r--r--gtk2_ardour/engine_dialog.h4
2 files changed, 10 insertions, 9 deletions
diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc
index 873498f6ec..923024bdc2 100644
--- a/gtk2_ardour/engine_dialog.cc
+++ b/gtk2_ardour/engine_dialog.cc
@@ -538,7 +538,7 @@ EngineControl::get_matching_state (const string& backend,
}
EngineControl::State*
-EngineControl::get_current_state ()
+EngineControl::get_saved_state_for_currently_displayed_backend_and_device ()
{
boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend();
@@ -554,11 +554,11 @@ EngineControl::get_current_state ()
device_combo.get_active_text());
}
-void
+EngineControl::State*
EngineControl::save_state ()
{
bool existing = true;
- State* state = get_current_state ();
+ State* state = get_saved_state_for_currently_displayed_backend_and_device ();
if (!state) {
existing = false;
@@ -578,12 +578,14 @@ EngineControl::save_state ()
if (!existing) {
states.push_back (*state);
}
+
+ return state;
}
void
EngineControl::maybe_display_saved_state ()
{
- State* state = get_current_state ();
+ State* state = get_saved_state_for_currently_displayed_backend_and_device ();
if (state) {
ignore_changes++;
@@ -792,11 +794,10 @@ EngineControl::push_state_to_backend (bool start)
* necessary
*/
- State* state = get_current_state ();
+ State* state = get_saved_state_for_currently_displayed_backend_and_device ();
if (!state) {
- save_state ();
- state = get_current_state ();
+ state = save_state ();
assert (state);
}
diff --git a/gtk2_ardour/engine_dialog.h b/gtk2_ardour/engine_dialog.h
index 3872917add..88e5094948 100644
--- a/gtk2_ardour/engine_dialog.h
+++ b/gtk2_ardour/engine_dialog.h
@@ -154,9 +154,9 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
State* get_matching_state (const std::string& backend,
const std::string& driver,
const std::string& device);
- State* get_current_state ();
+ State* get_saved_state_for_currently_displayed_backend_and_device ();
void maybe_display_saved_state ();
- void save_state ();
+ State* save_state ();
static bool print_channel_count (Gtk::SpinButton*);