Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Future Dev 08: Program: fix redirection when loading preset from host
Hosts support saving current plugin state as user presets. And some hosts like REAPER will set program index to 0 when loading them. At this time, if plugin still load factory program #0, users won't get their own presets. Such a "redirection" is unexpected. One of the best solutions is: reserve factory program #0 as "initial program". No matter when host or user set to this value, plugin state will always stays untouched. Then, correspondingly, move factory programs forward by one item. Always keep in mind that programs displayed in host's menu is independent, as it's enumerated by effGetProgramNameIndexed when loading plugin instance. So, we can just let factory programs display from item amsynth#1, then when user choose factory programs, reduce choice index by 1 in effSetProgram, and this is the actual preset index kept by Amsynth preset manager.
- Loading branch information