2019-08-02 23:10:55 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2008-2014 David Robillard <d@drobilla.net>
|
|
|
|
* Copyright (C) 2010-2018 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
* Copyright (C) 2010 Carl Hetherington <carl@carlh.net>
|
2009-10-14 12:10:01 -04:00
|
|
|
*
|
2019-08-02 23:10:55 -04:00
|
|
|
* 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.
|
2009-10-14 12:10:01 -04:00
|
|
|
*
|
2019-08-02 23:10:55 -04:00
|
|
|
* 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.
|
2009-10-14 12:10:01 -04:00
|
|
|
*
|
2008-09-18 20:47:49 -04:00
|
|
|
* 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.,
|
2019-08-02 23:10:55 -04:00
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2008-09-18 20:47:49 -04:00
|
|
|
*/
|
|
|
|
|
2010-07-13 20:58:15 -04:00
|
|
|
#include <iostream>
|
2008-09-18 20:47:49 -04:00
|
|
|
#include <limits>
|
2019-10-25 15:13:51 -04:00
|
|
|
#include "evoral/ControlSet.h"
|
|
|
|
#include "evoral/ControlList.h"
|
|
|
|
#include "evoral/Control.h"
|
|
|
|
#include "evoral/Event.h"
|
2008-09-18 20:47:49 -04:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
namespace Evoral {
|
|
|
|
|
2008-09-21 12:17:02 -04:00
|
|
|
|
2021-01-13 11:02:47 -05:00
|
|
|
ControlSet::ControlSet ()
|
2008-09-18 20:47:49 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-01-13 11:02:47 -05:00
|
|
|
ControlSet::ControlSet (ControlSet const & other)
|
2011-11-22 19:17:31 -05:00
|
|
|
: noncopyable ()
|
2010-05-18 23:03:28 -04:00
|
|
|
{
|
2011-11-22 19:17:31 -05:00
|
|
|
/* derived class must copy controls */
|
2010-05-18 23:03:28 -04:00
|
|
|
}
|
|
|
|
|
2008-09-18 20:47:49 -04:00
|
|
|
void
|
2023-02-16 18:33:28 -05:00
|
|
|
ControlSet::add_control(std::shared_ptr<Control> ac)
|
2008-09-18 20:47:49 -04:00
|
|
|
{
|
|
|
|
_controls[ac->parameter()] = ac;
|
2010-07-11 20:41:45 -04:00
|
|
|
|
2024-10-18 19:51:44 -04:00
|
|
|
ac->ListMarkedDirty.connect_same_thread (_control_connections, std::bind (&ControlSet::control_list_marked_dirty, this));
|
2010-07-13 20:58:15 -04:00
|
|
|
|
2014-08-31 18:52:37 -04:00
|
|
|
if (ac->list()) {
|
|
|
|
ac->list()->InterpolationChanged.connect_same_thread (
|
|
|
|
_list_connections,
|
2024-10-18 19:51:44 -04:00
|
|
|
std::bind (&ControlSet::control_list_interpolation_changed,
|
2014-08-31 18:52:37 -04:00
|
|
|
this, ac->parameter(), _1));
|
|
|
|
}
|
2008-09-18 20:47:49 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ControlSet::what_has_data (set<Parameter>& s) const
|
|
|
|
{
|
2012-07-25 13:48:55 -04:00
|
|
|
Glib::Threads::Mutex::Lock lm (_control_lock);
|
2011-06-11 11:35:34 -04:00
|
|
|
|
2008-09-21 12:17:02 -04:00
|
|
|
for (Controls::const_iterator li = _controls.begin(); li != _controls.end(); ++li) {
|
2011-06-11 11:35:34 -04:00
|
|
|
if (li->second->list() && !li->second->list()->empty()) {
|
|
|
|
s.insert (li->first);
|
|
|
|
}
|
2008-09-18 20:47:49 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-09-21 12:17:02 -04:00
|
|
|
/** If a control for the given parameter does not exist and \a create_if_missing is true,
|
|
|
|
* a control will be created, added to this set, and returned.
|
|
|
|
* If \a create_if_missing is false this function may return null.
|
2008-09-18 20:47:49 -04:00
|
|
|
*/
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Control>
|
2008-09-19 02:30:49 -04:00
|
|
|
ControlSet::control (const Parameter& parameter, bool create_if_missing)
|
2008-09-18 20:47:49 -04:00
|
|
|
{
|
|
|
|
Controls::iterator i = _controls.find(parameter);
|
|
|
|
|
|
|
|
if (i != _controls.end()) {
|
|
|
|
return i->second;
|
|
|
|
|
|
|
|
} else if (create_if_missing) {
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Control> ac(control_factory(parameter));
|
2008-09-18 20:47:49 -04:00
|
|
|
add_control(ac);
|
|
|
|
return ac;
|
|
|
|
|
|
|
|
} else {
|
2023-02-16 18:33:28 -05:00
|
|
|
return std::shared_ptr<Control>();
|
2008-09-18 20:47:49 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
The great audio processing overhaul.
The vast majority of Route signal processing is now simply in the list of
processors. There are definitely regressions here, but there's also
a lot of things fixed. It's far too much work to let diverge anymore
regardless, so here it is.
The basic model is: A route has a fixed set of input channels (matching
its JACK input ports and diskstream). The first processor takes this
as input. The next processor is configured using the first processor's
output as input, and is allowed to choose whatever output it wants
given that input... and so on, and so on. Finally, the last processor's
requested output is used to set up the panner and create whatever Jack
ports are needed to output the data.
All 'special' internal processors (meter, fader, amp, insert, send) are
currently transparent: they read any input, and return the same set
of channels back (unmodified, except for amp).
User visible changes:
* LV2 Instrument support (tracks with both MIDI and audio channels)
* MIDI in/out plugin support
* Generic plugin replication (for MIDI plugins, MIDI/audio plugins)
* Movable meter point
Known Bugs:
* Things seem to get weird on loaded sessions
* Output delivery is sketchy
* 2.0 session loading was probably already broken...
but it's definitely broken now :)
Please test this and file bugs if you have any time...
git-svn-id: svn://localhost/ardour2/branches/3.0@5055 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-05-07 02:30:50 -04:00
|
|
|
ControlSet::clear_controls ()
|
2008-09-18 20:47:49 -04:00
|
|
|
{
|
2012-07-25 13:48:55 -04:00
|
|
|
Glib::Threads::Mutex::Lock lm (_control_lock);
|
2008-09-18 20:47:49 -04:00
|
|
|
|
2010-07-11 20:41:45 -04:00
|
|
|
_control_connections.drop_connections ();
|
2010-07-13 20:58:15 -04:00
|
|
|
_list_connections.drop_connections ();
|
2010-07-11 20:41:45 -04:00
|
|
|
|
2014-08-31 18:52:37 -04:00
|
|
|
for (Controls::iterator li = _controls.begin(); li != _controls.end(); ++li) {
|
|
|
|
if (li->second->list()) {
|
|
|
|
li->second->list()->clear();
|
|
|
|
}
|
|
|
|
}
|
2008-09-18 20:47:49 -04:00
|
|
|
}
|
|
|
|
|
2023-08-16 11:06:10 -04:00
|
|
|
void
|
|
|
|
ControlSet::start_domain_bounce (Temporal::DomainBounceInfo& cmd)
|
|
|
|
{
|
|
|
|
for (auto & c : _controls) {
|
|
|
|
std::shared_ptr<Evoral::ControlList> cl = c.second->list();
|
|
|
|
if (cl && cl->time_domain() != cmd.to) {
|
|
|
|
cl->start_domain_bounce (cmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ControlSet::finish_domain_bounce (Temporal::DomainBounceInfo& cmd)
|
|
|
|
{
|
|
|
|
for (auto & c : _controls) {
|
|
|
|
std::shared_ptr<Evoral::ControlList> cl = c.second->list();
|
|
|
|
if (cl && cl->time_domain() != cmd.to) {
|
|
|
|
cl->finish_domain_bounce (cmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-09-18 20:47:49 -04:00
|
|
|
} // namespace Evoral
|
2018-06-21 13:05:37 -04:00
|
|
|
|
|
|
|
/* No good place for this so just put it here */
|
|
|
|
|
|
|
|
std::ostream&
|
|
|
|
std::operator<< (std::ostream & str, Evoral::Parameter const & p)
|
|
|
|
{
|
|
|
|
return str << p.type() << '-' << p.id() << '-' << (int) p.channel();
|
|
|
|
}
|
2023-08-16 11:06:10 -04:00
|
|
|
|