Remove film player, DVD ripping, alignment, screen configs; never finished and not...
[dcpomatic.git] / src / lib / util.h
index 26c6ed9faba6d940e32b279474435d4cd69d0aa3..7aa9f25e14f01be88c0e4e43bda5b55bc0700b4b 100644 (file)
@@ -54,6 +54,8 @@ extern std::string md5_digest (std::string);
 extern std::string md5_digest (void const *, int);
 extern void ensure_ui_thread ();
 
+typedef int SourceFrame;
+
 struct DCPFrameRate
 {
        int frames_per_second;
@@ -218,6 +220,7 @@ class AudioBuffers
 {
 public:
        AudioBuffers (int channels, int frames);
+       AudioBuffers (AudioBuffers const &);
        ~AudioBuffers ();
 
        float** data () const {
@@ -226,6 +229,10 @@ public:
        
        float* data (int) const;
 
+       int channels () const {
+               return _channels;
+       }
+
        int frames () const {
                return _frames;
        }
@@ -234,14 +241,17 @@ public:
 
        void make_silent ();
 
+       void copy_from (AudioBuffers* from, int frames_to_copy, int read_offset, int write_offset);
+       void move (int from, int to, int frames);
+
 private:
-       /* no copy construction */
-       AudioBuffers (AudioBuffers const &);
-       
        int _channels;
        int _frames;
+       int _allocated_frames;
        float** _data;
 };
 
+extern int64_t video_frames_to_audio_frames (SourceFrame v, float audio_sample_rate, float frames_per_second);
+
 #endif