Beispiel #1
0
        public PluginInfo Initialise(IntPtr apiInterfacePtr)
        {
            MBApiInterface = new MusicBeeApiInterface();
            MBApiInterface.Initialise(apiInterfacePtr);
            About.PluginInfoVersion = PluginInfoVersion;
            About.Name                     = "Music Hue";
            About.Description              = "Match your Philips Hue lights to the current song color.";
            About.Author                   = "Sean Sopata";
            About.TargetApplication        = "";
            About.Type                     = PluginType.General;
            About.VersionMajor             = 1;
            About.VersionMinor             = 1;
            About.Revision                 = 1;
            About.MinInterfaceVersion      = MinInterfaceVersion;
            About.MinApiRevision           = MinApiRevision;
            About.ReceiveNotifications     = (ReceiveNotificationFlags.PlayerEvents | ReceiveNotificationFlags.TagEvents);
            About.ConfigurationPanelHeight = 0;
            ToolStripMenuItem mainMenuItem = (ToolStripMenuItem)MBApiInterface.MB_AddMenuItem("mnuTools/Music Hue", null, null);

            mainMenuItem.DropDown.Items.Add("Settings", null, OnOpen);
            mainMenuItem.DropDown.Items.Add("Stop", null, StopPlugin);
            mainMenuItem.DropDown.Items.Add("Resume", null, ResumePlugin);
            Settings.Instance.StoragePath = MBApiInterface.Setting_GetPersistentStoragePath();
            Settings.Instance.Initialize();
            Settings.Instance.LoadSettings(MBApiInterface.Setting_GetPersistentStoragePath());
            SettingsFORM.StartUp();
            if (Settings.Instance.IsEnabled)
            {
                SHue.SHueConfig.TurnOnOffLights(Settings.Instance.HueLights, true);
            }
            return(About);
        }
Beispiel #2
0
        public PluginInfo Initialise(IntPtr apiInterfacePtr)
        {
            _mbApiInterface = new MusicBeeApiInterface();
            _mbApiInterface.Initialise(apiInterfacePtr);

            _mbApiInterface.MB_AddMenuItem("mnuTools/Update AutoRating", "Tools: Update AutoRating", MenuItemUpdateAutoRating);

            _about.PluginInfoVersion = PluginInfoVersion;
            _about.Name              = "AutoRating";
            _about.Description       = "Automatically updates the rating of tracks based on your listening behaviour.";
            _about.Author            = "NekuSoul";
            _about.TargetApplication = string.Empty;
            _about.Type              = PluginType.General;

            _about.VersionMajor = 1;
            _about.VersionMinor = 0;
            _about.Revision     = 1;

            _about.MinInterfaceVersion = MinInterfaceVersion;
            _about.MinApiRevision      = MinApiRevision;

            _about.ReceiveNotifications     = (ReceiveNotificationFlags.PlayerEvents | ReceiveNotificationFlags.TagEvents);
            _about.ConfigurationPanelHeight = 0;

            return(_about);
        }
        public PluginInfo Initialise(IntPtr apiInterfacePtr)
        {
            mbApiInterface = new MusicBeeApiInterface();
            mbApiInterface.Initialise(apiInterfacePtr);
            about.PluginInfoVersion = PluginInfoVersion;
            about.Name                     = "MB Test API Plugin";
            about.Description              = "Quickly test API functionality";
            about.Author                   = "Leo Rampen";
            about.TargetApplication        = "None"; // 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;   // not implemented yet: 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


            // Comment this out to disable logging
            // Logger.Instance.LogFile = System.IO.Path.Combine(mbApiInterface.Setting_GetPersistentStoragePath(), "gMusicPlaylistSync.log.txt");

            createMenu();

            return(about);
        }
        public PluginInfo Initialise(IntPtr apiInterfacePtr)
        {
            mbApiInterface = new MusicBeeApiInterface();
            mbApiInterface.Initialise(apiInterfacePtr);
            about.PluginInfoVersion = PluginInfoVersion;
            about.Name = "LastFmPlayCount";
            about.Description = "Retrieve LastFm PlayCounts";
            about.Author = "Eric Prescott-Gagnon";
            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 = 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

            string directoryPath = mbApiInterface.Setting_GetPersistentStoragePath() + "\\" + Plugin.PluginOutputDirectory;
            Directory.CreateDirectory(directoryPath);

            string path = mbApiInterface.Setting_GetPersistentStoragePath() + "\\" + Plugin.PluginOutputDirectory + "\\" + Plugin.OutputFile;
            FileStream stream = new FileStream(path, FileMode.Create);

            return about;
        }
        public PluginInfo Initialise(IntPtr apiInterfacePtr)
        {
            mbApiInterface = new MusicBeeApiInterface();
            mbApiInterface.Initialise(apiInterfacePtr);
            about.PluginInfoVersion = PluginInfoVersion;
            about.Name                     = "Music Bee Sync to Service";
            about.Description              = "Sync your playlists to Spotify and Google Play Music.";
            about.Author                   = "Mitch Hymel";
            about.TargetApplication        = "None"; // 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             = 3;      // your plugin version
            about.VersionMinor             = 0;
            about.Revision                 = 0;
            about.MinInterfaceVersion      = MinInterfaceVersion;
            about.MinApiRevision           = MinApiRevision;
            about.ReceiveNotifications     = (ReceiveNotificationFlags.PlayerEvents | ReceiveNotificationFlags.TagEvents);
            about.ConfigurationPanelHeight = 0;   // not implemented yet: 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


            createMenu();

            // Process taken from tag tools

            return(about);
        }
Beispiel #6
0
        public PluginInfo Initialise(IntPtr apiInterfacePtr)
        {
            mbApiInterface = new MusicBeeApiInterface();
            mbApiInterface.Initialise(apiInterfacePtr);
            about.PluginInfoVersion = PluginInfoVersion;
            about.Name                     = "MPVPlayer";
            about.Description              = "Send videos to MPV without losing current windows focus";
            about.Author                   = "MPVPlayer";
            about.TargetApplication        = ""; //  the name of a Plugin Storage device or panel header for a dockable panel
            about.Type                     = PluginType.General;
            about.VersionMajor             = 1;  // your plugin version
            about.VersionMinor             = 0;
            about.Revision                 = 1;
            about.MinInterfaceVersion      = mbApiInterface.InterfaceVersion; //40
            about.MinApiRevision           = mbApiInterface.ApiRevision;      //53
            about.ReceiveNotifications     = (ReceiveNotificationFlags.PlayerEvents | ReceiveNotificationFlags.TagEvents);
            about.ConfigurationPanelHeight = 360;                             // 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
            string       dataPath = mbApiInterface.Setting_GetPersistentStoragePath();
            StreamReader sr       = new StreamReader(dataPath + "\\MPVPlayer.conf");

            extraArgsConf = sr.ReadLine();
            extConf       = sr.ReadLine();
            sr.Close();
            Program.extraArgs = extraArgsConf;

            return(about);
        }
        public PluginInfo Initialise(IntPtr apiInterfacePtr)
        {
            _playingTimer           = new System.Timers.Timer(1000);
            _playingTimer.Elapsed  += WhilePlaying;
            _playingTimer.AutoReset = true;

            _mbApiInterface = new MusicBeeApiInterface();
            _mbApiInterface.Initialise(apiInterfacePtr);

            _about.PluginInfoVersion = PluginInfoVersion;
            _about.Name              = "Audiobook Position Tracker";
            _about.Description       = "Remembers where you stopped listening in each audiobook.";
            _about.Author            = "Shaun Simmons";
            _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;
            _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);
        }
Beispiel #8
0
 // ReSharper disable once UnusedMember.Global
 public PluginInfo Initialise(IntPtr apiInterfacePtr)
 {
     _mbApiInterface = new MusicBeeApiInterface();
     _mbApiInterface.Initialise(apiInterfacePtr);
     Subsonic.SendNotificationsHandler = _mbApiInterface.MB_SendNotification;
     Subsonic.CreateBackgroundTask     = _mbApiInterface.MB_CreateBackgroundTask;
     Subsonic.SetBackgroundTaskMessage = _mbApiInterface.MB_SetBackgroundTaskMessage;
     Subsonic.RefreshPanels            = _mbApiInterface.MB_RefreshPanels;
     _about.PluginInfoVersion          = PluginInfoVersion;
     _about.Name              = "Subsonic v2.15";
     _about.Description       = "Access files and playlists on a SubSonic Server";
     _about.Author            = "Dimitris Panokostas";
     _about.TargetApplication = "Subsonic";
     // 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.Storage;
     _about.VersionMajor             = 2; // your plugin version
     _about.VersionMinor             = 15;
     _about.Revision                 = 0;
     _about.MinInterfaceVersion      = MinInterfaceVersion;
     _about.MinApiRevision           = MinApiRevision;
     _about.ReceiveNotifications     = ReceiveNotificationFlags.StartupOnly;
     _about.ConfigurationPanelHeight = TextRenderer.MeasureText("FirstRowText", SystemFonts.DefaultFont).Height * 12;
     // 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);
 }
Beispiel #9
0
        public PluginInfo Initialise(IntPtr apiInterfacePtr)
        {
            IniData data = iniParser.ReadFile(@"C:\\MusicBee-RichPresence\\Configuration.ini");

            DiscordId = data["Discord"]["AppID"].ToString();

            MbApiInterface = new MusicBeeApiInterface();
            MbApiInterface.Initialise(apiInterfacePtr);
            _about.PluginInfoVersion = PluginInfoVersion;
            _about.Name                     = "Discord Rich Presence";
            _about.Description              = "A Richer Rich Presence for Musicbee.";
            _about.Author                   = "@maybeclean";
            _about.TargetApplication        = "";
            _about.Type                     = PluginType.General;
            _about.VersionMajor             = 1;
            _about.VersionMinor             = 0;
            _about.Revision                 = 01;
            _about.ReceiveNotifications     = (ReceiveNotificationFlags.PlayerEvents | ReceiveNotificationFlags.TagEvents);
            _about.ConfigurationPanelHeight = 0;

            if (!httpClient.DefaultRequestHeaders.Contains("Authorization"))
            {
                httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Authorization", DiscordToken.GetAuthToken());
            }

            InitialiseDiscord();

            return(_about);
        }
Beispiel #10
0
        /// <summary>
        /// Initialises the specified API interface PTR.
        /// </summary>
        /// <param name="apiInterfacePtr">The API interface PTR.</param>
        /// <returns></returns>
        /// <remarks></remarks>
        public PluginInfo Initialise(IntPtr apiInterfacePtr)
        {
            mbApiInterface =
                (MusicBeeApiInterface)Marshal.PtrToStructure(apiInterfacePtr, typeof(MusicBeeApiInterface));
            Version v = Assembly.GetExecutingAssembly().GetName().Version;
            about.PluginInfoVersion = PluginInfoVersion;
            about.Name = "Skype: Now Playing";
            about.Description = "Changes the skype mood to the currently playing track";
            about.Author = "Konstantinos Paparas (Kelsos)";
            about.TargetApplication = "Skype";
            // 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 = Convert.ToInt16(v.Major); // your plugin version
            about.VersionMinor = Convert.ToInt16(v.Minor);
            about.Revision = Convert.ToInt16(v.Revision);
            about.MinInterfaceVersion = MinInterfaceVersion;
            about.MinApiRevision = MinApiRevision;
            about.ReceiveNotifications = ReceiveNotificationFlags.PlayerEvents;
            about.ConfigurationPanelHeight = 100; //Height of the panel.

            SettingsManager.PersistentStorage = mbApiInterface.Setting_GetPersistentStoragePath();
            SettingsManager.LoadSettings();

            //Stop timer initialization at 5 seconds. The timer is disabled at start.
            timer = new Timer { Interval = 2000, Enabled = false };
            timer.Elapsed += StopTimerElapse;
            info = new TrackInfo();
            StartSkypeProxy();
            return about;
        }
Beispiel #11
0
        public PluginInfo Initialise(IntPtr apiInterfacePtr)
        {
            mbApiInterface = new MusicBeeApiInterface();
            mbApiInterface.Initialise(apiInterfacePtr);
            about.PluginInfoVersion = PluginInfoVersion;
            about.Name                     = "GetLyrics";
            about.Description              = "Get Lyrics From Internet";
            about.Author                   = "Dixeran";
            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.LyricsRetrieval;
            about.VersionMajor             = 1;  // your plugin version
            about.VersionMinor             = 0;
            about.Revision                 = 1;
            about.MinInterfaceVersion      = MinInterfaceVersion;
            about.MinApiRevision           = MinApiRevision;
            about.ReceiveNotifications     = ReceiveNotificationFlags.DownloadEvents;
            about.ConfigurationPanelHeight = 40;   // 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

            string dataPath = mbApiInterface.Setting_GetPersistentStoragePath();

            dataPath += "GetLyrics_Config.conf";
            if (!File.Exists(dataPath))
            {
                string confString = String.Format("Automatically_chose={0}", AutoFlag.ToString());
                File.WriteAllText(dataPath, confString);
            }
            else
            {
                FileStream   confFile  = new FileStream(dataPath, FileMode.Open);
                StreamReader confRead  = new StreamReader(confFile);
                string       conf_auto = confRead.ReadLine();
                AutoFlag = conf_auto[20] - '0';
            }
            return(about);
        }
        private void ApplyMusicBeeTheme(MusicBeeApiInterface mbApiInterface)
        {
            Color foreColor = Color.FromArgb(mbApiInterface.Setting_GetSkinElementColour(
                                                 MusicBeePlugin.Plugin.SkinElement.SkinInputPanel,
                                                 MusicBeePlugin.Plugin.ElementState.ElementStateDefault,
                                                 MusicBeePlugin.Plugin.ElementComponent.ComponentForeground));
            Color backColor = Color.FromArgb(mbApiInterface.Setting_GetSkinElementColour(
                                                 MusicBeePlugin.Plugin.SkinElement.SkinInputControl,
                                                 MusicBeePlugin.Plugin.ElementState.ElementStateDefault,
                                                 MusicBeePlugin.Plugin.ElementComponent.ComponentBackground));

            foreach (Control control in this.Controls)
            {
                control.ForeColor = foreColor;
                control.BackColor = backColor;

                if (control.Controls.Count > 0)
                {
                    foreach (Control child in control.Controls)
                    {
                        child.ForeColor = foreColor;
                        child.BackColor = backColor;
                    }
                }
            }

            this.ForeColor = foreColor;
            this.BackColor = backColor;
        }
        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);
        }
Beispiel #14
0
 public GetNowPlaying()
 {
     Get["/now-playing"] = _ =>
     {
         MusicBeeApiInterface mbApi = MbApiInstance.Instance.MusicBeeApiInterface;
         return(mbApi.NowPlaying_GetFileTag(MetaDataType.TrackTitle));
     };
 }
        public PluginInfo Initialise(IntPtr apiInterfacePtr)
        {
            try
            {
                _mbApiInterface = new MusicBeeApiInterface();
                _mbApiInterface.Initialise(apiInterfacePtr);
                _about.PluginInfoVersion = PluginInfoVersion;
                _about.Name              = MusicBeeExporterConstants.Name;
                _about.Description       = MusicBeeExporterConstants.Description;
                _about.Author            = MusicBeeExporterConstants.Author;
                _about.TargetApplication =
                    MusicBeeExporterConstants
                    .TargetApplication;
                _about.Type                 = PluginType.General;
                _about.VersionMajor         = MusicBeeExporterConstants.VersionMajor;
                _about.VersionMinor         = MusicBeeExporterConstants.VersionMinor;
                _about.Revision             = MusicBeeExporterConstants.Revision;
                _about.MinInterfaceVersion  = MinInterfaceVersion;
                _about.MinApiRevision       = MinApiRevision;
                _about.ReceiveNotifications =
                    ReceiveNotificationFlags.PlayerEvents | ReceiveNotificationFlags.TagEvents;
                _about.ConfigurationPanelHeight =
                    MusicBeeExporterConstants.ConfigurationPanelHeight;

                // Initialize the plugin after music bee api interface is initialized and the PersistentStoragePath is accessible
                IPersistenceSettings persistenceSettings = new PersistenceSettings
                {
                    MusicBeeAllocatedStoragePath = _mbApiInterface.Setting_GetPersistentStoragePath()
                };


                // Create Plugin Storage folder
                Directory.CreateDirectory(persistenceSettings.PluginStorageDirectory);

                _repo = new Persistence(persistenceSettings);

                // Load exporter settings if it exists, otherwise create a new settings file.
                var settingJson = _repo.LoadPluginSettings();

                if (!string.IsNullOrWhiteSpace(settingJson))
                {
                    _pluginSettings = JsonConvert.DeserializeObject <MusicBeeExporterSettings>(settingJson);
                }
                else
                {
                    _pluginSettings = new MusicBeeExporterSettings(persistenceSettings);
                    _repo.SavePluginSettings(_pluginSettings);
                }

                CreateMenuItem();
            }
            catch (Exception ex)
            {
                UIHelper.DisplayExceptionDialog(ex);
            }

            return(_about);
        }
        public SyncPlaylistsWindow(MusicBeeApiInterface mbApiInterface)
        {
            InitializeComponent();

            OutputTextBox.AppendText(Environment.NewLine);

            _mbApiInterface = mbApiInterface;
            ApplyMusicBeeTheme();
        }
Beispiel #17
0
 /// <summary>
 /// Create the track time timer.
 /// </summary>
 /// <param name="mbApi">The musicbee API.</param>
 public TrackTimeTimer(MusicBeeApiInterface mbApi, WebSocketClient wsClient)
 {
     api             = mbApi;
     ws              = wsClient;
     timer           = new System.Timers.Timer(1000);
     timer.Elapsed  += Timer_Elapsed;
     timer.AutoReset = true;
     timer.Enabled   = false;
 }
        public PluginInfo Initialise(IntPtr apiInterfacePtr)
        {
            mbApiInterface = new MusicBeeApiInterface();
            mbApiInterface.Initialise(apiInterfacePtr);
            about.PluginInfoVersion = PluginInfoVersion;
            about.Name                     = "Video Continuous Play";
            about.Description              = "Play music and music video continuously";
            about.Author                   = "Tomohide Fujikawa";
            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.VideoPlayer;
            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 = 100;   // 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

            // save any persistent settings in a sub-folder of this path
            string dataPath = mbApiInterface.Setting_GetPersistentStoragePath();
            string datafile = dataPath + settingFileName;

            try
            {
                //<Read from XML file>
                //Make XmlSerializer object
                System.Xml.Serialization.XmlSerializer serializer2 =
                    new System.Xml.Serialization.XmlSerializer(typeof(Settings));
                //Open file
                System.IO.FileStream fs2 =
                    new System.IO.FileStream(datafile, System.IO.FileMode.Open);
                //unserialize from xml file
                Settings appSettings =
                    (Settings)serializer2.Deserialize(fs2);
                vlcPath = appSettings.VlcPath;

                isFullScreen = appSettings.IsFullScreen;
                fs2.Close();
            }
            catch (Exception e)
            {
                //Set Default Setting
                if (String.IsNullOrEmpty(vlcPath))
                {
                    vlcPath = getDefaultVlcPath() + @"\vlc.exe";
                }
            }
            if (!File.Exists(vlcPath))
            {
                vlcPath = "";
            }

            return(about);
        }
Beispiel #19
0
        public PluginInfo Initialise(IntPtr apiInterfacePtr)
        {
            _mbApiInterface = new MusicBeeApiInterface();
            _mbApiInterface.Initialise(apiInterfacePtr);

            //Get persistent folder
            string rootFolder = _mbApiInterface.Setting_GetPersistentStoragePath();

            PluginSettings.InitSettings(rootFolder);

            return(BuildPluginInfo());
        }
Beispiel #20
0
        public PluginInfo Initialise(IntPtr apiInterfacePtr)
        {
            mbApiInterface = new MusicBeeApiInterface();
            mbApiInterface.Initialise(apiInterfacePtr);
            about.PluginInfoVersion = PluginInfoVersion;
            about.Name                     = "Skip Over Song (when shuffling)";
            about.Description              = "Skip all or some of a song when it is played during shuffle.";
            about.Author                   = "neRok";
            about.TargetApplication        = "";
            about.Type                     = PluginType.General;
            about.VersionMajor             = 1;
            about.VersionMinor             = 0;
            about.Revision                 = 1;
            about.MinInterfaceVersion      = MinInterfaceVersion;
            about.MinApiRevision           = MinApiRevision;
            about.ReceiveNotifications     = (ReceiveNotificationFlags.PlayerEvents | ReceiveNotificationFlags.TagEvents);
            about.ConfigurationPanelHeight = 120;

            // Get and apply any user settings, overridding the defaults.
            settings_file_path = mbApiInterface.Setting_GetPersistentStoragePath() + "SkipOverSong.xml";
            var settings = new XmlDocument();

            try
            {
                settings.Load(settings_file_path);
                XmlNode node;
                node = settings.SelectSingleNode("/settings/skip_on_shuffle");
                if (node != null)
                {
                    skip_on_shuffle = Convert.ToBoolean(node.InnerText);
                }
                node = settings.SelectSingleNode("/settings/skip_on_autodj");
                if (node != null)
                {
                    skip_on_autodj = Convert.ToBoolean(node.InnerText);
                }
                node = settings.SelectSingleNode("/settings/custom_tag");
                if (node != null)
                {
                    custom_tag = node.InnerText;
                }
            }
            catch (System.IO.FileNotFoundException)
            {
            }

            // Determine plugins active flag.
            UpdateActiveFlag();

            return(about);
        }
        public SyncProgressWindow(IGrooveClient client, MusicBeeApiInterface mbApiInterface, SyncDirection syncDirection, List <MusicBeePlaylist> musicBeePlaylists, List <Playlist> groovePlaylists)
        {
            InitializeComponent();

            _syncHelper        = new SyncHelper(client, mbApiInterface, this);
            _syncDirection     = syncDirection;
            _musicBeePlaylists = musicBeePlaylists;
            _groovePlaylists   = groovePlaylists;
            ErrorResponses     = new List <PlaylistActionResponse>();

            ApplyMusicBeeTheme(mbApiInterface);

            StartSync();
        }
Beispiel #22
0
        public PluginInfo Initialise(IntPtr apiInterfacePtr)
        {
            _mbApiInterface = new MusicBeeApiInterface();
            _mbApiInterface.Initialise(apiInterfacePtr);
            _about.PluginInfoVersion = PluginInfoVersion;
            _about.Name                     = "DiscordBee";
            _about.Description              = "Update your Discord Profile with the currently playing track";
            _about.Author                   = "Stefan Lengauer";
            _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             = 3;  // your plugin version
            _about.VersionMinor             = 0;
            _about.Revision                 = 3;
            _about.MinInterfaceVersion      = MinInterfaceVersion;
            _about.MinApiRevision           = MinApiRevision;
            _about.ReceiveNotifications     = ReceiveNotificationFlags.PlayerEvents;
            _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

            var workingDir       = _mbApiInterface.Setting_GetPersistentStoragePath() + _about.Name;
            var settingsFilePath = $"{workingDir}\\{_about.Name}.settings";

            _imgurAssetCachePath = $"{workingDir}\\{_about.Name}-Imgur.cache";
            _imgurAlbum          = $"{workingDir}\\{_about.Name}-Imgur.album";

            _settings = Settings.GetInstance(settingsFilePath);
            _settings.SettingChanged += SettingChangedCallback;
            _settingsWindow           = new SettingsWindow(this, _settings);

            _discordClient.ArtworkUploadEnabled = _settings.UploadArtwork;
            _discordClient.DiscordId            = _settings.DiscordAppId;
            UpdateAssetManager(_imgurAssetCachePath, new ImgurUploader(_imgurAlbum, _settings.ImgurClientId));
            ToolStripMenuItem mainMenuItem = (ToolStripMenuItem)_mbApiInterface.MB_AddMenuItem($"mnuTools/{_about.Name}", null, null);

            mainMenuItem.DropDown.Items.Add("Uploader Health", null, ShowUploaderHealth);

            // Match least number of chars possible but min 1
            _layoutHandler = new LayoutHandler(new Regex("\\[([^[]+?)\\]"));

            _updateTimer.Elapsed  += UpdateTimerElapsedCallback;
            _updateTimer.AutoReset = false;
            _updateTimer.Stop();

            Debug.WriteLine(_about.Name + " loaded");

            return(_about);
        }
Beispiel #23
0
        // Called from MusicBee
        public PluginInfo Initialise(IntPtr apiPtr)
        {
            //MessageBox.Show("Initialised(" + apiPtr + ")");
            musicBee = new MusicBeeApiInterface();
            musicBee.Initialise(apiPtr);

            info.PluginInfoVersion = PluginInfoVersion;
            info.Name = "Lyrics Reloaded!";
            info.Description = "Lyrics loading done properly!";
            info.Author = "Phillip Schichtel <Quick_Wango>";
            info.TargetApplication = "MusicBee";
            info.Type = PluginType.LyricsRetrieval;
            info.VersionMajor = 1;
            info.VersionMinor = 0;
            info.Revision = 1;
            info.MinInterfaceVersion = 20;
            info.MinApiRevision = 25;
            info.ReceiveNotifications = ReceiveNotificationFlags.StartupOnly;
            info.ConfigurationPanelHeight = 0;

            try
            {
                lyricsReloaded = new LyricsReloaded(musicBee.Setting_GetPersistentStoragePath());
            }
            catch (Exception e)
            {
                MessageBox.Show("An error occurred during plugin startup: " + e.Message);
                throw;
            }

            try
            {
                lyricsReloaded.loadConfigurations();
            }
            catch (Exception e)
            {
                MessageBox.Show("An error occurred during plugin startup, send this file to the developer:\n\n" +
                                lyricsReloaded.getLogger().getFileInfo().FullName);
                lyricsReloaded.getLogger().error(e.Message);
                throw;
            }

            return info;
        }
Beispiel #24
0
        // Called from MusicBee
        public PluginInfo Initialise(IntPtr apiPtr)
        {
            //MessageBox.Show("Initialised(" + apiPtr + ")");
            musicBee = new MusicBeeApiInterface();
            musicBee.Initialise(apiPtr);

            info.PluginInfoVersion = PluginInfoVersion;
            info.Name                     = "Lyrics Reloaded!";
            info.Description              = "Lyrics loading done properly!";
            info.Author                   = "Phillip Schichtel <Quick_Wango>";
            info.TargetApplication        = "MusicBee";
            info.Type                     = PluginType.LyricsRetrieval;
            info.VersionMajor             = 1;
            info.VersionMinor             = 0;
            info.Revision                 = 1;
            info.MinInterfaceVersion      = 20;
            info.MinApiRevision           = 25;
            info.ReceiveNotifications     = ReceiveNotificationFlags.StartupOnly;
            info.ConfigurationPanelHeight = 0;

            try
            {
                lyricsReloaded = new LyricsReloaded(musicBee.Setting_GetPersistentStoragePath());
            }
            catch (Exception e)
            {
                MessageBox.Show("An error occurred during plugin startup: " + e.Message);
                throw;
            }

            try
            {
                lyricsReloaded.loadConfigurations();
            }
            catch (Exception e)
            {
                MessageBox.Show("An error occurred during plugin startup, send this file to the developer:\n\n" +
                                lyricsReloaded.getLogger().getFileInfo().FullName);
                lyricsReloaded.getLogger().error(e.Message);
                throw;
            }

            return(info);
        }
Beispiel #25
0
 public PluginInfo Initialise(IntPtr apiInterfacePtr)
 {
     mbApiInterface = new MusicBeeApiInterface();
     mbApiInterface.Initialise(apiInterfacePtr);
     about.PluginInfoVersion = PluginInfoVersion;
     about.Name                     = "LocalLyricsLoader";
     about.Description              = "An Enhancement to load lyrics from local filesystem";
     about.Author                   = "Samersions";
     about.TargetApplication        = ""; //  the name of a Plugin Storage device or panel header for a dockable panel
     about.Type                     = PluginType.LyricsRetrieval;
     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 = 400;   // 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);
 }
Beispiel #26
0
 public PluginInfo Initialise(IntPtr apiInterfacePtr)
 {
     mbApiInterface = new MusicBeeApiInterface();
     mbApiInterface.Initialise(apiInterfacePtr);
     about.PluginInfoVersion = PluginInfoVersion;
     about.Name                     = "Now Playing";
     about.Description              = "Sending the now playing in JSON format.";
     about.Author                   = "torin";
     about.TargetApplication        = "";
     about.Type                     = PluginType.General;
     about.VersionMajor             = 1;
     about.VersionMinor             = 0;
     about.Revision                 = 0;
     about.MinInterfaceVersion      = MinInterfaceVersion;
     about.MinApiRevision           = MinApiRevision;
     about.ReceiveNotifications     = (ReceiveNotificationFlags.PlayerEvents | ReceiveNotificationFlags.TagEvents);
     about.ConfigurationPanelHeight = 0;
     return(about);
 }
Beispiel #27
0
 public PluginInfo Initialise(IntPtr apiInterfacePtr)
 {
     mbApiInterface = new MusicBeeApiInterface();
     mbApiInterface.Initialise(apiInterfacePtr);
     about.PluginInfoVersion = PluginInfoVersion;
     about.Name                     = $"{Provider}";
     about.Description              = $"{Provider}から歌詞を取得します";
     about.Author                   = "kokarare1212";
     about.TargetApplication        = "";
     about.Type                     = PluginType.LyricsRetrieval;
     about.VersionMajor             = 1;
     about.VersionMinor             = 2;
     about.Revision                 = 0;
     about.MinInterfaceVersion      = 1;
     about.MinApiRevision           = 1;
     about.ReceiveNotifications     = (ReceiveNotificationFlags.PlayerEvents | ReceiveNotificationFlags.TagEvents);
     about.ConfigurationPanelHeight = 0;
     return(about);
 }
Beispiel #28
0
 public PluginInfo Initialise(IntPtr apiInterfacePtr)
 {
     mbApiInterface = new MusicBeeApiInterface();
     mbApiInterface.Initialise(apiInterfacePtr);
     about.PluginInfoVersion = PluginInfoVersion;
     about.Name                     = $"{Provider}歌詞取得 (2021/6/23)";
     about.Description              = $"{Provider}から歌詞を取得します。";
     about.Author                   = "htsign(noriokun4649 Edit)";
     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.LyricsRetrieval;
     about.VersionMajor             = 4;  // your plugin version
     about.VersionMinor             = 0;
     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
     return(about);
 }
 public PluginInfo Initialise(IntPtr apiInterfacePtr)
 {
     mbApiInterface = new MusicBeeApiInterface();
     mbApiInterface.Initialise(apiInterfacePtr);
     about.PluginInfoVersion = PluginInfoVersion;
     about.Name                     = "ALSong Lyrics";
     about.Description              = "Gets lyrics from ALSong as a provider in MusicBee";
     about.Author                   = "Nicholas Tay (nexerq)";
     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.LyricsRetrieval;
     about.VersionMajor             = 0;  // your plugin version
     about.VersionMinor             = 2;
     about.Revision                 = 0;
     about.MinInterfaceVersion      = MinInterfaceVersion;
     about.MinApiRevision           = MinApiRevision;
     about.ReceiveNotifications     = ReceiveNotificationFlags.StartupOnly;
     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);
 }
Beispiel #30
0
 public PluginInfo Initialise(IntPtr apiInterfacePtr)
 {
     mbApiInterface = new MusicBeeApiInterface();
     mbApiInterface.Initialise(apiInterfacePtr);
     about.PluginInfoVersion = PluginInfoVersion;
     about.Name                     = "Twitch Interaction";
     about.Description              = "This plugin allows twitch to interact with MusicBee including getting available tracks and voting for a track.";
     about.Author                   = "Isaac Skelton";
     about.TargetApplication        = "TwitchIntegration"; //  the name of a Plugin Storage device or panel header for a dockable panel
     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 = 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);
 }
Beispiel #31
0
        public PluginInfo Initialise(IntPtr apiInterfacePtr)
        {
            var versions = Assembly.GetExecutingAssembly().GetName().Version.ToString().Split('.');

            _mbApiInterface = new MusicBeeApiInterface();
            _mbApiInterface.Initialise(apiInterfacePtr);
            _about.PluginInfoVersion = PluginInfoVersion;
            _about.Name                     = "Netease Lyrics";
            _about.Description              = "A plugin to retrieve lyrics from Netease Cloud Music.(从网易云音乐获取歌词的插件。)";
            _about.Author                   = "Charlie Jiang";
            _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.LyricsRetrieval;
            _about.VersionMajor             = short.Parse(versions[0]); // your plugin version
            _about.VersionMinor             = short.Parse(versions[1]);
            _about.Revision                 = short.Parse(versions[2]);
            _about.MinInterfaceVersion      = MinInterfaceVersion;
            _about.MinApiRevision           = MinApiRevision;
            _about.ReceiveNotifications     = ReceiveNotificationFlags.DownloadEvents;
            _about.ConfigurationPanelHeight = 50;   // 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

            string noTranslatePath = Path.Combine(_mbApiInterface.Setting_GetPersistentStoragePath(), NoTranslateFilename);
            string configPath      = Path.Combine(_mbApiInterface.Setting_GetPersistentStoragePath(), ConfigFilename);

            if (File.Exists(configPath))
            {
                try
                {
                    _config = JsonConvert.DeserializeObject <NeteaseConfig>(File.ReadAllText(configPath, Encoding.UTF8));
                }
                catch (Exception ex)
                {
                    _mbApiInterface.MB_Trace("[NeteaseMusic] Failed to load config" + ex);
                }
            }
            if (File.Exists(noTranslatePath))
            {
                File.Delete(noTranslatePath);
                _config.format = NeteaseConfig.OutputFormat.Original;
                SaveSettingsInternal();
            }

            return(_about);
        }
 public PluginInfo Initialise(IntPtr apiInterfacePtr)
 {
     mbApiInterface = new MusicBeeApiInterface();
     mbApiInterface.Initialise(apiInterfacePtr);
     about.PluginInfoVersion = PluginInfoVersion;
     about.Name = "AnimeLyrics";
     about.Description = "Retrieves lyrics from animelyrics.com";
     about.Author = "Veselin Romic (OmegaVesko)";
     about.TargetApplication = "MusicBee";   // 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.LyricsRetrieval;
     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 = 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;
 }
 public PluginInfo Initialise(IntPtr apiInterfacePtr)
 {
     mbApiInterface = new MusicBeeApiInterface();
     mbApiInterface.Initialise(apiInterfacePtr);
     about.PluginInfoVersion = PluginInfoVersion;
     about.Name                     = "Media Control";
     about.Description              = "Enables MusicBee to interact with the Windows 10 Media Control overlay.";
     about.Author                   = "Ameer Dawood";
     about.TargetApplication        = ""; //  the name of a Plugin Storage device or panel header for a dockable panel
     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;
     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);
 }
Beispiel #34
0
 public PluginInfo Initialise(IntPtr apiInterfacePtr)
 {
     mbApiInterface = new MusicBeeApiInterface();
     mbApiInterface.Initialise(apiInterfacePtr);
     about.PluginInfoVersion = PluginInfoVersion;
     about.Name                     = "NowPlayingV2 Plugin";
     about.Description              = "plugin for NowPlayingTunesV2.";
     about.Author                   = "Kazuki Oishi";
     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 = 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);
 }
Beispiel #35
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);
        }
Beispiel #36
0
        /// <summary>
        /// This function initialized the Plugin.
        /// </summary>
        /// <param name="apiInterfacePtr"></param>
        /// <returns></returns>
        public PluginInfo Initialise(IntPtr apiInterfacePtr)
        {
            selfInstance = this;
            JsConfig.ExcludeTypeInfo = true;
            Configuration.Register(Controller.Instance);

            mbApiInterface = new MusicBeeApiInterface();
            mbApiInterface.Initialise(apiInterfacePtr);

            UserSettings.Instance.SetStoragePath(mbApiInterface.Setting_GetPersistentStoragePath());
            UserSettings.Instance.LoadSettings();

            about.PluginInfoVersion = PluginInfoVersion;
            about.Name = "MusicBee Remote: Plugin";
            about.Description = "Remote Control for server to be used with android application.";
            about.Author = "Konstantinos Paparas (aka Kelsos)";
            about.TargetApplication = "MusicBee Remote";

            Version v = Assembly.GetExecutingAssembly().GetName().Version;
            UserSettings.Instance.CurrentVersion = v.ToString();

            // 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 = Convert.ToInt16(v.Major);
            about.VersionMinor = Convert.ToInt16(v.Minor);
            about.Revision = Convert.ToInt16(v.Revision);
            about.MinInterfaceVersion = MinInterfaceVersion;
            about.MinApiRevision = MinApiRevision;
            about.ReceiveNotifications = ReceiveNotificationFlags.PlayerEvents;

            if (mbApiInterface.ApiRevision < MinApiRevision)
            {
                return about;
            }

            ErrorHandler.SetLogFilePath(mbApiInterface.Setting_GetPersistentStoragePath());

            StartPlayerStatusMonitoring();

            mbApiInterface.MB_AddMenuItem("mnuTools/MusicBee Remote", "Information Panel of the MusicBee Remote",
                                          MenuItemClicked);

            EventBus.FireEvent(new MessageEvent(EventType.ActionSocketStart));
            EventBus.FireEvent(new MessageEvent(EventType.InitializeModel));
            EventBus.FireEvent(new MessageEvent(EventType.StartServiceBroadcast));
            EventBus.FireEvent(new MessageEvent(EventType.ShowFirstRunDialog));

            positionUpdateTimer = new Timer(20000);
            positionUpdateTimer.Elapsed += PositionUpdateTimerOnElapsed;
            positionUpdateTimer.Enabled = true;

            return about;
        }
 private static extern void CopyMemory(ref MusicBeeApiInterface mbApiInterface, IntPtr src, int length);