Ejemplo n.º 1
0
/* helpers */
void setScreenLine(OledScreen &screen, int lineNum, OSCMessage &msg){

    char str[256];
    char screenLine[256];
    int i = 0;

    screenLine[0] = 0;
    
    // since there are no strings in pd, the line message will be made of different types
    // cat the line together, then throw it up on the patch screen
    while (msg.isString(i) || msg.isFloat(i) || msg.isInt(i)){
        if (msg.isString(i)){
            msg.getString(i, str, 256);
            strcat(screenLine, str);
            strcat(screenLine, " ");
        }
        if (msg.isFloat(i)){
            sprintf(str, "%g ", msg.getFloat(i));
            strcat(screenLine, str);
        }
        if (msg.isInt(i)){
            sprintf(str, "%d ", msg.getInt(i));
            strcat(screenLine, str);
        }
        i++;
    }
    screen.setLine(lineNum, screenLine);
    //    printf("%s\n", screenLine);
}
Ejemplo n.º 2
0
void vuMeter(OSCMessage &msg){
    static int count;

    char line[1024];
    int len, i, outR, outL, inR, inL;    

    if (msg.isInt(0)) inR = msg.getInt(0);
    if (msg.isInt(1)) inL = msg.getInt(1);
    if (msg.isInt(2)) outR = msg.getInt(2);
    if (msg.isInt(3)) outL = msg.getInt(3);

    ui.patchScreen.drawInfoBar(inR, inL, outR, outL);

}
Ejemplo n.º 3
0
void encoderButton(OSCMessage &msg){
    if (msg.isInt(0)){
        if (msg.getInt(0) == 1) {
            ui.encoderPress();
        }
        if (msg.getInt(0) == 0) {
            ui.encoderRelease();
        }
    }
}
Ejemplo n.º 4
0
/* OSC messages received from MCU (we only use ecncoder input, the key and knob messages get passed righ to PD or other program */
void encoderInput(OSCMessage &msg){
    if (msg.isInt(0)){
        if (msg.getInt(0) == 1) ui.encoderUp();
        if (msg.getInt(0) == 0) ui.encoderDown();
    }
}
Ejemplo n.º 5
0
void setScreen(OSCMessage &msg){
    if (msg.isInt(0)) ui.currentScreen = msg.getInt(0);
    ui.newScreen = 1;
}
Ejemplo n.º 6
0
void programChange(OSCMessage &msg){
    if (msg.isInt(0)) ui.programChange(msg.getInt(0));
}