Thanks Dirk, I will review and apply the patch.
Let's move (well, continue) the discussion in clam-devel ml, though .
P
En/na Dirk Griffioen ha escrit:
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
------------------------------------------------------------------------
_______________________________________________
CLAM mailing list
[email protected]
http://clam.iua.upf.edu
_______________________________________________
CLAM mailing list
[email protected]
http://clam.iua.upf.edu