diff options
author | Sakari Bergen <sakari.bergen@beatwaves.net> | 2011-01-16 19:41:11 +0000 |
---|---|---|
committer | Sakari Bergen <sakari.bergen@beatwaves.net> | 2011-01-16 19:41:11 +0000 |
commit | a406d9183adc67075a4e802fd8254c2560df9964 (patch) | |
tree | 2bb5cfa9a25f5951e37a1a9e8c041cca6c960925 /libs/ardour/ardour | |
parent | 113e6b505a27b3cbdb26f96b96c92cf35fe311dd (diff) |
Make stem export export from right before any processors.
The dialog does not support exporting from the outputs anymore, sorry. Will add options later...
git-svn-id: svn://localhost/ardour2/branches/3.0@8520 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/buffer_set.h | 6 | ||||
-rw-r--r-- | libs/ardour/ardour/capturing_processor.h | 53 | ||||
-rw-r--r-- | libs/ardour/ardour/export_channel.h | 52 | ||||
-rw-r--r-- | libs/ardour/ardour/export_channel_configuration.h | 5 | ||||
-rw-r--r-- | libs/ardour/ardour/route.h | 2 |
5 files changed, 114 insertions, 4 deletions
diff --git a/libs/ardour/ardour/buffer_set.h b/libs/ardour/ardour/buffer_set.h index fc5ef96449..f5ac1aee61 100644 --- a/libs/ardour/ardour/buffer_set.h +++ b/libs/ardour/ardour/buffer_set.h @@ -97,10 +97,16 @@ public: AudioBuffer& get_audio(size_t i) { return (AudioBuffer&)get(DataType::AUDIO, i); } + const AudioBuffer& get_audio(size_t i) const { + return (const AudioBuffer&)get(DataType::AUDIO, i); + } MidiBuffer& get_midi(size_t i) { return (MidiBuffer&)get(DataType::MIDI, i); } + const MidiBuffer& get_midi(size_t i) const { + return (const MidiBuffer&)get(DataType::MIDI, i); + } #ifdef HAVE_SLV2 /** Get a MIDI buffer translated into an LV2 MIDI buffer for use with plugins. diff --git a/libs/ardour/ardour/capturing_processor.h b/libs/ardour/ardour/capturing_processor.h new file mode 100644 index 0000000000..2e2db78091 --- /dev/null +++ b/libs/ardour/ardour/capturing_processor.h @@ -0,0 +1,53 @@ +/* + Copyright (C) 2011 Paul Davis + Author: Sakari Bergen + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef __ardour_capturing_processor_h__ +#define __ardour_capturing_processor_h__ + +#include "ardour/processor.h" + +namespace ARDOUR { + +class CapturingProcessor : public Processor +{ + public: + CapturingProcessor (Session & session); + ~CapturingProcessor(); + + public: // main interface + BufferSet const & get_capture_buffers() const { return capture_buffers; } + + public: // Processor overrides + bool display_to_user() const { return false; } + int set_block_size (pframes_t nframes); + void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool result_required); + bool configure_io (ChanCount in, ChanCount out); + bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const; + + private: + + void realloc_buffers(); + + framecnt_t block_size; + BufferSet capture_buffers; +}; + +} // namespace ARDOUR + +#endif // __ardour_capturing_processor_h__ diff --git a/libs/ardour/ardour/export_channel.h b/libs/ardour/ardour/export_channel.h index 34d6263976..5e42956cdb 100644 --- a/libs/ardour/ardour/export_channel.h +++ b/libs/ardour/ardour/export_channel.h @@ -38,6 +38,7 @@ class Session; class AudioTrack; class AudioPort; class AudioRegion; +class CapturingProcessor; /// Export channel base class interface for different source types class ExportChannel : public boost::less_than_comparable<ExportChannel> @@ -48,7 +49,7 @@ class ExportChannel : public boost::less_than_comparable<ExportChannel> virtual void set_max_buffer_size(framecnt_t frames) { } - virtual void read (Sample *& data, framecnt_t frames) const = 0; + virtual void read (Sample const *& data, framecnt_t frames) const = 0; virtual bool empty () const = 0; /// Adds state to node passed @@ -81,7 +82,7 @@ class PortExportChannel : public ExportChannel PortExportChannel (); void set_max_buffer_size(framecnt_t frames); - void read (Sample *& data, framecnt_t frames) const; + void read (Sample const *& data, framecnt_t frames) const; bool empty () const { return ports.empty(); } void get_state (XMLNode * node) const; @@ -112,7 +113,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 const *& data, framecnt_t frames_to_read); private: @@ -142,7 +143,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 const *& 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; } @@ -160,6 +161,49 @@ class RegionExportChannel : public ExportChannel uint32_t channel; }; +/// Export channel for exporting from different positions in a route +class RouteExportChannel : public ExportChannel +{ + class ProcessorRemover; // fwd declaration + + public: + RouteExportChannel(boost::shared_ptr<CapturingProcessor> processor, size_t channel, + boost::shared_ptr<ProcessorRemover> remover); + ~RouteExportChannel(); + + static void create_from_route(std::list<ExportChannelPtr> & result, Route & route); + + public: // ExportChannel interface + void set_max_buffer_size(framecnt_t frames); + + void read (Sample const *& data, framecnt_t frames) const; + bool empty () const { return false; } + + void get_state (XMLNode * node) const; + void set_state (XMLNode * node, Session & session); + + bool operator< (ExportChannel const & other) const; + + private: + + // Removes the processor from the track when deleted + class ProcessorRemover { + public: + ProcessorRemover (Route & route, boost::shared_ptr<CapturingProcessor> processor) + : route (route), processor (processor) {} + ~ProcessorRemover(); + private: + Route & route; + boost::shared_ptr<CapturingProcessor> processor; + }; + + boost::shared_ptr<CapturingProcessor> processor; + size_t channel; + // Each channel keeps a ref to the remover. Last one alive + // will cause the processor to be removed on deletion. + boost::shared_ptr<ProcessorRemover> remover; +}; + } // namespace ARDOUR #endif diff --git a/libs/ardour/ardour/export_channel_configuration.h b/libs/ardour/ardour/export_channel_configuration.h index b5b9b65bf7..5701be576b 100644 --- a/libs/ardour/ardour/export_channel_configuration.h +++ b/libs/ardour/ardour/export_channel_configuration.h @@ -23,6 +23,8 @@ #include <list> #include <string> +#include <algorithm> + #include <boost/enable_shared_from_this.hpp> #include "ardour/export_channel.h" @@ -70,6 +72,9 @@ class ExportChannelConfiguration : public boost::enable_shared_from_this<ExportC uint32_t get_n_chans () const { return channels.size(); } void register_channel (ExportChannelPtr channel) { channels.push_back (channel); } + void register_channels (ChannelList const & new_channels) { + std::copy (new_channels.begin(), new_channels.end(), std::back_inserter(channels)); + } void clear_channels () { channels.clear (); } /** Returns a list of channel configurations that match the files created. diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 60970d5d20..90f5664eba 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -59,6 +59,7 @@ class RouteGroup; class Send; class InternalReturn; class MonitorProcessor; +class CapturingProcessor; class Route : public SessionObject, public Automatable, public RouteGroupMember, public GraphNode { @@ -217,6 +218,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, BufferSet* get_return_buffer () const; void release_return_buffer () const; void put_monitor_send_at (Placement); + boost::shared_ptr<CapturingProcessor> add_export_point(/* Add some argument for placement later */); /** A record of the stream configuration at some point in the processor list. * Used to return where and why an processor list configuration request failed. |