AnalyseAudioJob does not need an explicit playlist.
authorCarl Hetherington <cth@carlh.net>
Wed, 17 Jun 2015 15:13:17 +0000 (16:13 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 17 Jun 2015 15:13:17 +0000 (16:13 +0100)
src/lib/analyse_audio_job.cc
src/lib/analyse_audio_job.h
src/wx/audio_dialog.cc
test/audio_analysis_test.cc

index 98bed30dcab22e89a97a322684dc3c3666d04549..4282cd66fd9562f5cc33573196105238fa5b4f22 100644 (file)
@@ -36,9 +36,8 @@ using boost::dynamic_pointer_cast;
 
 int const AnalyseAudioJob::_num_points = 1024;
 
-AnalyseAudioJob::AnalyseAudioJob (shared_ptr<const Film> f, shared_ptr<const Playlist> p)
+AnalyseAudioJob::AnalyseAudioJob (shared_ptr<const Film> f)
        : Job (f)
-       , _playlist (p)
        , _done (0)
        , _samples_per_point (1)
        , _overall_peak (0)
index cc913e1f3f6802d4bee0ded48e3585e6469be94e..1794ab3dcae1b4f6f8755de341f761d237ead5bf 100644 (file)
 #include "types.h"
 
 class AudioBuffers;
-class Playlist;
 
 /** @class AnalyseAudioJob
- *  @brief A job to analyse the audio of a playlist and make a note of its
+ *  @brief A job to analyse the audio of a film and make a note of its
  *  broad peak and RMS levels.
  *
  *  After computing the peak and RMS levels the job will write a file
- *  to Playlist::audio_analysis_path.
+ *  to Film::audio_analysis_path.
  */
 class AnalyseAudioJob : public Job
 {
 public:
-       AnalyseAudioJob (boost::shared_ptr<const Film>, boost::shared_ptr<const Playlist>);
+       AnalyseAudioJob (boost::shared_ptr<const Film>);
 
        std::string name () const;
        std::string json_name () const;
@@ -47,7 +46,6 @@ public:
 private:
        void analyse (boost::shared_ptr<const AudioBuffers>);
 
-       boost::shared_ptr<const Playlist> _playlist;
        int64_t _done;
        int64_t _samples_per_point;
        std::vector<AudioPoint> _current;
index b4def55d39fc8acc265957373a4e6aa503a64ff2..37bdfa2bd130f3743ccc8599ae847088231ee4c7 100644 (file)
@@ -133,7 +133,7 @@ AudioDialog::try_to_load_analysis ()
        if (!boost::filesystem::exists (path)) {
                _plot->set_analysis (shared_ptr<AudioAnalysis> ());
                _analysis.reset ();
-               shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film, _playlist));
+               shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film));
                _analysis_finished_connection = job->Finished.connect (bind (&AudioDialog::analysis_finished, this));
                JobManager::instance()->add (job);
                return;
@@ -143,7 +143,7 @@ AudioDialog::try_to_load_analysis ()
                _analysis.reset (new AudioAnalysis (path));
        } catch (xmlpp::exception& e) {
                /* Probably an old-style analysis file: recreate it */
-               shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film, _playlist));
+               shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film));
                _analysis_finished_connection = job->Finished.connect (bind (&AudioDialog::analysis_finished, this));
                JobManager::instance()->add (job);
                return;
index c8ccc597e5c4f04c7210a58a131dde67ca5c59e8..6c05916ab6aa78aef9c9a3fe640ff5e6cf7e8320 100644 (file)
@@ -99,7 +99,7 @@ BOOST_AUTO_TEST_CASE (audio_analysis_test)
        film->examine_and_add_content (c);
        wait_for_jobs ();
 
-       shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film, film->playlist ()));
+       shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film));
        job->Finished.connect (boost::bind (&finished));
        JobManager::instance()->add (job);
        wait_for_jobs ();
@@ -115,7 +115,7 @@ BOOST_AUTO_TEST_CASE (audio_analysis_negative_delay_test)
        film->examine_and_add_content (c);
        wait_for_jobs ();
        
-       shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film, film->playlist ()));
+       shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film));
        job->Finished.connect (boost::bind (&finished));
        JobManager::instance()->add (job);
        wait_for_jobs ();
@@ -130,7 +130,7 @@ BOOST_AUTO_TEST_CASE (audio_analysis_test2)
        film->examine_and_add_content (c);
        wait_for_jobs ();
        
-       shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film, film->playlist ()));
+       shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film));
        job->Finished.connect (boost::bind (&finished));
        JobManager::instance()->add (job);
        wait_for_jobs ();