I had a look at the code a while ago, with the idea of using the AEC functions. However I quickly realised that it would be practically impossible to do that, and it would probably be a lot easier just writing it myself (even though that would be a hell of a job).