diff options
Diffstat (limited to 'src/client/PortModel.cpp')
-rw-r--r-- | src/client/PortModel.cpp | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp index 0d695a54..14a5297e 100644 --- a/src/client/PortModel.cpp +++ b/src/client/PortModel.cpp @@ -1,6 +1,6 @@ /* This file is part of Ingen. - Copyright 2007-2015 David Robillard <http://drobilla.net/> + Copyright 2007-2024 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 @@ -14,21 +14,22 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#include "ingen/client/PortModel.hpp" +#include <ingen/client/PortModel.hpp> -#include "ingen/Properties.hpp" -#include "ingen/URI.hpp" -#include "ingen/URIs.hpp" -#include "ingen/client/ObjectModel.hpp" -#include "lv2/urid/urid.h" +#include <ingen/Properties.hpp> +#include <ingen/URI.hpp> +#include <ingen/URIs.hpp> +#include <ingen/client/ObjectModel.hpp> +#include <lv2/urid/urid.h> +#include <sigc++/signal.h> +#include <algorithm> #include <cstdint> +#include <exception> #include <map> #include <memory> -#include <utility> -namespace ingen { -namespace client { +namespace ingen::client { void PortModel::on_property(const URI& uri, const Atom& value) @@ -61,14 +62,24 @@ PortModel::port_property(const URIs::Quark& uri) const bool PortModel::is_uri() const { - // FIXME: Resource::has_property doesn't work, URI != URID - for (const auto& p : properties()) { - if (p.second.type() == _uris.atom_URID && - static_cast<LV2_URID>(p.second.get<int32_t>()) == _uris.atom_URID) { - return true; - } - } - return false; + return std::any_of( + properties().begin(), properties().end(), [this](const auto& p) { + return (p.second.type() == _uris.atom_URID && + static_cast<LV2_URID>(p.second.template get<int32_t>()) == + _uris.atom_URID); + }); +} + +void +PortModel::add_child(const std::shared_ptr<ObjectModel>&) +{ + std::terminate(); +} + +bool +PortModel::remove_child(const std::shared_ptr<ObjectModel>&) +{ + std::terminate(); } void @@ -84,5 +95,4 @@ PortModel::set(const std::shared_ptr<ObjectModel>& model) } } -} // namespace client -} // namespace ingen +} // namespace ingen::client |