I am a developer of audio-processing plugins, and currently interested in using CEF to implement Web-based GUI.
I've been playing around with CEF for almost a week now, and I came across a few issues and dilemmas.
I would really appreciate any form of help/tips/thoughts regarding my progress so far.
First, some limitations of being an audio plugin, that should be taken into consideration:
- A plugin is a small module, deployed as a dynamic lib. It has no executable and has to be loaded within a context of a host application - a DAW (Digital Audio Workstation).
- When being shown on screen, the host application supplies the plugin with a window handle. The plugin is expected to handle draw/paint events which are sent to this handle from the host application. (The plugin is still alive and does processing even when the user hides its window).
A note regarding the current plugin infrastructure (might be worth noting):
- There is a shell module which is created when the first plugin is loaded and destroyed when the host application quits. It is global to all loaded plugins.
Here are the issues that seem pretty crucial to me at the moment:
- The plugins are currently supported by over 30 different host applications, and I can’t guarantee that everyone would be cool with implementing the CefAppProtocol. Is there any way around this? Even by sacrificing some functionality (a plugin is anyway much more light-weight than an application). I currently have a Monkey Patch using Method Swizzling, and it feels a little hackish. I’m pretty new to Objective C development and wanted to know if this approach is acceptable, or should I expect some serious bugs? (reimplementing NSApp methods sounds kinda serious).
- I have no access to the application’s main message loop. I am dependent on the draw/paint events I receive whenever my window is being shown, and that’s it. Currently, I am calling CefDoMessageLoopWork() on each plugin’s draw event, but it seems a bit excessive. Any idea how to address this issue? Should I try Method Swizzling again?
In general, referring to the CEF sample projects, I see it as the shell being a CefApp, and every loaded plugin being a CefClient. I am currently able to embed a browser inside a plugin (although extremely buggy and unstable). Development is being done under Mac at the moment, but a Windows version is also planned (So if you foresee any issues there, I would be glad to hear them).
I know that this is not the typical application setup, but I feel that this is doable with CEF, so I would love to hear from you guys what you think, any pieces of advice, tips, and remarks. (I would prefer leaving CEF and Chromium frameworks untouched, so it could be deployed separately, as Chromium updates pretty frequently).
Thanks in advance!