Remove Sndfile code and use FFmpeg instead.
[dcpomatic.git] / test / audio_delay_test.cc
index 05384873f850a46340a2de918fdb8f0cd226310f..a538da4ed655f58c46821bf8fef924e6b4bf4095 100644 (file)
@@ -18,7 +18,7 @@
 */
 
 /** @file  test/audio_delay_test.cc
- *  @brief Test encode using some SndfileContents which have audio delays.
+ *  @brief Test encode using some FFmpegContents which have audio delays.
  *
  *  The output is checked algorithmically using knowledge of the input.
  */
 #include <dcp/reel.h>
 #include <dcp/sound_asset.h>
 #include <dcp/reel_sound_asset.h>
-#include "lib/sndfile_content.h"
+#include "lib/ffmpeg_content.h"
 #include "lib/dcp_content_type.h"
 #include "lib/ratio.h"
 #include "lib/film.h"
+#include "lib/audio_content.h"
 #include "test.h"
+#include <iostream>
 
 using std::string;
 using std::cout;
@@ -44,15 +46,15 @@ static
 void test_audio_delay (int delay_in_ms)
 {
        BOOST_TEST_MESSAGE ("Testing delay of " << delay_in_ms);
-       
+
        string const film_name = "audio_delay_test_" + lexical_cast<string> (delay_in_ms);
        shared_ptr<Film> film = new_test_film (film_name);
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
        film->set_container (Ratio::from_id ("185"));
        film->set_name (film_name);
 
-       shared_ptr<SndfileContent> content (new SndfileContent (film, "test/data/staircase.wav"));
-       content->set_audio_delay (delay_in_ms);
+       shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/staircase.wav"));
+       content->audio->set_delay (delay_in_ms);
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
@@ -78,7 +80,7 @@ void test_audio_delay (int delay_in_ms)
        while (n < sound_asset->asset()->intrinsic_duration()) {
                shared_ptr<const dcp::SoundFrame> sound_frame = sound_asset->asset()->get_frame (frame++);
                uint8_t const * d = sound_frame->data ();
-               
+
                for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->asset()->channels())) {
 
                        /* Mono input so it will appear on centre */