summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2017-03-08 19:46:24 +0100
committerPaul Davis <paul@linuxaudiosystems.com>2017-09-18 11:40:52 -0400
commitbcd7a21510a0ddd6d33ea96b6d70a8a20c784fc1 (patch)
treeb72ea439fb8a4ac98cc200d7a294e0a374ed2a7e /libs/ardour/ardour
parent7fb6807ed32cbcf63cb4b3d9545310c668bbaaaa (diff)
move ChannelInfo structure from DiskReader into DiskIOProcessor
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/disk_io.h44
-rw-r--r--libs/ardour/ardour/disk_reader.h40
2 files changed, 44 insertions, 40 deletions
diff --git a/libs/ardour/ardour/disk_io.h b/libs/ardour/ardour/disk_io.h
index 87a761a7b7..fba72fcfc8 100644
--- a/libs/ardour/ardour/disk_io.h
+++ b/libs/ardour/ardour/disk_io.h
@@ -24,6 +24,10 @@
#include <string>
#include <exception>
+#include "pbd/ringbufferNPT.h"
+#include "pbd/rcu.h"
+
+#include "ardour/interpolation.h"
#include "ardour/processor.h"
namespace ARDOUR {
@@ -85,6 +89,9 @@ class LIBARDOUR_API DiskIOProcessor : public Processor
int set_state (const XMLNode&, int version);
+ int add_channel (uint32_t how_many);
+ int remove_channel (uint32_t how_many);
+
protected:
friend class Auditioner;
virtual int seek (framepos_t which_sample, bool complete_refill = false) = 0;
@@ -115,6 +122,43 @@ class LIBARDOUR_API DiskIOProcessor : public Processor
framecnt_t& write_buffer_size);
virtual void allocate_temporary_buffers () = 0;
+
+ /** Information about one audio channel, playback or capture
+ * (depending on the derived class)
+ */
+ struct ChannelInfo : public boost::noncopyable {
+
+ ChannelInfo (framecnt_t buffer_size,
+ framecnt_t speed_buffer_size,
+ framecnt_t wrap_buffer_size);
+ ~ChannelInfo ();
+
+ Sample *wrap_buffer;
+ Sample *speed_buffer;
+ Sample *current_buffer;
+
+ /** A ringbuffer for data to be played back, written to in the
+ butler thread, read from in the process thread.
+ */
+ PBD::RingBufferNPT<Sample>* buf;
+
+ Sample* scrub_buffer;
+ Sample* scrub_forward_buffer;
+ Sample* scrub_reverse_buffer;
+
+ PBD::RingBufferNPT<Sample>::rw_vector read_vector;
+
+ void resize (framecnt_t);
+ };
+
+ typedef std::vector<ChannelInfo*> ChannelList;
+ SerializedRCUManager<ChannelList> channels;
+
+ int add_channel_to (boost::shared_ptr<ChannelList>, uint32_t how_many);
+ int remove_channel_from (boost::shared_ptr<ChannelList>, uint32_t how_many);
+
+ CubicInterpolation interpolation;
+
};
} // namespace ARDOUR
diff --git a/libs/ardour/ardour/disk_reader.h b/libs/ardour/ardour/disk_reader.h
index aa50894ebe..4c5244ab99 100644
--- a/libs/ardour/ardour/disk_reader.h
+++ b/libs/ardour/ardour/disk_reader.h
@@ -20,11 +20,7 @@
#ifndef __ardour_disk_reader_h__
#define __ardour_disk_reader_h__
-#include "pbd/ringbufferNPT.h"
-#include "pbd/rcu.h"
-
#include "ardour/disk_io.h"
-#include "ardour/interpolation.h"
#include "ardour/midi_buffer.h"
namespace ARDOUR
@@ -110,9 +106,6 @@ class LIBARDOUR_API DiskReader : public DiskIOProcessor
int can_internal_playback_seek (framecnt_t distance);
int seek (framepos_t frame, bool complete_refill = false);
- int add_channel (uint32_t how_many);
- int remove_channel (uint32_t how_many);
-
bool need_butler() const { return _need_butler; }
PBD::Signal0<void> Underrun;
@@ -166,36 +159,6 @@ class LIBARDOUR_API DiskReader : public DiskIOProcessor
gint _frames_written_to_ringbuffer;
gint _frames_read_from_ringbuffer;
- /** Information about one of our channels */
- struct ChannelInfo : public boost::noncopyable {
-
- ChannelInfo (framecnt_t buffer_size,
- framecnt_t speed_buffer_size,
- framecnt_t wrap_buffer_size);
- ~ChannelInfo ();
-
- Sample *wrap_buffer;
- Sample *speed_buffer;
- Sample *current_buffer;
-
- /** A ringbuffer for data to be played back, written to in the
- butler thread, read from in the process thread.
- */
- PBD::RingBufferNPT<Sample>* buf;
-
- Sample* scrub_buffer;
- Sample* scrub_forward_buffer;
- Sample* scrub_reverse_buffer;
-
- PBD::RingBufferNPT<Sample>::rw_vector read_vector;
-
- void resize (framecnt_t);
- };
-
- typedef std::vector<ChannelInfo*> ChannelList;
- SerializedRCUManager<ChannelList> channels;
-
- CubicInterpolation interpolation;
int audio_read (Sample* buf, Sample* mixdown_buffer, float* gain_buffer,
framepos_t& start, framecnt_t cnt,
@@ -209,9 +172,6 @@ class LIBARDOUR_API DiskReader : public DiskIOProcessor
int refill_audio (Sample *mixdown_buffer, float *gain_buffer, framecnt_t fill_level);
int refill_midi ();
- int add_channel_to (boost::shared_ptr<ChannelList>, uint32_t how_many);
- int remove_channel_from (boost::shared_ptr<ChannelList>, uint32_t how_many);
-
int internal_playback_seek (framecnt_t distance);
frameoffset_t calculate_playback_distance (pframes_t);