def setpreset(): state.processpresetmessage(request.form) return json.dumps(state.getstate())
def setparameters(): print request.form state.setparameters(request.form) return json.dumps(state.getstate())
def playpause(): state.playpause() return json.dumps(state.getstate())
def reset(): state.reset() return json.dumps(state.getstate())
def getstate(): return json.dumps(state.getstate())