[CLAM] multiple ports
Dirk Griffioen
dirk.griffioen at barcelonamedia.org
Fri May 15 09:37:56 PDT 2009
Hi All,
Attached you will find a patch for giving AudioSource and AudioSink
multiple ports.
I tested it manually and ran the testsuite (there is a second patch for
the testsuite).
There is one caveat: it does not seem possible to retain the old naming
scheme when loading from a .clamnetwork file where a port has the name
AudioIn or AudioOut; instead, they're now numbered (source/sinkname.number):
AudioSource.0
AudioSource.1
... etc
In the jack connections the dot becomes an underscore (AudioSource_1 ...
etc).
So the clamnetworks need to be updated - attached you will find an
commandfile for the clamrefactor.py script.
The reason for the namechange is that ports are constructed with a name
which should match with the name in the xml file, but at construcion
time this name from the xml file is not known. This went ok because the
code always had 'AudioIn/Out' and this always matched with the xml file,
as there was but one port and one portname for a source or sink.
An alternative might be to create 'unnamed' ports (add a constructor,
the default arguments are in the way), add a 'setname' function to the
port and then call this when the xml is loaded. But it seems to me this
would add a lot of complexity.
When there is only 1 port in the source/sink, the jackport is named
after the source/sink so when you have meaningfull names in your
clamnetworks, these show in the jack connection viewer.
I tested it and it looks good, but as I am new to CLAM I might missed
(obvious) things; so please review.
Best, Dirk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: multiple.patch
Type: text/x-patch
Size: 26491 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-users-clam-project.org/attachments/20090515/1634524a/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.patch
Type: text/x-patch
Size: 5231 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-users-clam-project.org/attachments/20090515/1634524a/attachment-0003.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: migrateScript
URL: <http://lists.clam-project.org/pipermail/clam-users-clam-project.org/attachments/20090515/1634524a/attachment-0001.txt>
More information about the clam-users
mailing list