public PluginInfo Initialise(IntPtr apiInterfacePtr) { mbApiInterface = new MusicBeeApiInterface(); mbApiInterface.Initialise(apiInterfacePtr); EventHandler IncrementPlayCount_Event = new EventHandler(IncrementPlayCount); mbApiInterface.MB_RegisterCommand("Tools: Increment PlayCount", IncrementPlayCount_Event); mbApiInterface.MB_AddMenuItem("mnuTools/Increment PlayCount", null, IncrementPlayCount_Event); //ToolStripMenuItem contextMenu = (ToolStripMenuItem)mbApiInterface.MB_AddMenuItem("context.Main/Increment PlayCount", null, IncrementPlayCount_Event); //contextMenu.DropDown.Items.Add("Increment PlayCount", null, IncrementPlayCount_Event); about.PluginInfoVersion = PluginInfoVersion; about.Name = "Increment PlayCount"; about.Description = "This plugin increments the PlayCount for the selected tracks."; about.Author = "maziara"; about.TargetApplication = ""; // current only applies to artwork, lyrics or instant messenger name that appears in the provider drop down selector or target Instant Messenger about.Type = PluginType.General; about.VersionMajor = 1; // your plugin version about.VersionMinor = 0; about.Revision = 0; about.MinInterfaceVersion = MinInterfaceVersion; about.MinApiRevision = MinApiRevision; about.ReceiveNotifications = (ReceiveNotificationFlags.PlayerEvents | ReceiveNotificationFlags.TagEvents); about.ConfigurationPanelHeight = 0; // height in pixels that musicbee should reserve in a panel for config settings. When set, a handle to an empty panel will be passed to the Configure function return(about); }
// receive event notifications from MusicBee // you need to set about.ReceiveNotificationFlags = PlayerEvents to receive all notifications, and not just the startup event public void ReceiveNotification(string sourceFileUrl, NotificationType type) { switch (type) { case NotificationType.PluginStartup: mbApiInterface.MB_RegisterCommand("General: Search for Clipboard Text", searchLibrary); break; } }
public PluginInfo Initialise(IntPtr apiInterfacePtr) { mbApiInterface = new MusicBeeApiInterface(); mbApiInterface.Initialise(apiInterfacePtr); about.PluginInfoVersion = PluginInfoVersion; about.Name = "MusicBee Chromecast"; about.Description = "Adds casting functionality to MusicBee"; about.Author = "Troy Fernandes"; about.TargetApplication = ""; // current only applies to artwork, lyrics or instant messenger name that appears in the provider drop down selector or target Instant Messenger about.Type = PluginType.General; about.VersionMajor = 2; // your plugin version about.VersionMinor = 0; about.Revision = 1; about.MinInterfaceVersion = MinInterfaceVersion; about.MinApiRevision = MinApiRevision; about.ReceiveNotifications = (ReceiveNotificationFlags.PlayerEvents | ReceiveNotificationFlags.TagEvents); about.ConfigurationPanelHeight = 25; // height in pixels that musicbee should reserve in a panel for config settings. When set, a handle to an empty panel will be passed to the Configure function mbApiInterface.MB_RegisterCommand("Chromecast", OnChromecastSelection); ToolStripMenuItem mainMenuItem = (ToolStripMenuItem)mbApiInterface.MB_AddMenuItem("mnuTools/MB Chromecast", null, null); mainMenuItem.DropDown.Items.Add("Check Status", null, ShowStatusInMessagebox); mainMenuItem.DropDown.Items.Add("Disconnect from Chromecast", null, (sender, e) => DisconnectFromChromecast(sender, e, false)); ReadSettings(); _ = EmptyDirectory(); fileDeletionTimer = new System.Timers.Timer(); fileDeletionTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent); fileDeletionTimer.Interval = 10000; filenameStack = new IterableStack <string>(); songHash = new SongHash(); progressTimer = new System.Timers.Timer(); progressTimer.Elapsed += new ElapsedEventHandler(DoSomething); return(about); }
public PluginInfo Initialise(IntPtr apiInterfacePtr) { mbApiInterface = new MusicBeeApiInterface(); mbApiInterface.Initialise(apiInterfacePtr); about.PluginInfoVersion = PluginInfoVersion; about.Name = "MusicBee Chromecast"; about.Description = "Adds cast functionality to MusicBee"; about.Author = "Troy Fernandes"; about.TargetApplication = ""; // current only applies to artwork, lyrics or instant messenger name that appears in the provider drop down selector or target Instant Messenger about.Type = PluginType.General; about.VersionMajor = 1; // your plugin version about.VersionMinor = 0; about.Revision = 1; about.MinInterfaceVersion = MinInterfaceVersion; about.MinApiRevision = MinApiRevision; about.ReceiveNotifications = (ReceiveNotificationFlags.PlayerEvents | ReceiveNotificationFlags.TagEvents); about.ConfigurationPanelHeight = 25; // height in pixels that musicbee should reserve in a panel for config settings. When set, a handle to an empty panel will be passed to the Configure function mbApiInterface.MB_RegisterCommand("Chromecast", OnChromecastSelection); ToolStripMenuItem mainMenuItem = (ToolStripMenuItem)mbApiInterface.MB_AddMenuItem("mnuTools/MB Chromecast", null, null); //TODO mainMenuItem.DropDown.Items.Add("Check Status", null, StatusShowInMessagebox); mainMenuItem.DropDown.Items.Add("Disconnect from Chromecast", null, (sender, e) => DisconnectFromChromecast(sender, e, false)); mainMenuItem.DropDown.Items.Add("Stop Server", null, StopWebserver); mainMenuItem.DropDown.Items.Add("Stop Plugin", null, UserClosingPlugin); //Save the crossfade settings crossfade = mbApiInterface.Player_GetCrossfade(); ReadSettings(); return(about); }