CSL 5.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

Classes | Macros | Functions | Variables
OSC_support.cpp File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <unistd.h>`
`#include "lo/lo.h"`
`#include "BasicFMInstrument.h"`

Go to the source code of this file.

## Classes
struct | Inst_Context

## Macros
#define | MAX_ACCESSORS 64
#define | addOSCMethod(name, nfunction) lo_server_thread_add_method(sSrvThrd, nname, NULL, nfunction, NULL)

## Functions
void | error (int num, const char *m, const char *path)
int | generic_handler (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data)
int | foo_handler (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data)
int | quit_handler (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data)
void | initOSCReceive ()
void | initOSCAddrSpace ()
void | setupOSCInstrLibrary (std::vector< Instrument * > library)
void | addOSCMethod2 (name, nfunction, void *user_data)
| lo_server_thread_add_method (sSrvThrd,"/foo/bar","fi", foo_handler, NULL)
void | mainOSCLoop (int port)
void | quitCSL ()
void | floatParamSetter (void *con, int arglen, const void *vargs, OSCTimeTag when, NetworkReturnAddressPtr ra)
void | intParamSetter (void *con, int arglen, const void *vargs, OSCTimeTag when, NetworkReturnAddressPtr ra)
void | stringParamSetter (void *con, int arglen, const void *vargs, OSCTimeTag when, NetworkReturnAddressPtr ra)
void | playNote (void *con, int arglen, const void *vargs, OSCTimeTag when, NetworkReturnAddressPtr ra)
void | playWithArgs (void *con, int arglen, const void *vargs, OSCTimeTag when, NetworkReturnAddressPtr ra)
void | addOSCMethod (char *name, OSC_CALL_BACK function)
void | addOSCMethod2 (char *name, OSC_CALL_BACK function, void *user_data)

## Variables
int | done = 0
static lo_server_thread | sSrvThrd

## Macro Definition Documentation

#define MAX_ACCESSORS 64

Definition at line 44 of file OSC_support.cpp.

#define addOSCMethod | ( |  | name,
|  |  | nfunction
| ) |  | lo_server_thread_add_method(sSrvThrd, nname, NULL, nfunction, NULL)

Definition at line 53 of file OSC_support.cpp.

## Function Documentation

void error | ( | int | num,
|  | const char * | m,
|  | const char * | path
| ) |  |

int generic_handler | ( | const char * | path,
|  | const char * | types,
|  | lo_arg ** | argv,
|  | int | argc,
|  | void * | data,
|  | void * | user_data
| ) |  |

int foo_handler | ( | const char * | path,
|  | const char * | types,
|  | lo_arg ** | argv,
|  | int | argc,
|  | void * | data,
|  | void * | user_data
| ) |  |

int quit_handler | ( | const char * | path,
|  | const char * | types,
|  | lo_arg ** | argv,
|  | int | argc,
|  | void * | data,
|  | void * | user_data
| ) |  |

void initOSCReceive | ( |  | ) |

Definition at line 117 of file OSC_support.cpp.

References error(), lo_server_thread_new(), and sSrvThrd.

void initOSCAddrSpace | ( |  | ) |

Definition at line 222 of file OSC_support.cpp.

void setupOSCInstrLibrary | ( | std::vector< Instrument * > | library | ) |

Definition at line 233 of file OSC_support.cpp.

References CSL_FLOAT_TYPE, CSL_INT_TYPE, CSL_STRING_TYPE, floatParamSetter(), csl::Instrument::getAccessors(), Inst_Context::instr, intParamSetter(), csl::logMsg(), csl::Instrument::name(), Inst_Context::num, csl::Instrument::numAccessors(), playNote(), playWithArgs(), Inst_Context::selector, and stringParamSetter().

void addOSCMethod2 | ( | name | ,
|  | nfunction | ,
|  | void * | user_data
| ) |  |

lo_server_thread_add_method | ( | sSrvThrd | ,
|  | "/foo/bar" | ,
|  | "fi" | ,
|  | foo_handler | ,
|  | NULL |
| ) |  |

void mainOSCLoop | ( | int | port | ) |

Definition at line 125 of file OSC_support.cpp.

References done, generic_handler(), lo_server_thread_add_method(), lo_server_thread_start(), quit_handler(), quitCSL(), and sSrvThrd.

void quitCSL | ( |  | ) |

Referenced by mainOSCLoop().

void floatParamSetter | ( | void * | con,
|  | int | arglen,
|  | const void * | vargs,
|  | OSCTimeTag | when,
|  | NetworkReturnAddressPtr | ra
| ) |  |

Definition at line 157 of file OSC_support.cpp.

References error(), Inst_Context::instr, csl::kLogError, csl::logMsg(), Inst_Context::num, Inst_Context::selector, and csl::Instrument::setParameter().

Referenced by setupOSCInstrLibrary().

void intParamSetter | ( | void * | con,
|  | int | arglen,
|  | const void * | vargs,
|  | OSCTimeTag | when,
|  | NetworkReturnAddressPtr | ra
| ) |  |

Definition at line 172 of file OSC_support.cpp.

References error(), Inst_Context::instr, csl::kLogError, csl::logMsg(), Inst_Context::num, Inst_Context::selector, and csl::Instrument::setParameter().

Referenced by setupOSCInstrLibrary().

void stringParamSetter | ( | void * | con,
|  | int | arglen,
|  | const void * | vargs,
|  | OSCTimeTag | when,
|  | NetworkReturnAddressPtr | ra
| ) |  |

Definition at line 186 of file OSC_support.cpp.

References error(), Inst_Context::instr, csl::kLogError, csl::logMsg(), Inst_Context::num, Inst_Context::selector, and csl::Instrument::setParameter().

Referenced by setupOSCInstrLibrary().

void playNote | ( | void * | con,
|  | int | arglen,
|  | const void * | vargs,
|  | OSCTimeTag | when,
|  | NetworkReturnAddressPtr | ra
| ) |  |

Definition at line 201 of file OSC_support.cpp.

References Inst_Context::instr, csl::logMsg(), Inst_Context::num, and csl::Instrument::play().

Referenced by setupOSCInstrLibrary().

void playWithArgs | ( | void * | con,
|  | int | arglen,
|  | const void * | vargs,
|  | OSCTimeTag | when,
|  | NetworkReturnAddressPtr | ra
| ) |  |

Definition at line 209 of file OSC_support.cpp.

References error(), Inst_Context::instr, csl::logMsg(), Inst_Context::num, and csl::Instrument::playOSC().

Referenced by setupOSCInstrLibrary().

void addOSCMethod | ( | char * | name,
|  | OSC_CALL_BACK | function
| ) |  |

Definition at line 225 of file OSC_support.cpp.

void addOSCMethod2 | ( | char * | name,
|  | OSC_CALL_BACK | function,
|  | void * | user_data
| ) |  |

Definition at line 228 of file OSC_support.cpp.

## Variable Documentation

int done = 0

Definition at line 34 of file OSC_support.cpp.

lo_server_thread sSrvThrd
| static

Definition at line 68 of file OSC_support.cpp.

Referenced by initOSCReceive(), and mainOSCLoop().