void
ProcessorBox::object_drop (const list<boost::shared_ptr<Processor> >& procs)
{
- paste_processor_list (procs);
+ for (std::list<boost::shared_ptr<Processor> >::const_iterator i = procs.begin(); i != procs.end(); ++i) {
+
+ XMLNode& state = (*i)->get_state ();
+ XMLNodeList nlist;
+ nlist.push_back (&state);
+ paste_processor_state (nlist);
+ delete &state;
+ }
}
void
cerr << "paste from node called " << _rr_selection.processors.get_node().name() << endl;
- paste_processor_state (_rr_selection.processors.get_node());
+ paste_processor_state (_rr_selection.processors.get_node().children());
}
void
-ProcessorBox::paste_processor_list (const list<boost::shared_ptr<Processor> >& processors)
+ProcessorBox::paste_processor_state (const XMLNodeList& nlist)
{
- list<boost::shared_ptr<Processor> > copies;
-
- for (list<boost::shared_ptr<Processor> >::const_iterator i = processors.begin(); i != processors.end(); ++i) {
-
- boost::shared_ptr<Processor> copy = Processor::clone (*i);
-
- copy->set_placement (_placement);
- copies.push_back (copy);
- }
-
- if (_route->add_processors (copies)) {
-
- string msg = _(
- "Copying the set of processors on the clipboard failed,\n\
-probably because the I/O configuration of the plugins\n\
-could not match the configuration of this track.");
- MessageDialog am (msg);
- am.run ();
- }
-}
-
-void
-ProcessorBox::paste_processor_state (const XMLNode& node)
-{
- XMLNodeList nlist;
XMLNodeConstIterator niter;
list<boost::shared_ptr<Processor> > copies;
- nlist = node.children();
-
cerr << "Pasting processor selection containing " << nlist.size() << endl;
if (nlist.empty()) {
cerr << "try using " << (*niter)->name() << endl;
XMLProperty const * type = (*niter)->property ("type");
assert (type);
+
+ boost::shared_ptr<Processor> p;
try {
if (type->value() == "send") {
XMLNode n (**niter);
Send::make_unique (n, _session);
- copies.push_back (boost::shared_ptr<Processor> (new Send (_session, n)));
+ p.reset (new Send (_session, n));
+
} else {
- copies.push_back (boost::shared_ptr<Processor> (new PluginInsert (_session, **niter)));
+ p.reset (new PluginInsert (_session, **niter));
}
+
+ p->set_placement (_placement);
+ copies.push_back (p);
}
catch (...) {
cerr << "plugin insert constructor failed\n";
}
}
-void
-ProcessorBox::clone_processors ()
-{
- RouteSelection& routes (_rr_selection.routes);
-
- if (!routes.empty()) {
- if (_route->copy_processors (*routes.front(), _placement)) {
- string msg = _(
-"Copying the set of processors on the clipboard failed,\n\
-probably because the I/O configuration of the plugins\n\
-could not match the configuration of this track.");
- MessageDialog am (msg);
- am.run ();
- }
- }
-}
-
void
ProcessorBox::all_processors_active (bool state)
{
void paste_processors ();
void delete_processors ();
void clear_processors ();
- void clone_processors ();
void rename_processors ();
void for_selected_processors (void (ProcessorBox::*pmf)(boost::shared_ptr<ARDOUR::Processor>));
void get_selected_processors (vector<boost::shared_ptr<ARDOUR::Processor> >&);
static Glib::RefPtr<Gtk::Action> paste_action;
- void paste_processor_list (const std::list<boost::shared_ptr<ARDOUR::Processor> >& processors);
- void paste_processor_state (const XMLNode&);
+ void paste_processor_state (const XMLNodeList&);
void activate_processor (boost::shared_ptr<ARDOUR::Processor>);
void deactivate_processor (boost::shared_ptr<ARDOUR::Processor>);
IOProcessor (Session&, const string& name, Placement,
int input_min = -1, int input_max = -1, int output_min = -1, int output_max = -1,
ARDOUR::DataType default_type = DataType::AUDIO);
- IOProcessor (const IOProcessor&);
virtual ~IOProcessor ();
virtual ChanCount output_streams() const;
protected:
boost::shared_ptr<IO> _io;
+
+ private:
+ /* disallow copy construction */
+ IOProcessor (const IOProcessor&);
+
};
} // namespace ARDOUR
}
private:
+ /* disallow copy construction */
+ PeakMeter (PeakMeter const &);
friend class IO;
void meter();
}
private:
+ /* disallow copy construction */
+ Panner (Panner const &);
+
void distribute_no_automation(BufferSet& src, BufferSet& dest, nframes_t nframes, nframes_t offset, gain_t gain_coeff);
std::vector<StreamPanner*> _streampanners;
uint32_t current_outs;
public:
PluginInsert (Session&, boost::shared_ptr<Plugin>, Placement);
PluginInsert (Session&, const XMLNode&);
- PluginInsert (const PluginInsert&);
~PluginInsert ();
static const string port_automation_node_name;
}
private:
+ /* disallow copy construction */
+ PluginInsert (const PluginInsert&);
void parameter_changed (Evoral::Parameter, float);
public:
PortInsert (Session&, Placement);
PortInsert (Session&, const XMLNode&);
- PortInsert (const PortInsert&);
~PortInsert ();
XMLNode& state(bool full);
uint32_t bit_slot() const { return bitslot; }
private:
+ /* disallow copy construction */
+ PortInsert (const PortInsert&);
+
uint32_t bitslot;
};
virtual ~Processor() { }
- static boost::shared_ptr<Processor> clone (boost::shared_ptr<const Processor>);
-
uint32_t sort_key() const { return _sort_key; }
void set_sort_key (uint32_t key);
Placement _placement;
uint32_t _sort_key;
void* _gui; /* generic, we don't know or care what this is */
+
+private:
+ /* disallow copy construction */
+ Processor (Processor const &);
};
} // namespace ARDOUR
int add_processor (boost::shared_ptr<Processor>, ProcessorStreams* err = 0);
int add_processors (const ProcessorList&, ProcessorStreams* err = 0);
int remove_processor (boost::shared_ptr<Processor>, ProcessorStreams* err = 0);
- int copy_processors (const Route&, Placement, ProcessorStreams* err = 0);
int sort_processors (ProcessorStreams* err = 0);
void disable_processors (Placement);
void disable_processors ();
public:
Send (Session&, Placement);
Send (Session&, const XMLNode&);
- Send (const Send&);
virtual ~Send ();
uint32_t bit_slot() const { return bitslot; }
static void make_unique (XMLNode &, Session &);
private:
+ /* disallow copy construction */
+ Send (const Send&);
+
bool _metering;
ChanCount expected_inputs;
uint32_t bitslot;
}
}
-PluginInsert::PluginInsert (const PluginInsert& other)
- : Processor (other._session, other._name, other.placement()),
- _signal_analysis_collected_nframes(0),
- _signal_analysis_collect_nframes_max(0)
-{
- uint32_t count = other._plugins.size();
-
- /* make as many copies as requested */
- for (uint32_t n = 0; n < count; ++n) {
- _plugins.push_back (plugin_factory (other.plugin (n)));
- }
-
- init ();
-
- ProcessorCreated (this); /* EMIT SIGNAL */
-}
-
bool
PluginInsert::set_count (uint32_t num)
{
ProcessorCreated (this); /* EMIT SIGNAL */
}
-PortInsert::PortInsert (const PortInsert& other)
- : IOProcessor (other._session, string_compose (_("insert %1"), (bitslot = other._session.next_insert_id()) + 1), other.placement(), 1, -1, 1, -1)
-{
- init ();
- ProcessorCreated (this); /* EMIT SIGNAL */
-}
-
void
PortInsert::init ()
{
{
}
-boost::shared_ptr<Processor>
-Processor::clone (boost::shared_ptr<const Processor> other)
-{
- boost::shared_ptr<const Send> send;
- boost::shared_ptr<const PortInsert> port_insert;
- boost::shared_ptr<const PluginInsert> plugin_insert;
-
- if ((send = boost::dynamic_pointer_cast<const Send>(other)) != 0) {
- return boost::shared_ptr<Processor> (new Send (*send));
- } else if ((port_insert = boost::dynamic_pointer_cast<const PortInsert>(other)) != 0) {
- return boost::shared_ptr<Processor> (new PortInsert (*port_insert));
- } else if ((plugin_insert = boost::dynamic_pointer_cast<const PluginInsert>(other)) != 0) {
- return boost::shared_ptr<Processor> (new PluginInsert (*plugin_insert));
- } else {
- fatal << _("programming error: unknown Processor type in Processor::Clone!\n")
- << endmsg;
- /*NOTREACHED*/
- }
- return boost::shared_ptr<Processor>();
-}
-
void
Processor::set_sort_key (uint32_t key)
{
return false;
}
-int
-Route::copy_processors (const Route& other, Placement placement, ProcessorStreams* err)
-{
- ChanCount old_pmo = processor_max_outs;
-
- ProcessorList to_be_deleted;
-
- {
- Glib::RWLock::WriterLock lm (_processor_lock);
- ProcessorList::iterator tmp;
- ProcessorList the_copy;
-
- the_copy = _processors;
-
- /* remove all relevant processors */
-
- for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ) {
- tmp = i;
- ++tmp;
-
- if ((*i)->placement() == placement) {
- to_be_deleted.push_back (*i);
- _processors.erase (i);
- }
-
- i = tmp;
- }
-
- /* now copy the relevant ones from "other" */
-
- for (ProcessorList::const_iterator i = other._processors.begin(); i != other._processors.end(); ++i) {
- if ((*i)->placement() == placement) {
- _processors.push_back (IOProcessor::clone (*i));
- }
- }
-
- /* reset plugin stream handling */
-
- if (_reset_processor_counts (err)) {
-
- /* FAILED COPY ATTEMPT: we have to restore order */
-
- /* delete all cloned processors */
-
- for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ) {
-
- tmp = i;
- ++tmp;
-
- if ((*i)->placement() == placement) {
- _processors.erase (i);
- }
-
- i = tmp;
- }
-
- /* restore the natural order */
-
- _processors = the_copy;
- processor_max_outs = old_pmo;
-
- /* we failed, even though things are OK again */
-
- return -1;
-
- } else {
-
- /* SUCCESSFUL COPY ATTEMPT: delete the processors we removed pre-copy */
- to_be_deleted.clear ();
- _user_latency = 0;
- }
- }
-
- if (processor_max_outs != old_pmo || old_pmo == ChanCount::ZERO) {
- reset_panner ();
- }
-
- processors_changed (); /* EMIT SIGNAL */
- return 0;
-}
-
void
Route::all_processors_flip ()
{
ProcessorCreated (this); /* EMIT SIGNAL */
}
-Send::Send (const Send& other)
- : IOProcessor (other._session, string_compose (_("send %1"), (bitslot = other._session.next_send_id()) + 1), other.placement())
-{
- _metering = false;
-
- expected_inputs.set (DataType::AUDIO, 0);
-
- /* set up the same outputs, and connect them to the same places */
-
- _io->defer_pan_reset ();
-
- for (uint32_t i = 0; i < other._io->n_outputs().get (_io->default_type()); ++i) {
- _io->add_output_port ("", 0);
- Port* p = other._io->output (i);
- if (p) {
- /* this is what the other send's output is connected to */
- std::vector<std::string> connections;
- p->get_connections (connections);
- for (uint32_t j = 0; j < connections.size(); ++j) {
- _io->connect_output (_io->output (i), connections[j], 0);
- }
- }
- }
-
- /* setup panner */
-
- _io->allow_pan_reset ();
-
- XMLNode& other_state (other._io->panner().get_state ());
- _io->panner().set_state (other_state);
-
- delete &other_state;
-
- ProcessorCreated (this); /* EMIT SIGNAL */
-}
-
Send::~Send ()
{
GoingAway ();