@Lindon said in Player and expansion communication......:
@David-Healey state is simply "open" or "closed" (0 or 1) for every library (which has categories in it) and Categories(which have instruments in them)
State needs to be transferable BOTH ways so we start with all libs closed....
In the player we open LibA, open CatA and load InstrumentAA
InstrumentAA opens and displays the LibPanel with all libs closed except LibA, and within that CatA is also open...
In instrumentAA we close LibA and Open LibB, then we close InstrumentAA,
The player opens with all libs closed except LibB
The problem(well theres a truck load of problems..) here is I can see how I can save state (in some file) and read it on plugin(player) load...and as soon as the user requests a load of an instrumetn we write the current states to the file.
The instrument reads this state file on load and sets the display correctly. On instrument unload (so the instrument is unloading itself) the instrument saves the new state(assuming its changed) and unloads itself.....
..but I dont know how the player now reads this new state file in any efficient manner- meaning not running a timer every 0.5 seconds to re-read the state file......???
The player never knows the instrument is now unloaded does it? Or can it tell from
ExpansionHandler.getCurrentExpansion() if it == "" then whatever it loaded is now unloaded... ???