summaryrefslogtreecommitdiff
path: root/gtk2_ardour/sfdb_ui.cc
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2017-06-12 23:59:11 +1000
committerTim Mayberry <mojofunk@gmail.com>2017-06-13 00:08:26 +1000
commit140ce4daec246ac056313b7232698f91fddce6ee (patch)
treee293d338afe88c4fda70ea1e5962876c7aa5482f /gtk2_ardour/sfdb_ui.cc
parent19384be74b6eb0d75d4e30abf9c3cdf7f5f72b71 (diff)
Restore the state of the autoplay button in the import dialog
Diffstat (limited to 'gtk2_ardour/sfdb_ui.cc')
-rw-r--r--gtk2_ardour/sfdb_ui.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc
index 01fb044e63..e9000fa096 100644
--- a/gtk2_ardour/sfdb_ui.cc
+++ b/gtk2_ardour/sfdb_ui.cc
@@ -237,6 +237,9 @@ SoundFileBox::SoundFileBox (bool /*persistent*/)
play_btn.signal_clicked().connect (sigc::mem_fun (*this, &SoundFileBox::audition));
stop_btn.signal_clicked().connect (sigc::mem_fun (*this, &SoundFileBox::stop_audition));
+ update_autoplay ();
+ autoplay_btn.signal_toggled().connect(sigc::mem_fun (*this, &SoundFileBox::autoplay_toggled));
+
stop_btn.set_sensitive (false);
channels_value.set_alignment (0.0f, 0.5f);
@@ -433,6 +436,22 @@ SoundFileBox::setup_labels (const string& filename)
return true;
}
+void
+SoundFileBox::update_autoplay ()
+{
+ const bool config_autoplay = UIConfiguration::instance().get_autoplay_files();
+
+ if (autoplay_btn.get_active() != config_autoplay) {
+ autoplay_btn.set_active (config_autoplay);
+ }
+}
+
+void
+SoundFileBox::autoplay_toggled()
+{
+ UIConfiguration::instance().set_autoplay_files(autoplay_btn.get_active());
+}
+
bool
SoundFileBox::autoplay() const
{