projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bump version
[dcpomatic.git]
/
src
/
lib
/
audio_buffers.h
diff --git
a/src/lib/audio_buffers.h
b/src/lib/audio_buffers.h
index 5e7b9fda4e769889d4a819e8df168dfe186e8777..c9030dbfa9e84af247dd760f276c3ee33eaa5969 100644
(file)
--- a/
src/lib/audio_buffers.h
+++ b/
src/lib/audio_buffers.h
@@
-17,6
+17,9
@@
*/
*/
+#ifndef DVDOMATIC_AUDIO_BUFFERS_H
+#define DVDOMATIC_AUDIO_BUFFERS_H
+
#include <boost/shared_ptr.hpp>
/** @class AudioBuffers
#include <boost/shared_ptr.hpp>
/** @class AudioBuffers
@@
-30,6
+33,8
@@
public:
AudioBuffers (boost::shared_ptr<const AudioBuffers>);
~AudioBuffers ();
AudioBuffers (boost::shared_ptr<const AudioBuffers>);
~AudioBuffers ();
+ AudioBuffers & operator= (AudioBuffers const &);
+
void ensure_size (int);
float** data () const {
void ensure_size (int);
float** data () const {
@@
-50,12
+55,19
@@
public:
void make_silent ();
void make_silent (int c);
void make_silent ();
void make_silent (int c);
+ void make_silent (int from, int frames);
+
+ void apply_gain (float);
void copy_from (AudioBuffers const * from, int frames_to_copy, int read_offset, int write_offset);
void move (int from, int to, int frames);
void copy_from (AudioBuffers const * from, int frames_to_copy, int read_offset, int write_offset);
void move (int from, int to, int frames);
- void accumulate (AudioBuffers const *, int, int);
+ void accumulate_channel (AudioBuffers const *, int, int, float gain = 1);
+ void accumulate_frames (AudioBuffers const *, int read_offset, int write_offset, int frames);
private:
private:
+ void allocate (int, int);
+ void deallocate ();
+
/** Number of channels */
int _channels;
/** Number of frames (where a frame is one sample across all channels) */
/** Number of channels */
int _channels;
/** Number of frames (where a frame is one sample across all channels) */
@@
-65,3
+77,5
@@
private:
/** Audio data (so that, e.g. _data[2][6] is channel 2, sample 6) */
float** _data;
};
/** Audio data (so that, e.g. _data[2][6] is channel 2, sample 6) */
float** _data;
};
+
+#endif