Disable audio mapping control when analysing audio (#1250).
authorCarl Hetherington <cth@carlh.net>
Tue, 27 Mar 2018 23:47:29 +0000 (00:47 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 27 Mar 2018 23:47:29 +0000 (00:47 +0100)
ChangeLog
src/wx/audio_panel.cc
src/wx/audio_panel.h

index 129e9ce2cf5ec9d77fccbba4c90f0e81fd061de7..ae42142265f0059903df0910d6d96656b5ffeef6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2018-03-28  Carl Hetherington  <cth@carlh.net>
+
+       * Disable audio mapping control when analysing audio (#1250).
+
 2018-03-27  Carl Hetherington  <cth@carlh.net>
 
        * Use a label rather than a tooltip to tell users why they can't
index b60d5d1213f2ad728d48e7361476a080042b8e06..88eae5141b66f5f9dba363da59f46f015be5cf9e 100644 (file)
@@ -125,7 +125,7 @@ AudioPanel::AudioPanel (ContentPanel* p)
 
        _mapping_connection = _mapping->Changed.connect (boost::bind (&AudioPanel::mapping_changed, this, _1));
 
-       JobManager::instance()->ActiveJobsChanged.connect (boost::bind (&AudioPanel::active_jobs_changed, this, _1));
+       JobManager::instance()->ActiveJobsChanged.connect (boost::bind (&AudioPanel::active_jobs_changed, this, _1, _2));
 }
 
 AudioPanel::~AudioPanel ()
@@ -347,10 +347,13 @@ AudioPanel::setup_peak ()
 }
 
 void
-AudioPanel::active_jobs_changed (optional<string> j)
+AudioPanel::active_jobs_changed (optional<string> old_active, optional<string> new_active)
 {
-       if (j && *j == "analyse_audio") {
+       if (old_active && *old_active == "analyse_audio") {
                setup_peak ();
+               _mapping->Enable (true);
+       } else if (new_active && *new_active == "analyse_audio") {
+               _mapping->Enable (false);
        }
 }
 
index 5551b396dc990b6cd4f89ca047c923a428e0962c..66667e1ad8a318b84b8c121493d1fe340335b787 100644 (file)
@@ -46,7 +46,7 @@ private:
        void mapping_changed (AudioMapping);
        void setup_description ();
        void setup_peak ();
-       void active_jobs_changed (boost::optional<std::string>);
+       void active_jobs_changed (boost::optional<std::string>, boost::optional<std::string>);
        void setup_sensitivity ();
        void reference_clicked ();