public void Initialize(IVVVVHost vvvvHost, INodeBrowserHost nodeBrowserHost, IWindowSwitcherHost windowSwitcherHost, IKommunikatorHost kommunikatorHost) { // Used for Windows Forms message loop FIsRunning = true; //set blackbox mode? this.IsBlackBoxMode = vvvvHost.IsBlackBoxMode; // Set VVVV45 to this running vvvv.exe Environment.SetEnvironmentVariable(ENV_VVVV, Path.GetFullPath(Shell.CallerPath.ConcatPath("..").ConcatPath(".."))); FVVVVHost = vvvvHost; NodeInfoFactory = new ProxyNodeInfoFactory(vvvvHost.NodeInfoFactory); FVVVVHost.AddMouseClickListener(this); FVVVVHost.AddNodeSelectionListener(this); FVVVVHost.AddWindowListener(this); FVVVVHost.AddWindowSelectionListener(this); FVVVVHost.AddComponentModeListener(this); FVVVVHost.AddEnumListener(this); NodeInfoFactory.NodeInfoUpdated += factory_NodeInfoUpdated; // Route log messages to vvvv Logger.AddLogger(new VVVVLogger(FVVVVHost)); DeviceService = new DeviceService(vvvvHost.DeviceService); MainLoop = new MainLoop(vvvvHost.MainLoop); ExposedNodeService = new ExposedNodeService(vvvvHost.ExposedNodeService, NodeInfoFactory); NodeBrowserHost = new ProxyNodeBrowserHost(nodeBrowserHost, NodeInfoFactory); WindowSwitcherHost = windowSwitcherHost; KommunikatorHost = kommunikatorHost; //do not add the entire directory for faster startup var catalog = new AggregateCatalog(); catalog.Catalogs.Add(new AssemblyCatalog(typeof(HDEHost).Assembly.Location)); catalog.Catalogs.Add(new AssemblyCatalog(typeof(NodeCollection).Assembly.Location)); //allow plugin writers to add their own factories (deprecated, see below) var factoriesPath = ExePath.ConcatPath(@"lib\factories"); if (Directory.Exists(factoriesPath)) { catalog.Catalogs.Add(new DirectoryCatalog(factoriesPath)); } //register custom assembly resolvers which look also in the PACK_NAME/core and PACK_NAME/core/[x86|x64] folders AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += CurrentDomain_ReflectionOnlyAssemblyResolve; //search for packs, add factories dir to this catalog, add core dir to assembly search path, //add nodes to nodes search path var packsPath = Path.Combine(ExePath, "packs"); if (Directory.Exists(packsPath)) { LoadFactoriesFromLegacyPackages(packsPath, catalog); } //new package loading system LoadFactoriesFromPackages(catalog); Container = new CompositionContainer(catalog); Container.ComposeParts(this); PluginFactory.AddFile(ExePath.ConcatPath(@"lib\nodes\plugins\VVVV.Nodes.dll")); //Get node infos from core plugins here to avoid looping all node infos var windowSwitcherNodeInfo = GetNodeInfo(WINDOW_SWITCHER); var kommunikatorNodeInfo = GetNodeInfo(KOMMUNIKATOR); var nodeBrowserNodeInfo = GetNodeInfo(NODE_BROWSER); foreach (var factory in AddonFactories) { if (factory is PatchFactory) { NodeCollection.Add(string.Empty, ExePath.ConcatPath(@"lib\nodes\native\"), factory, true, false); } } //now instantiate a NodeBrowser, a Kommunikator and a WindowSwitcher FWindowSwitcher = PluginFactory.CreatePlugin(windowSwitcherNodeInfo, null); FKommunikator = PluginFactory.CreatePlugin(kommunikatorNodeInfo, null); FNodeBrowser = PluginFactory.CreatePlugin(nodeBrowserNodeInfo, null); this.IsBoygroupClient = FVVVVHost.IsBoygroupClient; if (IsBoygroupClient) { this.BoygroupServerIP = FVVVVHost.BoygroupServerIP; } var clockport = 3334; try { if (Environment.CommandLine.Contains("/clockport")) { var env = Environment.GetCommandLineArgs(); var idx = Array.IndexOf(env, "/clockport") + 1; clockport = int.Parse(env[idx]); } } catch (Exception) { throw new Exception("Could not parse clockport, make sure you have the right syntax, e.g. '/clockport 3344' "); } //start time server of client FNetTimeSync = IsBoygroupClient ? new UDPTimeClient(BoygroupServerIP, clockport) : new UDPTimeServer(clockport); FNetTimeSync.Start(); //now that all basics are set up, see if there are any node search paths to add //from the installed packs if (Directory.Exists(packsPath)) { LoadNodesFromLegacyPackages(packsPath); } LoadNodesFromPackages(); }