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 98bed30..4282cd6 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 cc913e1..1794ab3 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 b4def55..37bdfa2 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 c8ccc59..6c05916 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 ();