getmusicbee.com

Support => Developers' Area => MusicBee API => Topic started by: boroda on September 09, 2024, 09:41:35 AM

Title: AT&RT plugin sometimes can't create its items in MB menu
Post by: boroda on September 09, 2024, 09:41:35 AM
maybe not a big issue, but it's rather annoying during plugin debugging, when i frequently start MB from VS and try to use plugin's menu items too quickly. also, some plugin users have reported this issue earlier.

this "bug" appears when i access MB main menu before plugin has created its menu items. in this case, plugin will never create menu items using:

Code
MbApiInterface.MB_AddMenuItem("mnuTools/[1]" + PluginMenuGroupName, null, null);

only the MB restart helps.

this also means that plugin can't create menu items if it's manually enabled in MB prefs> plugins. i think, because i usually open MB prefs using MB menu (i.e. i use MB menu before plugin creates its menu items).

P.S. this issue doesn't concern MB context menu items created with:

Code
MbApiInterface.MB_AddMenuItem("context.Main/" + PluginMenuGroupName, null, null) ;

P.P.S. new guess: maybe "[1]" in MB_AddMenuItem("mnuTools/[1]") matters.
Title: Re: AT&RT plugin sometimes can't create its items in MB menu
Post by: boroda on September 11, 2024, 11:39:33 AM
P.P.S. new guess: maybe "[1]" in MB_AddMenuItem("mnuTools/[1]") matters.

no, the issue persists after removing "[1]".