projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make DCPExaminer::size() optional and deal with the consequences.
[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 bfaad5ec97074d0077ca9376bb636d4c4bdf55d0..376ff92eec09239c949b15597903403af5bcf02c 100644
(file)
--- a/
src/lib/audio_ring_buffers.h
+++ b/
src/lib/audio_ring_buffers.h
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2016-20
19
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,32
+18,39
@@
*/
*/
+
#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 "audio_buffers.h"
-#include "types.h"
#include "dcpomatic_time.h"
#include "dcpomatic_time.h"
-#include
<boost/shared_ptr.hpp>
+#include
"types.h"
#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, dcpomatic::DCPTime time, int frame_rate);
+ AudioRingBuffers (AudioBuffers const&) = delete;
+ AudioRingBuffers& operator= (AudioBuffers const&) = delete;
+
+ 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;
void clear ();
boost::optional<dcpomatic::DCPTime> get (float* out, int channels, int frames);
boost::optional<dcpomatic::DCPTime> peek () const;
void clear ();
+ /** @return number of frames currently available */
Frame size () const;
private:
mutable boost::mutex _mutex;
Frame size () const;
private:
mutable boost::mutex _mutex;
- std::list<std::pair<
boost::shared_ptr<const AudioBuffers>, dcpomatic::DCPTime>
> _buffers;
- int _used_in_head;
+ std::list<std::pair<
std::shared_ptr<const AudioBuffers>, dcpomatic::DCPTime>
> _buffers;
+ int _used_in_head
= 0
;
};
};
+
#endif
#endif