Beispiel #1
0
void loop()
{
    printf("-------------------- GO ! --------------------\n");
    int i = 0;

    if (automate) {
        char source_name[1024], destination_name[1024];

        printf("%s\n", mdev_name(source));
        printf("%s\n", mdev_name(destination));

        lo_address a = lo_address_new_from_url("osc.udp://224.0.1.3:7570");
        lo_address_set_ttl(a, 1);

        lo_send(a, "/link", "ss", mdev_name(source), mdev_name(destination));

        msig_full_name(sendsig, source_name, 1024);
        msig_full_name(recvsig, destination_name, 1024);

        lo_send(a, "/connect", "ssss", source_name, destination_name,
                "@mode", "reverse");

        lo_address_free(a);
    }

    while (i >= 0 && !done) {
        msig_update_float(recvsig, ((i % 10) * 1.0f));
        printf("\ndestination value updated to %f -->\n", (i % 10) * 1.0f);
        mdev_poll(destination, 1);
        mdev_poll(source, 100);
        i++;
    }
}
Beispiel #2
0
void loop()
{
    printf("-------------------- GO ! --------------------\n");
    int i = 0;

    if (automate) {
        char source_name_1[1024], destination_name_1[1024];
        char source_name_2[1024], destination_name_2[1024];

        printf("%s\n", mdev_name(source));
        printf("%s\n", mdev_name(destination));

        lo_address a = lo_address_new_from_url("osc.udp://224.0.1.3:7570");
        lo_address_set_ttl(a, 1);

        lo_send(a, "/link", "ss", mdev_name(source), mdev_name(destination));

        msig_full_name(sendsig_1, source_name_1, 1024);
        msig_full_name(recvsig_1, destination_name_1, 1024);

        lo_send(a, "/connect", "ss", source_name_1, destination_name_1);

        msig_full_name(sendsig_2, source_name_2, 1024);
        msig_full_name(recvsig_2, destination_name_2, 1024);

        lo_send(a, "/connect", "ss", source_name_2, destination_name_2);

        lo_address_free(a);
    }

    while (i >= 0 && !done) {
        mdev_poll(source, 0);
        msig_update_float(source->outputs[0], ((i % 10) * 1.0f));
        msig_update_float(source->outputs[1], ((i % 10) * 1.0f));
        printf("source value updated to %d -->\n", i % 10);

        printf("Received %i messages.\n\n", mdev_poll(destination, 100));
        i++;
    }
}
Beispiel #3
0
void loop()
{
    printf("Polling device..\n");
    int i;
    for (i = 0; i < 10; i++) {
        mdev_poll(source, 0);
        printf("Updating signal %s to %f\n",
               sendsig->props.name, (i * 1.0f));
        msig_update_float(sendsig, (i * 1.0f));
        sent++;
        usleep(250 * 1000);
        mdev_poll(destination, 0);
    }
}
Beispiel #4
0
void loop()
{
    eprintf("-------------------- GO ! --------------------\n");
    int i = 0;

    while ((!terminate || i < 50) && !done) {
        msig_update_float(sendsig, ((i % 10) * 1.0f));
        eprintf("\nsource value updated to %d -->\n", i % 10);
        i++;
        sent++;
        select_on_both_devices(100);
        if (!verbose) {
            printf("\r  Sent: %4i, Received: %4i   ", sent, received);
            fflush(stdout);
        }
    }
}
Beispiel #5
0
void loop()
{
    printf("-------------------- GO ! --------------------\n");
    int i = 0, j = 0, count;

    if (automate) {
        char source_name[1024], destination_name[1024];

        printf("%s\n", mdev_name(source));
        printf("%s\n", mdev_name(destination));

        lo_address a = lo_address_new_from_url("osc.udp://224.0.1.3:7570");
        lo_address_set_ttl(a, 1);

        lo_send(a, "/link", "ss", mdev_name(source), mdev_name(destination));

        for (int i = 0; i < 4; i++) {
            msig_full_name(sendsig[i], source_name, 1024);
            msig_full_name(recvsig[i], destination_name, 1024);

            lo_send(a, "/connect", "ss", source_name, destination_name);
        }

        lo_address_free(a);
    }

    while (i >= 0 && !done) {
        for (j = 0; j < 4; j++) {
            msig_update_float(recvsig[j], ((i % 10) * 1.0f));
        }
        printf("\ndestination values updated to %d -->\n", i % 10);
        for (j = 0; j < 4; j++) {
            count = msig_query_remote(sendsig[j], dummysig[j]);
            printf("Sent %i queries for sendsig[%i]\n", count, j);
        }
        mdev_poll(destination, 100);
        mdev_poll(source, 0);
        i++;
        usleep(500 * 1000);
    }
}