On 28.06.24 19:21, ichthyo wrote:
as indicated, currently I am involved in an attempt to rework some of
Yoshimi's main application and instance handling logic.
...
The idea is to turn the main() code inside-out -- or better outside-in....
- define a new component, which I call InstanceManager
....
As said, the above can be considered a draft and work in progress still;
...


Hi Yoshimi-developers,

some time has passed, with a lots of development, testing and also several
discussions off-list. It seems indicated to summarise the current state
regarding this effort to improve the GUI connection, and as follow-up the
application start and instance handling.

The concept to have a central InstanceManager handle all Engine instances
and most of application lifecycle could be brought to fruition. My feature
branch now provides a massively reworked and simplified main.cpp, together
with a consolidated LV2 plugin, now both delegating to InstanceManager.
Any creation of SyntEngine instances, and all startup and shutdown activities
are collected into a single piece of code. The LV2 plugin is now integrated
as a special case into the MusicClient, making it a first-class participant
and removing several after-the-fact hacks and global variables, which were
previously used to hook it into a code base not initially prepared to handle
such a structure and elaborate lifecycle state.

During integration and testing, Will and myself were able to identify and
resolve some problems with config loading and automated restoring of instance
state. In a fun experiment, I was able get 32 Yoshimi instances launched
automatically and later shut down cleanly. Obviously, my system went into
swapping and produced lots of XRuns, but in the end, all instances
unwound without crash, persisting their current window positions.

As a by-product, the modernisation of the code base could be picked-up and
furthered. Several manually handled new / delete cycles and even malloc
usages and hand written destructor logic was replaced by smart-pointers,
thereby also improving exception safety and removing possible memory leaks.
Lots of objects were made non-copyable, pointers were replaced by references,
some time-grown and convoluted initialisation logic could be disentangled.
We start to use more features from the modern C++ standard library, notably
we now use the "Chrono" framework for most timing and timed waiting tasks.

Needless to say -- this kind of clean-up and refactoring work always bears
the danger of unintentional breakage. The code on the feature branch is in
test currently. Notably we have to sort out a problem when using the LV2
host "Carla" and we observed a burst of XRuns on instance start with
Jack, which we do not fully understand yet.

-- Hermann



_______________________________________________
Yoshimi-devel mailing list
Yoshimi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/yoshimi-devel

Reply via email to