Beispiel #1
0
        public async Task LoadPlugin()
        {
            if (IsLoaded)
            {
                return;
            }

            await TaskHelper.Run(() =>
            {
                try
                {
                    _remoteVstService.LoadPlugin(_guid, _debug);
                    Plugin.PluginInfo  = _remoteVstService.GetPluginInfo(_guid);
                    Plugin.VstPluginId = Plugin.PluginInfo.PluginID;
                    Plugin.PluginLocation.VstPluginId          = Plugin.VstPluginId;
                    Plugin.PluginLocation.DllHash              = _remoteVstService.GetHash(Plugin.DllPath);
                    Plugin.PluginLocation.LastModifiedDateTime = _remoteVstService.GetLastModifiedDate(Plugin.DllPath);
                    Plugin.PluginLocation.PluginName           = _remoteVstService.GetEffectivePluginName(_guid);
                    Plugin.PluginLocation.PluginVendor         = _remoteVstService.GetPluginVendor(_guid);
                    Plugin.PluginLocation.PluginProduct        = _remoteVstService.GetPluginProductString(_guid);
                    Plugin.PluginLocation.VendorVersion        = _remoteVstService.GetPluginVendorVersion(_guid).ToString();

                    Plugin.PluginType = Plugin.PluginInfo.Flags.HasFlag(VstPluginFlags.IsSynth)
                        ? Plugin.PluginTypes.Instrument
                        : Plugin.PluginTypes.Effect;

                    Plugin.PluginCapabilities.Clear();
                    Plugin.PluginCapabilities.AddRange(_remoteVstService.GetPluginInfoItems(_guid));
                    IsLoaded = true;
                    Plugin.PluginLocation.HasMetadata = true;
                }
                catch (Exception e)
                {
                    Plugin.LogPluginError("loading plugin", e);
                }
            }, true);
        }