| 380 | } |
| 381 | |
| 382 | END_NAMESPACE_DISTRHO |
| 383 | |
| 384 | // ----------------------------------------------------------------------- |
| 385 | |
| 386 | int main(int argc, char* argv[]) |
| 387 | { |
| 388 | USE_NAMESPACE_DISTRHO |
| 389 | |
| 390 | #if defined(DISTRHO_UI_LINUX_WEBVIEW_START) |
| 391 | if (argc >= 2 && std::strcmp(argv[1], "dpf-ld-linux-webview") == 0) |
| 392 | return DISTRHO_NAMESPACE::dpf_webview_start(argc, argv); |
| 393 | #endif |
| 394 | |
| 395 | // dummy test mode |
| 396 | if (argc == 1) |
| 397 | { |
| 398 | gUiTitle = "DSSI UI Test"; |
| 399 | |
| 400 | initUiIfNeeded(); |
| 401 | globalUI->dssiui_show(true); |
| 402 | globalUI->exec_start(); |
| 403 | |
| 404 | delete globalUI; |
| 405 | globalUI = nullptr; |
| 406 | |
| 407 | return 0; |
| 408 | } |
| 409 | |
| 410 | if (argc != 5) |
| 411 | { |
| 412 | d_stderr("Usage: %s <osc-url> <plugin-dll> <plugin-label> <instance-name>", argv[0]); |
| 413 | return 1; |
| 414 | } |
| 415 | |
| 416 | const char* oscUrl = argv[1]; |
| 417 | const char* uiTitle = argv[4]; |
| 418 | |
| 419 | char* const oscHost = lo_url_get_hostname(oscUrl); |
| 420 | char* const oscPort = lo_url_get_port(oscUrl); |
| 421 | char* const oscPath = lo_url_get_path(oscUrl); |
| 422 | size_t oscPathSize = strlen(oscPath); |
| 423 | lo_address oscAddr = lo_address_new(oscHost, oscPort); |
| 424 | lo_server oscServer = lo_server_new_with_proto(nullptr, LO_UDP, osc_error_handler); |
| 425 | |
| 426 | char* const oscServerPath = lo_server_get_url(oscServer); |
| 427 | |
| 428 | char pluginPath[strlen(oscServerPath)+oscPathSize]; |
| 429 | strcpy(pluginPath, oscServerPath); |
| 430 | strcat(pluginPath, oscPath+1); |
| 431 | |
| 432 | #if DISTRHO_PLUGIN_WANT_STATE |
| 433 | char oscPathConfigure[oscPathSize+11]; |
| 434 | strcpy(oscPathConfigure, oscPath); |
| 435 | strcat(oscPathConfigure, "/configure"); |
| 436 | lo_server_add_method(oscServer, oscPathConfigure, "ss", osc_configure_handler, nullptr); |
| 437 | #endif |
| 438 | |
| 439 | char oscPathControl[oscPathSize+9]; |
nothing calls this directly
no test coverage detected