Exemplo n.º 1
0
        // Public Methods and Properties ---------------------------------------
        /// <summary>
        /// Initialises the specified API interface PTR.
        /// </summary>
        /// <param name="apiInterfacePtr">The API interface PTR.</param>
        /// <returns></returns>
        public PluginInfo Initialise(IntPtr apiInterfacePtr)
        {
            // "©".
            byte[] newBytes = new Byte[] { 169 };
            var encoding = Encoding.GetEncoding(1252);
            String copyright = encoding.GetString(newBytes, 0, newBytes.Length);

            // Get current date/time.
            DateTime now = System.DateTime.Now;

            _mbApiInterface = new MusicBeeApiInterface();
            _mbApiInterface.Initialise(apiInterfacePtr);
            _about.PluginInfoVersion = PluginInfoVersion;
            _about.Name = "Pause On Lock";
            _about.Description = "Pause/Resume when Workstation is Locked/Unlocked.";
            _about.Author = copyright + " Copyright " + now.Year + " Jeff Lanzarotta";
            _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 = 1;
            _about.Revision = 1;
            _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

            _workLock = new CheckForWorkstationLocking(_mbApiInterface);
            _workLock.Run();

            return (_about);
        }
Exemplo n.º 2
0
 /// <summary>
 /// MusicBee is closing the plugin (plugin is being disabled by user or
 /// MusicBee is shutting down).
 /// </summary>
 /// <param name="reason">The reason.</param>
 public void Close(PluginCloseReason reason)
 {
     if (_workLock != null)
     {
         _workLock.Dispose();
         _workLock = null;
     }
 }