gaSetOSCActive(string,bool)

Syntax

gaSetOSCActive(string,bool)

Example

intLabel = "/testINT"
floatLabel = "/testFLOAT"
stringLabel = "/testSTRING"

function setup()
 // init OSC sending labels
 gaSetOSCMessage(intLabel,OSC_INT) 
 gaSetOSCMessage(floatLabel,OSC_FLOAT)
 gaSetOSCMessage(stringLabel,OSC_STRING)
end

function update()
 // send OSC messages
 gaSetOSCValue(intLabel,tostring(gaMouseX()))
 gaSetOSCValue(floatLabel,tostring(ofRandomuf()))
 gaSetOSCValue(stringLabel,"any string")
end

function draw()
 gaBackground(0.0,1.0)
 
 ofSetColor(34,217,179)
 text = string.format("Sending OSC data to IP: %s at port: %s",gaSendingOscTo(),OSC_SENDING_PORT)
 ofDrawBitmapString(text,20,200)
 
end

function keyReleased()
 if gaKey() == string.byte('y') then
    gaSetOSCActive(floatLabel,true)
 elseif gaKey() == string.byte('n') then
    gaSetOSCActive(floatLabel,false)
 end
end

Description

Activate or deactivate a specific OSC message. This is useful when we are working with a lot of OSC messages and we want to isolate some.

Parameters

string,bool