summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/export_channel.h
diff options
context:
space:
mode:
authorSakari Bergen <sakari.bergen@beatwaves.net>2011-01-10 21:16:49 +0000
committerSakari Bergen <sakari.bergen@beatwaves.net>2011-01-10 21:16:49 +0000
commitffccaaf0bbd23ea655d8027f5173b45ba3258edf (patch)
tree5b7ae5208275080ff148123bbc8e8a071a352d9a /libs/ardour/ardour/export_channel.h
parentb67be86cbff5efe1fff35ca86a216a1e63e214d7 (diff)
Make export channels own their buffers + some other small code tidy-ups. Preparation for more stem export options
git-svn-id: svn://localhost/ardour2/branches/3.0@8494 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/export_channel.h')
-rw-r--r--libs/ardour/ardour/export_channel.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/libs/ardour/ardour/export_channel.h b/libs/ardour/ardour/export_channel.h
index f51578c80c..34d6263976 100644
--- a/libs/ardour/ardour/export_channel.h
+++ b/libs/ardour/ardour/export_channel.h
@@ -25,6 +25,7 @@
#include <boost/signals2.hpp>
#include <boost/shared_ptr.hpp>
+#include <boost/scoped_array.hpp>
#include <boost/operators.hpp>
#include "pbd/signals.h"
@@ -45,7 +46,9 @@ class ExportChannel : public boost::less_than_comparable<ExportChannel>
virtual ~ExportChannel () {}
- virtual void read (Sample * data, framecnt_t frames) const = 0;
+ virtual void set_max_buffer_size(framecnt_t frames) { }
+
+ virtual void read (Sample *& data, framecnt_t frames) const = 0;
virtual bool empty () const = 0;
/// Adds state to node passed
@@ -75,9 +78,10 @@ class PortExportChannel : public ExportChannel
public:
typedef std::set<AudioPort *> PortSet;
- PortExportChannel () {}
+ PortExportChannel ();
+ void set_max_buffer_size(framecnt_t frames);
- void read (Sample * data, framecnt_t frames) const;
+ void read (Sample *& data, framecnt_t frames) const;
bool empty () const { return ports.empty(); }
void get_state (XMLNode * node) const;
@@ -90,6 +94,8 @@ class PortExportChannel : public ExportChannel
private:
PortSet ports;
+ boost::scoped_array<Sample> buffer;
+ framecnt_t buffer_size;
};
/// Handles RegionExportChannels and does actual reading from region
@@ -106,7 +112,7 @@ class RegionExportChannelFactory
~RegionExportChannelFactory ();
ExportChannelPtr create (uint32_t channel);
- void read (uint32_t channel, Sample * data, framecnt_t frames_to_read);
+ void read (uint32_t channel, Sample *& data, framecnt_t frames_to_read);
private:
@@ -124,8 +130,8 @@ class RegionExportChannelFactory
framecnt_t region_start;
framecnt_t position;
- Sample * mixdown_buffer;
- Sample * gain_buffer;
+ boost::scoped_array<Sample> mixdown_buffer;
+ boost::scoped_array<Sample> gain_buffer;
PBD::ScopedConnection export_connection;
};
@@ -136,7 +142,7 @@ class RegionExportChannel : public ExportChannel
friend class RegionExportChannelFactory;
public:
- void read (Sample * data, framecnt_t frames_to_read) const { factory.read (channel, data, frames_to_read); }
+ void read (Sample *& data, framecnt_t frames_to_read) const { factory.read (channel, data, frames_to_read); }
void get_state (XMLNode * /*node*/) const {};
void set_state (XMLNode * /*node*/, Session & /*session*/) {};
bool empty () const { return false; }