2 * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
3 * Copyright (C) 2000, 2007 Paul Davis
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #include "pbd/destructible.h"
22 #include "ardour/plugin.h"
23 #include "ardour/readonly_control.h"
25 using namespace ARDOUR;
27 ReadOnlyControl::ReadOnlyControl (boost::shared_ptr<Plugin> p, const ParameterDescriptor& desc, uint32_t pnum)
28 : _plugin (boost::weak_ptr<Plugin> (p))
30 , _parameter_num (pnum)
34 ReadOnlyControl::get_parameter () const
36 boost::shared_ptr<Plugin> p = _plugin.lock();
38 return p->get_parameter (_parameter_num);
44 ReadOnlyControl::describe_parameter ()
46 boost::shared_ptr<Plugin> p = _plugin.lock();
48 return p->describe_parameter (Evoral::Parameter (ARDOUR::PluginAutomation, 0, _parameter_num));