Hi all. I'm working on a Pd external which encapsulates the audio language RTcmix, based on Brad Garton's [rtcmix~] Max object. The language and its audio functions are in a dylib in the external's directory.
My problem is that the external needs to know its own path in order to correctly find and reference the dylib. Max has nameinpath() and path_topathname() which help with this. Pd's open_via_path() won't work here because the path is the unknown.
Does anyone have a suggestion about how to access the external's path dynamically?
Thanks! Joel
If you know the filename, you can call open_via_path which returns the directory the file was eventually found in -- then you can close the file but keep the directory name for later use.
cheers Miller
On Tue, Sep 11, 2012 at 12:56:47PM -0400, Joel Matthys wrote:
Hi all. I'm working on a Pd external which encapsulates the audio language RTcmix, based on Brad Garton's [rtcmix~] Max object. The language and its audio functions are in a dylib in the external's directory.
My problem is that the external needs to know its own path in order to correctly find and reference the dylib. Max has nameinpath() and path_topathname() which help with this. Pd's open_via_path() won't work here because the path is the unknown.
Does anyone have a suggestion about how to access the external's path dynamically?
Thanks! Joel
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On 2012-09-11 12:56, Joel Matthys wrote:
Hi all. I'm working on a Pd external which encapsulates the audio language RTcmix, based on Brad Garton's [rtcmix~] Max object. The language and its audio functions are in a dylib in the external's directory.
My problem is that the external needs to know its own path in order to correctly find and reference the dylib. Max has nameinpath() and path_topathname() which help with this. Pd's open_via_path() won't work here because the path is the unknown.
Does anyone have a suggestion about how to access the external's path dynamically?
If you have a t_class *c as returned by class_new() then you can do: char *path = c->c_externdir->s_name;
You might have to #include "m_imp.h" // for struct _class
Martin