summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/ClientStore.cpp19
-rw-r--r--src/client/PatchModel.cpp15
-rw-r--r--src/client/PatchModel.hpp15
3 files changed, 23 insertions, 26 deletions
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp
index b12cdd7b..8a6e008b 100644
--- a/src/client/ClientStore.cpp
+++ b/src/client/ClientStore.cpp
@@ -249,10 +249,10 @@ void
ClientStore::put(const URI& uri, const Resource::Properties& properties)
{
typedef Resource::Properties::const_iterator iterator;
- LOG(debug) << "PUT " << uri << " {" << endl;
+ /*LOG(info) << "PUT " << uri << " {" << endl;
for (iterator i = properties.begin(); i != properties.end(); ++i)
- LOG(debug) << " " << i->first << " = " << i->second << " :: " << i->second.type() << endl;
- LOG(debug) << "}" << endl;
+ LOG(info) << " " << i->first << " = " << i->second << " :: " << i->second.type() << endl;
+ LOG(info) << "}" << endl;*/
bool is_path = Path::is_valid(uri.str());
bool is_meta = ResourceImpl::is_meta_uri(uri);
@@ -292,11 +292,7 @@ ClientStore::put(const URI& uri, const Resource::Properties& properties)
ResourceImpl::type(properties, is_patch, is_node, is_port, is_output, data_type);
if (is_patch) {
- uint32_t poly = 1;
- iterator p = properties.find(uris.ingen_polyphony);
- if (p != properties.end() && p->second.is_valid() && p->second.type() == Atom::INT)
- poly = p->second.get_int32();
- SharedPtr<PatchModel> model(new PatchModel(path, poly));
+ SharedPtr<PatchModel> model(new PatchModel(path));
model->set_properties(properties);
add_object(model);
} else if (is_node) {
@@ -340,6 +336,13 @@ ClientStore::put(const URI& uri, const Resource::Properties& properties)
void
ClientStore::delta(const URI& uri, const Resource::Properties& remove, const Resource::Properties& add)
{
+ typedef Resource::Properties::const_iterator iterator;
+ /*LOG(info) << "DELTA " << uri << " {" << endl;
+ for (iterator i = remove.begin(); i != remove.end(); ++i)
+ LOG(info) << " - " << i->first << " = " << i->second << " :: " << i->second.type() << endl;
+ for (iterator i = add.begin(); i != add.end(); ++i)
+ LOG(info) << " + " << i->first << " = " << i->second << " :: " << i->second.type() << endl;
+ LOG(info) << "}" << endl;*/
bool is_meta = ResourceImpl::is_meta_uri(uri);
string path_str = is_meta ? (string("/") + uri.chop_start("#")) : uri.str();
if (!Path::is_valid(path_str)) {
diff --git a/src/client/PatchModel.cpp b/src/client/PatchModel.cpp
index 7d44eb1c..bf4168d6 100644
--- a/src/client/PatchModel.cpp
+++ b/src/client/PatchModel.cpp
@@ -169,22 +169,19 @@ PatchModel::enabled() const
}
-Raul::Atom&
-PatchModel::set_meta_property(const Raul::URI& key, const Atom& value)
+uint32_t
+PatchModel::internal_poly() const
{
- if (key == Shared::LV2URIMap::instance().ingen_polyphony)
- _poly = value.get_int32();
-
- return NodeModel::set_meta_property(key, value);
+ const Raul::Atom& poly = get_property(Shared::LV2URIMap::instance().ingen_polyphony);
+ return poly.is_valid() ? poly.get_int32() : 1;
}
bool
PatchModel::polyphonic() const
{
- return (_parent)
- ? (_poly > 1) && _poly == PtrCast<PatchModel>(_parent)->poly() && _poly > 1
- : (_poly > 1);
+ const Raul::Atom& poly = get_property(Shared::LV2URIMap::instance().ingen_polyphonic);
+ return poly.is_valid() && poly.get_bool();
}
diff --git a/src/client/PatchModel.hpp b/src/client/PatchModel.hpp
index d87c4ee8..1590aa10 100644
--- a/src/client/PatchModel.hpp
+++ b/src/client/PatchModel.hpp
@@ -46,10 +46,11 @@ public:
SharedPtr<ConnectionModel> get_connection(const Raul::Path& src_port_path,
const Raul::Path& dst_port_path) const;
- uint32_t poly() const { return _poly; }
- uint32_t internal_polyphony() const { return _poly; }
- bool enabled() const;
- bool polyphonic() const;
+ //uint32_t poly() const { return _poly; }
+ bool enabled() const;
+ bool polyphonic() const;
+
+ uint32_t internal_poly() const;
/** "editable" = arranging,connecting,adding,deleting,etc
* not editable (control mode) you can just change controllers (performing)
@@ -62,8 +63,6 @@ public:
}
}
- virtual Raul::Atom& set_meta_property(const Raul::URI& key, const Raul::Atom& value);
-
// Signals
sigc::signal<void, SharedPtr<NodeModel> > signal_new_node;
sigc::signal<void, SharedPtr<NodeModel> > signal_removed_node;
@@ -74,10 +73,9 @@ public:
private:
friend class ClientStore;
- PatchModel(const Raul::Path& patch_path, size_t internal_poly)
+ PatchModel(const Raul::Path& patch_path)
: NodeModel("http://drobilla.net/ns/ingen#Patch", patch_path)
, _connections(new Connections())
- , _poly(internal_poly)
, _editable(true)
{
}
@@ -90,7 +88,6 @@ private:
void remove_connection(const Raul::Path& src_port_path, const Raul::Path& dst_port_path);
SharedPtr<Connections> _connections;
- uint32_t _poly;
bool _editable;
};