on project load adjust canvas positions of capture/playback clients

This commit is contained in:
Nedko Arnaudov 2010-08-30 04:52:35 +03:00
parent fc0a6b14be
commit 8f20db7de0
3 changed files with 68 additions and 0 deletions

View File

@ -2398,6 +2398,71 @@ bool ladish_graph_looks_empty(ladish_graph_handle graph_handle)
return true;
}
/* Trick the world that graph objects disappear and the reapper so the new dict values are fetched */
/* This is a nasty hack and should be removed once dict object can emit signals */
void ladish_graph_trick_dicts(ladish_graph_handle graph_handle)
{
struct list_head * node_ptr;
struct ladish_graph_connection * connection_ptr;
struct ladish_graph_client * client_ptr;
struct ladish_graph_port * port_ptr;
list_for_each(node_ptr, &graph_ptr->connections)
{
connection_ptr = list_entry(node_ptr, struct ladish_graph_connection, siblings);
if (!connection_ptr->hidden)
{
graph_ptr->graph_version++;
ladish_graph_emit_ports_disconnected(graph_ptr, connection_ptr);
}
}
list_for_each(node_ptr, &graph_ptr->ports)
{
port_ptr = list_entry(node_ptr, struct ladish_graph_port, siblings_graph);
if (!port_ptr->hidden)
{
graph_ptr->graph_version++;
ladish_graph_emit_port_disappeared(graph_ptr, port_ptr);
}
}
list_for_each(node_ptr, &graph_ptr->clients)
{
client_ptr = list_entry(node_ptr, struct ladish_graph_client, siblings);
if (!client_ptr->hidden)
{
graph_ptr->graph_version++;
ladish_graph_emit_client_disappeared(graph_ptr, client_ptr);
graph_ptr->graph_version++;
ladish_graph_emit_client_appeared(graph_ptr, client_ptr);
}
}
list_for_each(node_ptr, &graph_ptr->ports)
{
port_ptr = list_entry(node_ptr, struct ladish_graph_port, siblings_graph);
if (!port_ptr->hidden)
{
graph_ptr->graph_version++;
ladish_graph_emit_port_appeared(graph_ptr, port_ptr);
}
}
list_for_each(node_ptr, &graph_ptr->connections)
{
connection_ptr = list_entry(node_ptr, struct ladish_graph_connection, siblings);
if (!connection_ptr->hidden)
{
graph_ptr->graph_version++;
ladish_graph_emit_ports_connected(graph_ptr, connection_ptr);
}
}
}
#undef graph_ptr
#define graph_ptr ((struct ladish_graph *)context)

View File

@ -226,6 +226,8 @@ void ladish_graph_set_persist(ladish_graph_handle graph_handle);
bool ladish_graph_is_persist(ladish_graph_handle graph_handle);
bool ladish_graph_looks_empty(ladish_graph_handle graph_handle);
void ladish_graph_trick_dicts(ladish_graph_handle graph_handle);
extern const struct dbus_interface_descriptor g_interface_patchbay;
#endif /* #ifndef PATCHBAY_H__30334B9A_8847_4E8C_AFF9_73DB13406C8E__INCLUDED */

View File

@ -734,6 +734,7 @@ bool ladish_room_load_project(ladish_room_handle room_handle, const char * proje
/* ladish_graph_dump(room_ptr->graph); */
ladish_app_supervisor_set_directory(room_ptr->app_supervisor, project_dir);
ladish_graph_trick_dicts(room_ptr->graph);
ladish_app_supervisor_autorun(room_ptr->app_supervisor);
ret = true;