Improve a2jmidid integration:

* "a2j" is put in port name to allow identification of bridged ports
 * alsa seq client id is put in port name to allow multiple alsa
   clients with same name to be displayed on canvas
This commit is contained in:
Nedko Arnaudov 2008-10-28 00:09:16 +02:00
parent baba22b014
commit e23c9035ff
3 changed files with 11 additions and 6 deletions

View File

@ -667,15 +667,18 @@ Patchage::on_port_added(
bool is_a2j_mapped;
string canvas_client_name;
string canvas_port_name;
uint32_t alsa_client_id;
boost::shared_ptr<PatchageModule> module;
is_a2j_mapped = strcmp(_a2j->get_jack_client_name(), jack_client_name) == 0;
if (is_a2j_mapped)
{
if (!_a2j->map_jack_port(jack_port_name, canvas_client_name, canvas_port_name))
if (!_a2j->map_jack_port(jack_port_name, canvas_client_name, canvas_port_name, alsa_client_id))
{
return;
}
canvas_port_name = str(boost::format(canvas_port_name + " [a2j:%u]") % alsa_client_id);
}
else
{
@ -692,8 +695,7 @@ Patchage::on_port_added(
}
}
boost::shared_ptr<PatchageModule> module = _canvas->find_module(canvas_client_name, module_type);
module = _canvas->find_module(canvas_client_name, module_type);
if (!module) {
module = boost::shared_ptr<PatchageModule>(new PatchageModule(this, canvas_client_name, module_type));
module->load_location();

View File

@ -258,7 +258,8 @@ bool
a2j_proxy::map_jack_port(
const char * jack_port_name,
string& alsa_client_name_ref,
string& alsa_port_name_ref)
string& alsa_port_name_ref,
uint32_t& alsa_client_id_ref)
{
DBusMessage * reply_ptr;
dbus_uint32_t alsa_client_id;
@ -299,6 +300,7 @@ a2j_proxy::map_jack_port(
alsa_client_name_ref = alsa_client_name;
alsa_port_name_ref = alsa_port_name;
alsa_client_id_ref = alsa_client_id;
dbus_message_unref(reply_ptr);

View File

@ -38,7 +38,8 @@ public:
map_jack_port(
const char * jack_port_name,
string& alsa_client_name,
string& alsa_port_name);
string& alsa_port_name,
uint32_t& alsa_client_id);
void
start_bridge();