Disconnecting working in GTK client
git-svn-id: http://svn.drobilla.net/lad@33 a436a847-0d15-0410-975c-d299462d15a1
This commit is contained in:
parent
e1666be60f
commit
469a35b785
|
@ -209,12 +209,12 @@ PatchModel::remove_connection(const string& src_port_path, const string& dst_por
|
||||||
if (cm->src_port_path() == src_port_path && cm->dst_port_path() == dst_port_path) {
|
if (cm->src_port_path() == src_port_path && cm->dst_port_path() == dst_port_path) {
|
||||||
m_connections.erase(i); // cuts our reference
|
m_connections.erase(i); // cuts our reference
|
||||||
assert(!get_connection(src_port_path, dst_port_path)); // no duplicates
|
assert(!get_connection(src_port_path, dst_port_path)); // no duplicates
|
||||||
|
removed_connection_sig.emit(src_port_path, dst_port_path);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cerr << "[PatchModel::remove_connection] WARNING: Failed to find connection " <<
|
cerr << "[PatchModel::remove_connection] WARNING: Failed to find connection " <<
|
||||||
src_port_path << " -> " << dst_port_path << endl;
|
src_port_path << " -> " << dst_port_path << endl;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -70,8 +70,9 @@ public:
|
||||||
bool polyphonic() const;
|
bool polyphonic() const;
|
||||||
|
|
||||||
// Signals
|
// Signals
|
||||||
sigc::signal<void, CountedPtr<NodeModel> > new_node_sig;
|
sigc::signal<void, CountedPtr<NodeModel> > new_node_sig;
|
||||||
sigc::signal<void, CountedPtr<ConnectionModel> > new_connection_sig;
|
sigc::signal<void, CountedPtr<ConnectionModel> > new_connection_sig;
|
||||||
|
sigc::signal<void, const string&, const string& > removed_connection_sig;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Prevent copies (undefined)
|
// Prevent copies (undefined)
|
||||||
|
|
|
@ -34,6 +34,7 @@ Store::Store(SigClientInterface& emitter)
|
||||||
emitter.new_node_sig.connect(sigc::mem_fun(this, &Store::new_node_event));
|
emitter.new_node_sig.connect(sigc::mem_fun(this, &Store::new_node_event));
|
||||||
emitter.new_port_sig.connect(sigc::mem_fun(this, &Store::new_port_event));
|
emitter.new_port_sig.connect(sigc::mem_fun(this, &Store::new_port_event));
|
||||||
emitter.connection_sig.connect(sigc::mem_fun(this, &Store::connection_event));
|
emitter.connection_sig.connect(sigc::mem_fun(this, &Store::connection_event));
|
||||||
|
emitter.disconnection_sig.connect(sigc::mem_fun(this, &Store::disconnection_event));
|
||||||
emitter.metadata_update_sig.connect(sigc::mem_fun(this, &Store::metadata_update_event));
|
emitter.metadata_update_sig.connect(sigc::mem_fun(this, &Store::metadata_update_event));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,5 +293,22 @@ Store::connection_event(const string& src_port_path, const string& dst_port_path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Store::disconnection_event(const string& src_port_path, const string& dst_port_path)
|
||||||
|
{
|
||||||
|
const Path& src = src_port_path;
|
||||||
|
const Path& dst = dst_port_path;
|
||||||
|
|
||||||
|
assert(src.parent().parent() == dst.parent().parent());
|
||||||
|
const Path& patch_path = src.parent().parent();
|
||||||
|
|
||||||
|
CountedPtr<PatchModel> patch = this->patch(patch_path);
|
||||||
|
if (patch)
|
||||||
|
patch->remove_connection(src, dst);
|
||||||
|
else
|
||||||
|
cerr << "ERROR: connection in nonexistant patch" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace LibOmClient
|
} // namespace LibOmClient
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,7 @@ private:
|
||||||
void new_port_event(const string& path, const string& data_type, bool is_output);
|
void new_port_event(const string& path, const string& data_type, bool is_output);
|
||||||
void metadata_update_event(const string& subject_path, const string& predicate, const string& value);
|
void metadata_update_event(const string& subject_path, const string& predicate, const string& value);
|
||||||
void connection_event(const string& src_port_path, const string& dst_port_path);
|
void connection_event(const string& src_port_path, const string& dst_port_path);
|
||||||
|
void disconnection_event(const string& src_port_path, const string& dst_port_path);
|
||||||
|
|
||||||
map<string, CountedPtr<ObjectModel> > m_objects; ///< Keyed by Om path
|
map<string, CountedPtr<ObjectModel> > m_objects; ///< Keyed by Om path
|
||||||
map<string, CountedPtr<PluginModel> > m_plugins; ///< Keyed by URI
|
map<string, CountedPtr<PluginModel> > m_plugins; ///< Keyed by URI
|
||||||
|
|
|
@ -72,6 +72,7 @@ PatchController::PatchController(CountedPtr<PatchModel> model)
|
||||||
|
|
||||||
model->new_node_sig.connect(sigc::mem_fun(this, &PatchController::add_node));
|
model->new_node_sig.connect(sigc::mem_fun(this, &PatchController::add_node));
|
||||||
model->new_connection_sig.connect(sigc::mem_fun(this, &PatchController::connection));
|
model->new_connection_sig.connect(sigc::mem_fun(this, &PatchController::connection));
|
||||||
|
model->removed_connection_sig.connect(sigc::mem_fun(this, &PatchController::disconnection));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -599,7 +600,7 @@ PatchController::disconnection(const Path& src_port_path, const Path& dst_port_p
|
||||||
m_patch_view->canvas()->remove_connection(
|
m_patch_view->canvas()->remove_connection(
|
||||||
src_node_name, src_port_name, dst_node_name, dst_port_name);
|
src_node_name, src_port_name, dst_node_name, dst_port_name);
|
||||||
|
|
||||||
patch_model()->remove_connection(src_port_path, dst_port_path);
|
//patch_model()->remove_connection(src_port_path, dst_port_path);
|
||||||
|
|
||||||
cerr << "FIXME: disconnection\n";
|
cerr << "FIXME: disconnection\n";
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue