Various fixes to push audio vaguely in the right direction.
[dcpomatic.git] / src / lib / audio_merger.h
index 756e5ab3120719fc8fd4e892891b947bbdf31ddb..6db28b6c3cb2e841fa4b8996ff3c383075dda5f8 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 
 */
 
+#include "audio_buffers.h"
+#include "dcpomatic_time.h"
 #include "util.h"
 
-class AudioBuffers;
-
 class AudioMerger
 {
 public:
@@ -29,13 +29,14 @@ public:
        /** Pull audio up to a given time; after this call, no more data can be pushed
         *  before the specified time.
         */
-       TimedAudioBuffers pull (DCPTime time);
+       std::pair<boost::shared_ptr<AudioBuffers>, DCPTime> pull (DCPTime time);
        void push (boost::shared_ptr<const AudioBuffers> audio, DCPTime time);
-       TimedAudioBuffers flush ();
-       void clear (DCPTime t);
-       
+       DCPTime last_pull () const {
+               return _last_pull;
+       }
+
 private:
        boost::shared_ptr<AudioBuffers> _buffers;
-       int _frame_rate;
        DCPTime _last_pull;
+       int _frame_rate;
 };