void Server::run(int argc, char** argv) { #ifdef ICE_STATIC_LIBS Ice::registerPluginFactory("Test", createTestTransport, false); #endif Ice::PropertiesPtr properties = createTestProperties(argc, argv); // // This test kills connections, so we don't want warnings. // properties->setProperty("Ice.Warn.Connections", "0"); properties->setProperty("Ice.MessageSizeMax", "50000"); // // This test relies on filling the TCP send/recv buffer, so // we rely on a fixed value for these buffers. // properties->setProperty("Ice.TCP.RcvSize", "50000"); // // Setup the test transport plug-in. // properties->setProperty("Ice.Plugin.Test", "TestTransport:createTestTransport"); string defaultProtocol = properties->getPropertyWithDefault("Ice.Default.Protocol", "tcp"); properties->setProperty("Ice.Default.Protocol", "test-" + defaultProtocol); Ice::CommunicatorHolder communicator = initialize(argc, argv, properties); communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", getTestEndpoint(1, "tcp")); communicator->getProperties()->setProperty("ControllerAdapter.ThreadPool.Size", "1"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectAdapterPtr adapter2 = communicator->createObjectAdapter("ControllerAdapter"); #ifdef ICE_CPP11_MAPPING shared_ptr<PluginI> plugin = dynamic_pointer_cast<PluginI>(communicator->getPluginManager()->getPlugin("Test")); #else PluginI* plugin = dynamic_cast<PluginI*>(communicator->getPluginManager()->getPlugin("Test").get()); #endif assert(plugin); ConfigurationPtr configuration = plugin->getConfiguration(); BackgroundControllerIPtr backgroundController = ICE_MAKE_SHARED(BackgroundControllerI, adapter, configuration); adapter->add(ICE_MAKE_SHARED(BackgroundI, backgroundController), Ice::stringToIdentity("background")); adapter->add(ICE_MAKE_SHARED(LocatorI, backgroundController), Ice::stringToIdentity("locator")); adapter->add(ICE_MAKE_SHARED(RouterI, backgroundController), Ice::stringToIdentity("router")); adapter->activate(); adapter2->add(backgroundController, Ice::stringToIdentity("backgroundController")); adapter2->activate(); communicator->waitForShutdown(); }
int run(int, char**, const Ice::CommunicatorPtr& communicator) { communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", getTestEndpoint(communicator, 1, "tcp")); communicator->getProperties()->setProperty("ControllerAdapter.ThreadPool.Size", "1"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectAdapterPtr adapter2 = communicator->createObjectAdapter("ControllerAdapter"); #ifdef ICE_CPP11_MAPPING shared_ptr<PluginI> plugin = dynamic_pointer_cast<PluginI>(communicator->getPluginManager()->getPlugin("Test")); #else PluginI* plugin = dynamic_cast<PluginI*>(communicator->getPluginManager()->getPlugin("Test").get()); #endif assert(plugin); ConfigurationPtr configuration = plugin->getConfiguration(); BackgroundControllerIPtr backgroundController = ICE_MAKE_SHARED(BackgroundControllerI, adapter, configuration); adapter->add(ICE_MAKE_SHARED(BackgroundI, backgroundController), communicator->stringToIdentity("background")); adapter->add(ICE_MAKE_SHARED(LocatorI, backgroundController), communicator->stringToIdentity("locator")); adapter->add(ICE_MAKE_SHARED(RouterI, backgroundController), communicator->stringToIdentity("router")); adapter->activate(); adapter2->add(backgroundController, communicator->stringToIdentity("backgroundController")); adapter2->activate(); communicator->waitForShutdown(); return EXIT_SUCCESS; }
void EffectRack::choosePlugin(QListWidgetItem* it, bool replace)/*{{{*/ { PluginI* plugi = PluginDialog::getPlugin(track->type(), this); if (plugi) { BasePlugin* nplug = 0; if (plugi->type() == PLUGIN_LADSPA) nplug = new LadspaPlugin(); else if (plugi->type() == PLUGIN_LV2) nplug = new Lv2Plugin(); else if (plugi->type() == PLUGIN_VST) nplug = new VstPlugin(); if (nplug) { if (nplug->init(plugi->filename(), plugi->label())) { // just in case is needed later //if (!audioDevice || audioDevice->deviceType() != AudioDevice::JACK_AUDIO) // nplug->aboutToRemove(); int idx = row(it); if (replace) { audio->msgAddPlugin(track, idx, 0); //Do this part from the GUI context so user interfaces can be properly deleted // track->efxPipe()->insert(0, idx); was set on lv2 only } audio->msgAddPlugin(track, idx, nplug); nplug->setChannels(track->channels()); nplug->setActive(true); song->dirty = true; } else { QMessageBox::warning(this, tr("Failed to load plugin"), tr("Plugin '%1'' failed to initialize properly, error was:\n%2").arg(plugi->name()).arg(get_last_error())); nplug->deleteMe(); return; } } updateContents(); } }/*}}}*/