diff options
Diffstat (limited to 'ingen/client/ParameterModel.hpp')
-rw-r--r-- | ingen/client/ParameterModel.hpp | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/ingen/client/ParameterModel.hpp b/ingen/client/ParameterModel.hpp new file mode 100644 index 00000000..692c0108 --- /dev/null +++ b/ingen/client/ParameterModel.hpp @@ -0,0 +1,63 @@ +/* + This file is part of Ingen. + Copyright 2016 David Robillard <http://drobilla.net/> + + Ingen is free software: you can redistribute it and/or modify it under the + terms of the GNU Affero General Public License as published by the Free + Software Foundation, either version 3 of the License, or any later version. + + Ingen 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 Affero General Public License for details. + + You should have received a copy of the GNU Affero General Public License + along with Ingen. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef INGEN_CLIENT_PARAMETERMODEL_HPP +#define INGEN_CLIENT_PARAMETERMODEL_HPP + +#include <cstdlib> +#include <string> + +#include "ingen/client/ObjectModel.hpp" + +namespace Raul { class Path; } + +namespace Ingen { +namespace Client { + +/** Model of a parameter. + * + * @ingroup IngenClient + */ +class INGEN_API ParameterModel : public ObjectModel +{ +public: + GraphType graph_type() const { return Node::GraphType::PARAMETER; } + + inline const Atom& value() const { return get_property(_uris.ingen_value); } + inline bool is_input() const { return true; } + inline bool is_output() const { return true; } + + inline bool operator==(const ParameterModel& pm) const { return (path() == pm.path()); } + + void on_property(const Raul::URI& uri, const Atom& value) {} + + INGEN_SIGNAL(value_changed, void, const Atom&); + +private: + friend class ClientStore; + + ParameterModel(URIs& uris, + const Raul::Path& path) + : ObjectModel(uris, path) + {} + + void set(SPtr<ObjectModel> model) {} +}; + +} // namespace Client +} // namespace Ingen + +#endif // INGEN_CLIENT_PARAMETERMODEL_HPP |