本文整理汇总了C++中TTSymbol::getCString方法的典型用法代码示例。如果您正苦于以下问题:C++ TTSymbol::getCString方法的具体用法?C++ TTSymbol::getCString怎么用?C++ TTSymbol::getCString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTSymbol
的用法示例。
在下文中一共展示了TTSymbol::getCString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ramp_getFunctionParameter
// Attributes of attributes
void ramp_getFunctionParameter(t_ramp *obj, t_symbol *msg, long argc, t_atom *argv)
{
t_atom* a;
TTSymbol* parameterName;
TTValue parameterValue;
int numValues;
int i;
TTSymbol* tempSymbol;
double tempValue;
TTValue v;
if (!argc) {
error("jcom.ramp: not enough arguments to function.parameter.get");
return;
}
// get the correct TT name for the parameter given the Max name
parameterName = TT(atom_getsym(argv)->s_name);
obj->parameterNames->lookup(parameterName, v);
v.get(0, ¶meterName);
obj->rampUnit->getFunctionParameterValue(parameterName, parameterValue);
numValues = parameterValue.getSize();
if (numValues) {
a = (t_atom *)sysmem_newptr(sizeof(t_atom) * (numValues+1));
// First list item is name of parameter
atom_setsym(a, gensym((char*)parameterName->getCString()));
// Next the whole shebang is copied
for (i=0; i<numValues; i++) {
if (parameterValue.getType(i) == kTypeSymbol) {
parameterValue.get(i, &tempSymbol);
atom_setsym(a+i+1, gensym((char*)tempSymbol->getCString()));
}
else {
parameterValue.get(i, tempValue);
atom_setfloat(a+i+1, tempValue);
}
}
object_obex_dumpout(obj, gensym("function.parameter.get"), numValues+1, a);
// The pointer to an atom assign in the getParameter method needs to be freed.
sysmem_freeptr(a);
}
}
示例2: ramp_attrget
void ramp_attrget(t_ramp *x, t_symbol *msg, long argc, t_atom *argv)
{
t_atom* a;
TTSymbol* parameterName;
TTValue parameterValue;
int numValues;
int i;
TTSymbol* tempSymbol;
double tempValue;
if (!argc) {
error("jcom.ramp: not enough arguments to parameter.get");
return;
}
parameterName = TT(atom_getsym(argv)->s_name);
x->rampUnit->getAttributeValue(parameterName, parameterValue);
numValues = parameterValue.getSize();
if (numValues) {
a = (t_atom *)sysmem_newptr(sizeof(t_atom) * (numValues+1));
// First list item is name of parameter
atom_setsym(a, gensym((char*)parameterName->getCString()));
// Next the whole shebang is copied
for (i=0; i<numValues; i++) {
if (parameterValue.getType(i) == kTypeSymbol) {
parameterValue.get(i, &tempSymbol);
atom_setsym(a+i+1, gensym((char*)tempSymbol->getCString()));
}
else {
parameterValue.get(i, tempValue);
atom_setfloat(a+i+1, tempValue);
}
}
object_obex_dumpout(x, gensym("current.parameter"), numValues+1, a);
// The pointer to an atom assign in the getParameter method needs to be freed.
sysmem_freeptr(a);
}
}
示例3: ramp_getDrives
void ramp_getDrives(t_ramp *x)
{
t_atom a[2];
long numRampUnits = 0;
long i;
TTValue rampUnitNames;
TTSymbol* aName;
atom_setsym(a+0, gensym("clear"));
object_obex_dumpout(x, gensym("drives"), 1, a);
RampLib::getUnitNames(rampUnitNames);
numRampUnits = rampUnitNames.getSize();
atom_setsym(a+0, gensym("append"));
for (i=0; i<numRampUnits; i++) {
rampUnitNames.get(i, &aName);
atom_setsym(a+1, gensym((char*)aName->getCString()));
object_obex_dumpout(x, gensym("drives"), 2, a);
}}
示例4: ramp_getFunctions
void ramp_getFunctions(t_ramp *x)
{
t_atom a[2];
long numFunctions = 0;
long i;
TTValue functionNames;
TTSymbol* aName;
atom_setsym(a+0, gensym("clear"));
object_obex_dumpout(x, gensym("functions"), 1, a);
FunctionLib::getUnitNames(functionNames);
numFunctions = functionNames.getSize();
atom_setsym(a+0, gensym("append"));
for (i=0; i<numFunctions; i++) {
functionNames.get(i, &aName);
atom_setsym(a+1, gensym((char*)aName->getCString()));
object_obex_dumpout(x, gensym("functions"), 2, a);
}
}
示例5: main
int JAMOMA_EXPORT_MAXOBJ main(void)
{
long flags;
t_class* c;
long numDataspaces = 0;
t_symbol** dataspaceNames = NULL;
TTValue functionNames;
TTSymbol* functionName;
char dataspaces[2048];
char functions[2048];
char tempstr[64];
short i;
jamoma_init();
common_symbols_init();
jamoma_getDataspaceList(&numDataspaces, &dataspaceNames);
dataspaces[0] = 0;
for(i=0; i<numDataspaces; i++){
strcat(dataspaces, dataspaceNames[i]->s_name);
strcat(dataspaces, " ");
}
FunctionLib::getUnitNames(functionNames);
functions[0] = 0;
for(i=0; i<functionNames.getSize(); i++){
functionNames.get(i, &functionName);
strcat(functions, functionName->getCString());
strcat(functions, " ");
}
c = class_new("jcom.paramui",
(method)paramui_new,
(method)paramui_free,
sizeof(t_paramui),
(method)NULL,
A_GIMME,
0L);
flags = JBOX_TEXTFIELD | JBOX_COLOR;
jbox_initclass(c, flags);
c->c_flags |= CLASS_FLAG_NEWDICTIONARY; // to specify dictionary constructor
class_addmethod(c, (method)paramui_notify, "notify", A_CANT, 0);
class_addmethod(c, (method)paramui_paint, "paint", A_CANT, 0);
class_addmethod(c, (method)paramui_mousedown, "mousedown", A_CANT, 0);
class_addmethod(c, (method)paramui_mousedragdelta, "mousedragdelta", A_CANT, 0);
class_addmethod(c, (method)paramui_mouseup, "mouseup", A_CANT, 0);
class_addmethod(c, (method)paramui_oksize, "oksize", A_CANT, 0);
CLASS_ATTR_DEFAULT(c, "patching_rect", 0, "0. 0. 144. 20.");
CLASS_ATTR_DEFAULT(c, "fontname", 0, JAMOMA_DEFAULT_FONT);
snprintf(tempstr, 64, "%f", JAMOMA_DEFAULT_FONTSIZE);
CLASS_ATTR_DEFAULT(c, "fontsize", 0, tempstr);
CLASS_STICKY_ATTR(c, "category", 0, "Jamoma");
CLASS_ATTR_SYM(c, "name", 0, t_paramui, attr_name);
CLASS_ATTR_LABEL(c, "name", 0, "Parameter Name");
CLASS_ATTR_DEFAULT(c, "name", 0, "my/parameter");
CLASS_ATTR_SAVE(c, "name", 0);
CLASS_ATTR_ACCESSORS(c, "name", paramui_getName, paramui_setName);
CLASS_ATTR_SYM(c, "label", 0, t_paramui, attr_label);
CLASS_ATTR_LABEL(c, "label", 0, "Parameter Label");
CLASS_ATTR_STYLE(c, "label", 0, "text_onesymbol");
CLASS_ATTR_DEFAULT(c, "label", 0, "");
CLASS_ATTR_SAVE(c, "label", 0);
CLASS_ATTR_SYM(c, "type", 0, t_paramui, attr_type);
CLASS_ATTR_LABEL(c, "type", 0, "Data Type");
CLASS_ATTR_ENUM(c, "type", 0, "decimal integer string boolean");
CLASS_ATTR_DEFAULT(c, "type", 0, "decimal");
CLASS_ATTR_SAVE(c, "type", 0);
CLASS_ATTR_ACCESSORS(c, "type", paramui_getType, paramui_setType);
CLASS_ATTR_FLOAT_VARSIZE(c, "value/default", 0, t_paramui, attr_default, attr_defaultSize, LISTSIZE);
CLASS_ATTR_LABEL(c, "value/default", 0, "Default Value");
CLASS_ATTR_DEFAULT(c, "value/default", 0, "0.");
CLASS_ATTR_SAVE(c, "value/default", 0);
CLASS_ATTR_ACCESSORS(c, "value/default", paramui_getDefault, paramui_setDefault);
CLASS_ATTR_SYM(c, "ramp/drive", 0, t_paramui, attr_rampDrive);
CLASS_ATTR_LABEL(c, "ramp/drive", 0, "Ramp Drive");
CLASS_ATTR_DEFAULT(c, "ramp/drive", 0, "none");
CLASS_ATTR_SAVE(c, "ramp/drive", 0);
CLASS_ATTR_ACCESSORS(c, "ramp/drive", paramui_getRampDrive, paramui_setRampDrive);
CLASS_ATTR_SYM(c, "ramp/function", 0, t_paramui, attr_rampFunction);
CLASS_ATTR_LABEL(c, "ramp/function", 0, "Ramp Function/Shape");
CLASS_ATTR_ENUM(c, "ramp/function", 0, functions);
CLASS_ATTR_DEFAULT(c, "ramp/function", 0, "linear");
CLASS_ATTR_SAVE(c, "ramp/function", 0);
CLASS_ATTR_ACCESSORS(c, "ramp/function", paramui_getRampFunction, paramui_setRampFunction);
CLASS_ATTR_LONG(c, "view/freeze", 0, t_paramui, attr_uiFreeze);
CLASS_ATTR_LABEL(c, "view/freeze", 0, "Freeze the UI");
CLASS_ATTR_STYLE(c, "view/freeze", 0, "onoff");
CLASS_ATTR_DEFAULT(c, "view/freeze", 0, "0");
CLASS_ATTR_SAVE(c, "view/freeze", 0);
CLASS_ATTR_ACCESSORS(c, "view/freeze", paramui_getUIFreeze, paramui_setUIFreeze);
//.........这里部分代码省略.........