#include "ardour/parameter_descriptor.h"
#include "ardour/plugin.h"
#include "ardour/processor.h"
+#include "ardour/readonly_control.h"
#include "ardour/sidechain.h"
#include "ardour/automation_control.h"
PluginType type ();
+ boost::shared_ptr<ReadOnlyControl> control_output (uint32_t) const;
+
std::string describe_parameter (Evoral::Parameter param);
framecnt_t signal_latency () const;
bool _latency_changed;
uint32_t _bypass_port;
+ typedef std::map<uint32_t, boost::shared_ptr<ReadOnlyControl> >CtrlOutMap;
+ CtrlOutMap _control_outputs;
+
void preset_load_set_value (uint32_t, float);
};
--- /dev/null
+/*
+ * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
+ * Copyright (C) 2000, 2007 Paul Davis
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __ardour_readonly_control_h__
+#define __ardour_readonly_control_h__
+
+#include <boost/weak_ptr.hpp>
+
+namespace ARDOUR {
+
+class Plugin;
+
+class LIBARDOUR_API ReadOnlyControl : public PBD::Destructible
+{
+public:
+ ReadOnlyControl (boost::shared_ptr<Plugin> p, uint32_t pnum);
+
+ double get_parameter () const;
+ std::string describe_parameter ();
+
+private:
+ boost::weak_ptr<Plugin> _plugin;
+ uint32_t _parameter_num;
+};
+
+} // namespace ARDOUR
+
+#endif /* __ardour_readonly_control_h__ */
PluginInsert::~PluginInsert ()
{
+ for (CtrlOutMap::const_iterator i = _control_outputs.begin(); i != _control_outputs.end(); ++i) {
+ boost::dynamic_pointer_cast<ReadOnlyControl>(i->second)->drop_references ();
+ }
}
void
set<Evoral::Parameter> a = _plugins.front()->automatable ();
for (uint32_t i = 0; i < plugin->parameter_count(); ++i) {
- if (!plugin->parameter_is_control (i) || !plugin->parameter_is_input (i)) {
+ if (!plugin->parameter_is_control (i)) {
+ continue;
+ }
+ if (!plugin->parameter_is_input (i)) {
+ _control_outputs[i] = boost::shared_ptr<ReadOnlyControl> (new ReadOnlyControl (plugin, i));
continue;
}
Evoral::Parameter param (PluginAutomation, 0, i);
}
}
+boost::shared_ptr<ReadOnlyControl>
+PluginInsert::control_output (uint32_t num) const
+{
+ CtrlOutMap::const_iterator i = _control_outputs.find (num);
+ if (i == _control_outputs.end ()) {
+ return boost::shared_ptr<ReadOnlyControl> ();
+ } else {
+ return (*i).second;
+ }
+}
string
PluginInsert::describe_parameter (Evoral::Parameter param)
--- /dev/null
+/*
+ * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
+ * Copyright (C) 2000, 2007 Paul Davis
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "pbd/destructible.h"
+
+#include "ardour/plugin.h"
+#include "ardour/readonly_control.h"
+
+using namespace ARDOUR;
+
+ReadOnlyControl::ReadOnlyControl (boost::shared_ptr<Plugin> p, uint32_t pnum)
+ : _plugin (boost::weak_ptr<Plugin> (p))
+ , _parameter_num (pnum)
+{ }
+
+double
+ReadOnlyControl::get_parameter () const
+{
+ boost::shared_ptr<Plugin> p = _plugin.lock();
+ if (p) {
+ return p->get_parameter (_parameter_num);
+ }
+ return 0;
+}
+
+std::string
+ReadOnlyControl::describe_parameter ()
+{
+ boost::shared_ptr<Plugin> p = _plugin.lock();
+ if (p) {
+ return p->describe_parameter (Evoral::Parameter (ARDOUR::PluginAutomation, 0, _parameter_num));
+ }
+ return "";
+}
'progress.cc',
'quantize.cc',
'rc_configuration.cc',
+ 'readonly_control.cc',
'recent_sessions.cc',
'record_enable_control.cc',
'record_safe_control.cc',