projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add defaults for facility, studio, chain, distributor (#2075).
[dcpomatic.git]
/
src
/
lib
/
audio_ring_buffers.h
diff --git
a/src/lib/audio_ring_buffers.h
b/src/lib/audio_ring_buffers.h
index cec7c712aee24d663bc2de8dc8859e47568f23fa..be8a616e22ce582d95bf724ac9f53f6a0f3b53e9 100644
(file)
--- a/
src/lib/audio_ring_buffers.h
+++ b/
src/lib/audio_ring_buffers.h
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2016-20
17
Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2016-20
21
Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
@@
-18,37
+18,38
@@
*/
*/
+
#ifndef DCPOMATIC_AUDIO_RING_BUFFERS_H
#define DCPOMATIC_AUDIO_RING_BUFFERS_H
#ifndef DCPOMATIC_AUDIO_RING_BUFFERS_H
#define DCPOMATIC_AUDIO_RING_BUFFERS_H
+
#include "audio_buffers.h"
#include "types.h"
#include "dcpomatic_time.h"
#include "audio_buffers.h"
#include "types.h"
#include "dcpomatic_time.h"
-#include <boost/shared_ptr.hpp>
#include <boost/thread.hpp>
#include <list>
#include <boost/thread.hpp>
#include <list>
-class AudioRingBuffers : public boost::noncopyable
+
+class AudioRingBuffers
{
public:
AudioRingBuffers ();
{
public:
AudioRingBuffers ();
-
void put (boost::shared_ptr<const AudioBuffers> data, DCPTime time)
;
-
void get (float* out, int channels, int frames)
;
+
AudioRingBuffers (AudioBuffers const&) = delete
;
+
AudioRingBuffers& operator= (AudioBuffers const&) = delete
;
- void clear ();
- Frame size ();
+ void put (std::shared_ptr<const AudioBuffers> data, dcpomatic::DCPTime time, int frame_rate);
+ boost::optional<dcpomatic::DCPTime> get (float* out, int channels, int frames);
+ boost::optional<dcpomatic::DCPTime> peek () const;
- DCPTime latest () const {
- boost::mutex::scoped_lock lm (_mutex);
- return _latest;
- }
+ void clear ();
+ Frame size () const;
private:
mutable boost::mutex _mutex;
private:
mutable boost::mutex _mutex;
- std::list<boost::shared_ptr<const AudioBuffers> > _buffers;
- DCPTime _latest;
- int _used_in_head;
+ std::list<std::pair<std::shared_ptr<const AudioBuffers>, dcpomatic::DCPTime> > _buffers;
+ int _used_in_head = 0;
};
};
+
#endif
#endif