Exemple #1
0
/**
 * Receive loop
 * Returns false when it's time to quit.
 */
bool doReceive(void)
{
    oscpkt::PacketReader pr((char*)socketReceive.packetData() + skip_bytes,
        socketReceive.packetSize() - skip_bytes);
    oscpkt::Message *msg;

    while (pr.isOk() && (msg = pr.popMessage()) != 0)
    {
        err = MODIPULATE_ERROR_NONE;

        // Print whole received message
        std::cout << PFX_OSCIN << *msg << "\n";

        // Check each command.
        if (processPing(msg)) goto runtimeErrorCheck;
        if (processQuit(msg)) return false;
        if (processSetVolume(msg)) goto runtimeErrorCheck;
        if (processSongLoad(msg)) goto runtimeErrorCheck;
        if (processSongUnload(msg)) goto runtimeErrorCheck;
        if (processSongGetInfo(msg)) goto runtimeErrorCheck;
        if (processSongPlay(msg)) goto runtimeErrorCheck;
        if (processSongPause(msg)) goto runtimeErrorCheck;
        if (processSongSetVolume(msg)) goto runtimeErrorCheck;
        if (processSongPlaySample(msg)) goto runtimeErrorCheck;
        //if (processSongSetTempo(msg)) goto runtimeErrorCheck; // For the future...
        if (processSongChannelEnable(msg)) goto runtimeErrorCheck;
        if (processSongChannelDisable(msg)) goto runtimeErrorCheck;
        if (processSongChannelFade(msg)) goto runtimeErrorCheck;
        if (processSongChannelEffectCommand(msg)) goto runtimeErrorCheck;
        if (processSongChannelVolumeCommand(msg)) goto runtimeErrorCheck;
        //if (processSongChannelSetVolume(msg)) goto runtimeErrorCheck; // For the future...


runtimeErrorCheck:
        if (!MODIPULATE_OK(err))
            std::cout << PFX_ERR << "Modipulate: " << modipulate_global_get_last_error_string() << "\n";
    }

    return true;
}
Exemple #2
0
// This virtual method is called when user presses the window close box
bool TextEdit::onWindowClosing() {
    return processQuit();
}
Exemple #3
0
void TextEdit::onQuit() {
    if (processQuit())
        close();
}