summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-06-09 16:21:00 +0000
committerDavid Robillard <d@drobilla.net>2008-06-09 16:21:00 +0000
commit384fc0ef79c717bdac6358e4b9f7c16406fdf55a (patch)
treeb8e01c8acb038973db1500d56fd34ef9e54a7209 /src
parent447bc996655de10ab687c9d36a4817681d044b61 (diff)
downloadpatchage-384fc0ef79c717bdac6358e4b9f7c16406fdf55a.tar.gz
patchage-384fc0ef79c717bdac6358e4b9f7c16406fdf55a.tar.bz2
patchage-384fc0ef79c717bdac6358e4b9f7c16406fdf55a.zip
Fix unresized modules when first connecting to Alsa Sequencer.
git-svn-id: http://svn.drobilla.net/lad/patchage@1243 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/AlsaDriver.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/AlsaDriver.cpp b/src/AlsaDriver.cpp
index 3b2703b..b0981f0 100644
--- a/src/AlsaDriver.cpp
+++ b/src/AlsaDriver.cpp
@@ -143,6 +143,8 @@ AlsaDriver::refresh_ports()
bool is_duplex = false;
bool is_application = true;
+ set< boost::shared_ptr<PatchageModule> > to_resize;
+
while (snd_seq_query_next_client (_seq, cinfo) >= 0) {
snd_seq_port_info_set_client(pinfo, snd_seq_client_info_get_client(cinfo));
snd_seq_port_info_set_port(pinfo, -1);
@@ -193,7 +195,8 @@ AlsaDriver::refresh_ports()
if (!split) {
m = _app->canvas()->find_module(client_name, InputOutput);
if (!m) {
- m = boost::shared_ptr<PatchageModule>(new PatchageModule(_app, client_name, InputOutput));
+ m = boost::shared_ptr<PatchageModule>(
+ new PatchageModule(_app, client_name, InputOutput));
m->load_location();
_app->canvas()->add_item(m);
}
@@ -205,6 +208,7 @@ AlsaDriver::refresh_ports()
m->add_port(create_port(m, port_name, true, addr));
m->add_port(create_port(m, port_name, false, addr));
}
+ to_resize.insert(m);
}
} else { // non-application input/output ports (hw interface, etc) go on separate modules
@@ -228,6 +232,7 @@ AlsaDriver::refresh_ports()
if (!m->get_port(port_name)) {
m->add_port(create_port(m, port_name, is_input, addr));
+ to_resize.insert(m);
}
} else { // two ports to add
@@ -246,6 +251,7 @@ AlsaDriver::refresh_ports()
if (!m->get_port(port_name)) {
m->add_port(create_port(m, port_name, true, addr));
+ to_resize.insert(m);
}
type = Output;
@@ -261,11 +267,17 @@ AlsaDriver::refresh_ports()
if (!m->get_port(port_name)) {
m->add_port(create_port(m, port_name, false, addr));
+ to_resize.insert(m);
}
}
}
}
}
+
+ for (set< boost::shared_ptr<PatchageModule> >::iterator i = to_resize.begin();
+ i != to_resize.end(); ++i) {
+ (*i)->resize();
+ }
}