summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/AlsaDriver.cpp6
-rw-r--r--src/JackDriver.cpp8
-rw-r--r--src/PatchageModule.h7
3 files changed, 11 insertions, 10 deletions
diff --git a/src/AlsaDriver.cpp b/src/AlsaDriver.cpp
index 2f4d52e..909a710 100644
--- a/src/AlsaDriver.cpp
+++ b/src/AlsaDriver.cpp
@@ -173,7 +173,7 @@ AlsaDriver::refresh_ports()
m = new PatchageModule(m_app, client_name, InputOutput);
m->load_location();
m->store_location();
- m_canvas->add_module(m);
+ m->show();
}
if (!is_duplex) {
@@ -202,7 +202,6 @@ AlsaDriver::refresh_ports()
m = new PatchageModule(m_app, client_name, type);
m->load_location();
m->store_location();
- m_canvas->add_module(m);
}
m->add_patchage_port(port_name, is_input, ALSA_MIDI, addr);
} else { // two ports to add
@@ -217,7 +216,6 @@ AlsaDriver::refresh_ports()
m = new PatchageModule(m_app, client_name, type);
m->load_location();
m->store_location();
- m_canvas->add_module(m);
}
m->add_patchage_port(port_name, true, ALSA_MIDI, addr);
@@ -232,10 +230,10 @@ AlsaDriver::refresh_ports()
m = new PatchageModule(m_app, client_name, type);
m->load_location();
m->store_location();
- m_canvas->add_module(m);
}
m->add_patchage_port(port_name, false, ALSA_MIDI, addr);
}
+ m->show();
}
}
}
diff --git a/src/JackDriver.cpp b/src/JackDriver.cpp
index bbbd8fb..c40e589 100644
--- a/src/JackDriver.cpp
+++ b/src/JackDriver.cpp
@@ -134,7 +134,7 @@ JackDriver::refresh()
m = new PatchageModule(m_app, client1_name, type);
m->load_location();
m->store_location();
- m_canvas->add_module(m);
+ m->show();
}
// FIXME: leak? jack docs don't say
@@ -166,7 +166,11 @@ JackDriver::refresh()
port2_name = client2_name.substr(client2_name.find(':')+1);
client2_name = client2_name.substr(0, client2_name.find(':'));
- m_canvas->add_connection(client1_name, port1_name, client2_name, port2_name);
+ Port* const port1 = m_canvas->get_port(client1_name, port1_name);
+ Port* const port2 = m_canvas->get_port(client2_name, port2_name);
+
+ if (port1 && port2)
+ m_canvas->add_connection(port1, port2);
}
free(connected_ports);
}
diff --git a/src/PatchageModule.h b/src/PatchageModule.h
index b511eec..4400a68 100644
--- a/src/PatchageModule.h
+++ b/src/PatchageModule.h
@@ -55,10 +55,9 @@ public:
virtual void add_patchage_port(const string& port_name, bool is_input, PortType type)
{
- PatchagePort* port = new PatchagePort(this, type, port_name, is_input,
- m_app->state_manager()->get_port_color(type));
+ new PatchagePort(this, type, port_name, is_input, m_app->state_manager()->get_port_color(type));
- Module::add_port(port, true);
+ resize();
}
virtual void add_patchage_port(const string& port_name, bool is_input, PortType type, const snd_seq_addr_t addr)
@@ -68,7 +67,7 @@ public:
port->alsa_addr(addr);
- Module::add_port(port, true);
+ resize();
}