Patch Path on load

Feb 18, 2006 at 10:16pm

Patch Path on load

Hi,
The following code won’t work if the mxj is loaded at the same time the patch file is opened:

//gets the path of the mxj’s parent patcher
private void patchPath()
{
_patcher = this.getParentPatcher();
_patchPath = _patcher.getFilePath().substring(0, _patcher.getFilePath().lastIndexOf(‘/’) + 1);
}

You get “” as the path. If you reinitialize the mxj once the patch is loaded, then it works. Are there any plans to fix this? I’m tempted to file a bug report about this.

thanks,
wes

#24491
Feb 20, 2006 at 6:46pm

This is not necessarily specific to mxj.
Could you fix the problem by putting that code in
a loadbang method? This is called after the patch is loaded.

public void loadbang()

Topher

#70929
Feb 20, 2006 at 7:35pm

Ah, Yes I could. Right now I’ve got it hidden in an if statement when
I receive the first input, which is super ugly. I always forget that
mxj has a loadbang method.

thanks,
wes

#70930

You must be logged in to reply to this topic.