Use icu to remove diacritics from strings.
[dcpomatic.git] / src / lib / audio_ring_buffers.cc
index 21c4b6a5c1084123c71d82706653615e96aab709..289045ff529b445d8aa2ce0927423fd9a38820bd 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016-2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2019 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -21,7 +21,6 @@
 #include "audio_ring_buffers.h"
 #include "dcpomatic_assert.h"
 #include "exceptions.h"
-#include <boost/foreach.hpp>
 #include <iostream>
 
 using std::min;
@@ -29,8 +28,9 @@ using std::cout;
 using std::make_pair;
 using std::pair;
 using std::list;
-using boost::shared_ptr;
+using std::shared_ptr;
 using boost::optional;
+using namespace dcpomatic;
 
 AudioRingBuffers::AudioRingBuffers ()
        : _used_in_head (0)
@@ -103,6 +103,16 @@ AudioRingBuffers::get (float* out, int channels, int frames)
        return time;
 }
 
+optional<DCPTime>
+AudioRingBuffers::peek () const
+{
+       boost::mutex::scoped_lock lm (_mutex);
+       if (_buffers.empty()) {
+               return optional<DCPTime>();
+       }
+       return _buffers.front().second;
+}
+
 void
 AudioRingBuffers::clear ()
 {