summaryrefslogtreecommitdiffstats
path: root/src/PatchageEvent.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-12-14 20:47:05 +0000
committerDavid Robillard <d@drobilla.net>2010-12-14 20:47:05 +0000
commit5a260f5e574ad8e33cd5528c214b4a25b18e248e (patch)
tree1b02ea3f4e50677ff9cf6086ffc8062f9cab7279 /src/PatchageEvent.cpp
parentd9a54049e99f6c3963e1f48e04b9a7adcd81899b (diff)
downloadpatchage-5a260f5e574ad8e33cd5528c214b4a25b18e248e.tar.gz
patchage-5a260f5e574ad8e33cd5528c214b4a25b18e248e.tar.bz2
patchage-5a260f5e574ad8e33cd5528c214b4a25b18e248e.zip
Better error messages.
git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@2685 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/PatchageEvent.cpp')
-rw-r--r--src/PatchageEvent.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/PatchageEvent.cpp b/src/PatchageEvent.cpp
index c408f59..3085585 100644
--- a/src/PatchageEvent.cpp
+++ b/src/PatchageEvent.cpp
@@ -52,7 +52,7 @@ PatchageEvent::execute(Patchage* patchage)
patchage->canvas()->remove_item(module);
module.reset();
} else {
- Raul::error << "Unable to find client " << _str << " to remove" << endl;
+ Raul::error << "Unable to find client `" << _str << "' to remove" << endl;
}
free(_str);
@@ -76,9 +76,9 @@ PatchageEvent::execute(Patchage* patchage)
if (port)
patchage->enqueue_resize(port->module().lock());
else
- Raul::error << "Unable to create port view" << endl;
+ Raul::error << "Unable to create port view: " << _port_1 << endl;
} else {
- Raul::error << "Attempt to create port with unknown type" << endl;
+ Raul::error << "Attempt to create port with unknown type: " << _port_1 << endl;
}
} else if (_type == PORT_DESTRUCTION) {
@@ -102,7 +102,7 @@ PatchageEvent::execute(Patchage* patchage)
}
} else {
- Raul::error << "Unable to find port to destroy" << endl;
+ Raul::error << "Unable to find port `" << _port_1 << "' to destroy" << endl;
}
} else if (_type == CONNECTION) {
@@ -110,20 +110,24 @@ PatchageEvent::execute(Patchage* patchage)
SharedPtr<PatchagePort> port_1 = patchage->canvas()->find_port(_port_1);
SharedPtr<PatchagePort> port_2 = patchage->canvas()->find_port(_port_2);
- if (port_1 && port_2)
- patchage->canvas()->add_connection(port_1, port_2, port_1->color() + 0x22222200);
+ if (!port_1)
+ Raul::error << "Unable to find port `" << _port_1 << "' to connect" << endl;
+ else if (!port_2)
+ Raul::error << "Unable to find port `" << _port_2 << "' to connect" << endl;
else
- Raul::error << "Unable to find port to connect" << endl;
+ patchage->canvas()->add_connection(port_1, port_2, port_1->color() + 0x22222200);
} else if (_type == DISCONNECTION) {
SharedPtr<PatchagePort> port_1 = patchage->canvas()->find_port(_port_1);
SharedPtr<PatchagePort> port_2 = patchage->canvas()->find_port(_port_2);
- if (port_1 && port_2)
- patchage->canvas()->remove_connection(port_1, port_2);
+ if (!port_1)
+ Raul::error << "Unable to find port `" << _port_1 << "' to disconnect" << endl;
+ else if (!port_2)
+ Raul::error << "Unable to find port `" << _port_2 << "' to disconnect" << endl;
else
- Raul::error << "Unable to find port to disconnect" << endl;
+ patchage->canvas()->remove_connection(port_1, port_2);
}
}