本文整理汇总了C++中TTSymbol::rawpointer方法的典型用法代码示例。如果您正苦于以下问题:C++ TTSymbol::rawpointer方法的具体用法?C++ TTSymbol::rawpointer怎么用?C++ TTSymbol::rawpointer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTSymbol
的用法示例。
在下文中一共展示了TTSymbol::rawpointer方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: remove
TTErr TTHash::remove(const TTSymbol& key)
{
lock();
HASHMAP->erase(TTPtrSizedInt(key.rawpointer()));
unlock();
return kTTErrNone;
}
示例2: getItem
TTAddressItemPtr TTAddressItem::getItem(TTSymbol aSymbol)
{
TTAddressItemPtr anItem = NULL;
TTValue found;
TTErr err = ((TTListPtr)this)->find(&TTAddressItemFind, aSymbol.rawpointer(), found);
if (!err)
anItem = TTAddressItemPtr((TTPtr)found[0]);
return anItem;
}
示例3: remove
TTErr TTDictionaryBase::remove(const TTSymbol key)
{
// TTValue v;
// TTErr err;
// err = mList->find(TTDictionaryBaseFindKeyInList, key.rawpointer(), v);
// if (!err)
// mList->remove(v);
// return mHashTable->remove(key);
// mMap.erase(key.getSymbolId());
mMap.erase((TTPtrSizedInt)key.rawpointer());
sendNotification("change", TTValue());
return kTTErrNone;
}
示例4: append
TTErr TTDictionaryBase::append(const TTSymbol key, const TTValue& value)
{
// TTValue v = new TTKeyVal(TTPtrSizedInt(&key), value);
// lock();
remove(key);
// mMap.insert(TTDictionaryBasePair(key.getSymbolId(), value));
mMap.insert(TTDictionaryBasePair((TTPtrSizedInt)key.rawpointer(), value));
// unlock();
sendNotification("change", TTValue());
return kTTErrNone;
// mList->append(v);
// return mMap->append(key, value);
// return kTTErrNone;
}
示例5: lookup
TTErr TTDictionaryBase::lookup(const TTSymbol key, TTValue& value) const
{
// return mHashTable->lookup(key, value);
// lock();
// TTHashMap* theMap = (TTHashMap*)mHashMap;
// TTDictionaryBaseMapIterK iter = mMap.find(key.getSymbolId());
TTDictionaryBaseMapIterK iter = mMap.find((TTPtrSizedInt)key.rawpointer());
// TTPtrSizedInt a = iter->first;
// TTSymbol* b = (TTSymbol*)a;
// TTValue v = iter->second;
// TTValue v = (*theMap)[TTPtrSizedInt(&key)];
if (iter != mMap.end()) {
value = iter->second;
// unlock();
return kTTErrNone;
}
else {
return kTTErrValueNotFound;
}
}
示例6: wrapTTModularClassAsMaxClass
TTErr wrapTTModularClassAsMaxClass(TTSymbol& ttblueClassName, const char* maxClassName, WrappedClassPtr* c, ModularSpec* specificities)
{
TTObject o;
TTValue v, args;
WrappedClass* wrappedMaxClass = NULL;
TTSymbol TTName;
t_symbol *MaxName = NULL;
TTUInt16 i;
jamoma_init();
common_symbols_init();
if (!wrappedMaxClasses)
wrappedMaxClasses = hashtab_new(0);
wrappedMaxClass = new WrappedClass;
wrappedMaxClass->maxClassName = gensym(maxClassName);
wrappedMaxClass->maxClass = class_new( maxClassName,
(method)wrappedModularClass_new,
(method)wrappedModularClass_free,
sizeof(WrappedModularInstance),
(method)0L,
A_GIMME,
0);
wrappedMaxClass->ttblueClassName = ttblueClassName;
wrappedMaxClass->validityCheck = NULL;
wrappedMaxClass->validityCheckArgument = NULL;
wrappedMaxClass->options = NULL;
wrappedMaxClass->maxNamesToTTNames = hashtab_new(0);
wrappedMaxClass->specificities = specificities;
#ifdef AUDIO_EXTERNAL
// Setup our class to work with MSP
class_dspinit(wrappedMaxClass->maxClass);
#endif
// Create a temporary instance of the class so that we can query it.
o = TTObject(ttblueClassName);
// Register Messages as Max method
o.messages(v);
for (i = 0; i < v.size(); i++)
{
TTName = v[i];
if (TTName == TTSymbol("test") ||
TTName == TTSymbol("getProcessingBenchmark") ||
TTName == TTSymbol("resetBenchmarking"))
continue;
else if ((MaxName = jamoma_TTName_To_MaxName(TTName)))
{
hashtab_store(wrappedMaxClass->maxNamesToTTNames, MaxName, (t_object*)(TTName.rawpointer()));
class_addmethod(wrappedMaxClass->maxClass, (method)wrappedModularClass_anything, MaxName->s_name, A_GIMME, 0);
}
}
// Register Attributes as Max attr
o.attributes(v);
for (i = 0; i < v.size(); i++) {
TTAttributePtr attr = NULL;
t_symbol *maxType = _sym_atom;
TTName = v[i];
#ifdef AUDIO_EXTERNAL
// the enable word is already used by a message declared in the dsp_init method
if (TTName == TTSymbol("enable"))
continue;
#endif
// we want to hide service attribute for Max external
if (TTName == TTSymbol("service"))
continue;
if ((MaxName = jamoma_TTName_To_MaxName(TTName))) {
if (TTName == kTTSym_bypass && wrappedMaxClass->maxClassName != gensym("j.in") && wrappedMaxClass->maxClassName != gensym("j.in~"))
continue;
o.instance()->findAttribute(TTName, &attr);
if (attr->type == kTypeFloat32)
maxType = _sym_float32;
else if (attr->type == kTypeFloat64)
maxType = _sym_float64;
else if (attr->type == kTypeSymbol || attr->type == kTypeString)
maxType = _sym_symbol;
else if (attr->type == kTypeLocalValue)
maxType = _sym_atom;
hashtab_store(wrappedMaxClass->maxNamesToTTNames, MaxName, (t_object*)(TTName.rawpointer()));
class_addattr(wrappedMaxClass->maxClass, attr_offset_new(MaxName->s_name, maxType, 0, (method)wrappedModularClass_attrGet, (method)wrappedModularClass_attrSet, 0));
// Add display styles for the Max 5 inspector
if (attr->type == kTypeBoolean)
CLASS_ATTR_STYLE(wrappedMaxClass->maxClass, (char*)TTName.c_str(), 0, "onoff");
if (TTName == TTSymbol("fontFace"))
CLASS_ATTR_STYLE(wrappedMaxClass->maxClass, "fontFace", 0, "font");
}
//.........这里部分代码省略.........
示例7: lookup
TTErr TTHash::lookup(const TTSymbol& key, TTValue& value)
{
return lookup(TTPtr(key.rawpointer()), value);
}
示例8: append
TTErr TTHash::append(const TTSymbol& key, const TTValue& value)
{
return append(TTPtr(key.rawpointer()), value);
}
示例9: wrapTTClassAsPdClass
TTErr wrapTTClassAsPdClass(TTSymbol ttblueClassName, const char* pdClassName, WrappedClassPtr* c, WrappedClassOptionsPtr options)
{
TTObject o(ttblueClassName, 1); // Create a temporary instance of the class so that we can query it.
TTValue v;
WrappedClass* wrappedPdClass = NULL;
TTSymbol name;
TTCString nameCString = NULL;
t_symbol* namePdSymbol = NULL;
TTUInt32 nameSize = 0;
TTDSPInit();
wrappedPdClass = new WrappedClass;
wrappedPdClass->pdClassName = gensym((char*)pdClassName);
wrappedPdClass->pdClass = eclass_new( (char*)pdClassName,
(method)wrappedClass_new,
(method)wrappedClass_free,
sizeof(WrappedInstance),
CLASS_NOINLET,
A_GIMME,
0);
wrappedPdClass->ttblueClassName = ttblueClassName;
wrappedPdClass->validityCheck = NULL;
wrappedPdClass->validityCheckArgument = NULL;
wrappedPdClass->options = options;
if (!o.valid()) {
error("Jamoma ClassWrapper failed to load %s", ttblueClassName.c_str());
return kTTErrAllocFailed;
}
o.messages(v);
for (TTUInt16 i=0; i<v.size(); i++) {
name = v[i];
//nameSize = name->getString().length(); // TODO -- this crash on Windows...
nameSize = strlen(name.c_str());
nameCString = new char[nameSize+1];
strncpy(nameCString, name.c_str(), nameSize+1);
namePdSymbol = gensym(nameCString);
wrappedPdClass->pdNamesToTTNames[namePdSymbol->s_name] = (t_object*)name.rawpointer();
eclass_addmethod((t_eclass*)wrappedPdClass->pdClass, (method)wrappedClass_anything, nameCString, A_GIMME, 0);
delete[] nameCString;
nameCString = NULL;
}
o.attributes(v);
for (TTUInt16 i=0; i<v.size(); i++) {
TTAttributePtr attr = NULL;
name = v[i];
//nameSize = name->getString().length(); // TODO -- this crash on Windows...
nameSize = strlen(name.c_str());
nameCString = new char[nameSize+1];
strncpy(nameCString, name.c_str(), nameSize+1);
namePdSymbol = gensym(nameCString);
if (name == TT("maxNumChannels"))
continue; // don't expose these attributes to Pd users
if (name == TT("bypass")) {
if (wrappedPdClass->options && !wrappedPdClass->options->lookup(TT("generator"), v))
continue; // generators don't have inputs, and so don't really provide a bypass
}
o.instance()->findAttribute(name, &attr);
wrappedPdClass->pdNamesToTTNames[namePdSymbol->s_name] = (t_object*)name.rawpointer();
if (attr->type == kTypeFloat32)
CLASS_ATTR_FLOAT(wrappedPdClass->pdClass,nameCString,0,t_eclass,c_attr);
else if (attr->type == kTypeFloat64)
CLASS_ATTR_DOUBLE(wrappedPdClass->pdClass,nameCString,0,t_eclass,c_attr);
else if (attr->type == kTypeSymbol || attr->type == kTypeString)
CLASS_ATTR_SYMBOL(wrappedPdClass->pdClass,nameCString,0,t_eclass,c_attr);
else
CLASS_ATTR_LONG(wrappedPdClass->pdClass,nameCString,0,t_eclass,c_attr);
//class_addattr(wrappedPdClass->pdClass, attr_offset_new(nameCString, pdType, 0, (method)wrappedClass_attrGet, (method)wrappedClass_attrSet, 0));
/*
// Add display styles for the Max 5 inspector
if (attr->type == kTypeBoolean)
CLASS_ATTR_STYLE(wrappedPdClass->pdClass, (char*)name.c_str(), 0, (char*)"onoff");
if (name == TT("fontFace"))
CLASS_ATTR_STYLE(wrappedPdClass->pdClass, (char*)"fontFace", 0, (char*)"font");
*/
delete[] nameCString;
nameCString = NULL;
}
eclass_addmethod(wrappedPdClass->pdClass, (method)wrappedClass_dsp64, "dsp64", A_CANT, 0L);
eclass_addmethod(wrappedPdClass->pdClass, (method)object_obex_dumpout, "dumpout", A_CANT, 0);
eclass_addmethod(wrappedPdClass->pdClass, (method)wrappedClass_assist, "assist", A_CANT, 0L);
// eclass_addmethod(wrappedPdClass->pdClass, (method)stdinletinfo, "inletinfo", A_CANT, 0);
eclass_dspinit(wrappedPdClass->pdClass);
eclass_register(CLASS_BOX, wrappedPdClass->pdClass);
if (c)
*c = wrappedPdClass;
//.........这里部分代码省略.........
示例10: wrapAsMaxGraph
TTErr wrapAsMaxGraph(TTSymbol& ttClassName, char* maxClassName, WrappedClassPtr* c, WrappedClassOptionsPtr options)
{
TTObjectBasePtr o = NULL;
TTValue v;
TTUInt16 numChannels = 1;
WrappedClass* wrappedMaxClass = NULL;
TTSymbol name;
TTCString nameCString = NULL;
t_symbol* nameMaxSymbol = NULL;
TTUInt32 nameSize = 0;
common_symbols_init();
TTGraphInit();
if (!wrappedMaxClasses)
wrappedMaxClasses = hashtab_new(0);
wrappedMaxClass = new WrappedClass;
wrappedMaxClass->maxClassName = gensym(maxClassName);
wrappedMaxClass->maxClass = class_new( maxClassName,
(method)wrappedClass_new,
(method)wrappedClass_free,
sizeof(WrappedInstance),
(method)0L,
A_GIMME,
0);
wrappedMaxClass->ttClassName = ttClassName;
wrappedMaxClass->validityCheck = NULL;
wrappedMaxClass->validityCheckArgument = NULL;
wrappedMaxClass->options = options;
wrappedMaxClass->maxNamesToTTNames = hashtab_new(0);
// Create a temporary instance of the class so that we can query it.
TTObjectBaseInstantiate(ttClassName, &o, numChannels);
o->getMessageNames(v);
for (TTUInt16 i=0; i<v.size(); i++) {
name = v[i];
nameSize = strlen(name.c_str());
nameCString = new char[nameSize+1];
strncpy_zero(nameCString, name.c_str(), nameSize+1);
nameMaxSymbol = gensym(nameCString);
hashtab_store(wrappedMaxClass->maxNamesToTTNames, nameMaxSymbol, (t_object*)name.rawpointer());
class_addmethod(wrappedMaxClass->maxClass, (method)wrappedClass_anything, nameCString, A_GIMME, 0);
delete nameCString;
nameCString = NULL;
}
o->getAttributeNames(v);
for (TTUInt16 i=0; i<v.size(); i++) {
TTAttributePtr attr = NULL;
t_symbol* maxType = _sym_long;
name = v[i];
nameSize = strlen(name.c_str());
nameCString = new char[nameSize+1];
strncpy_zero(nameCString, name.c_str(), nameSize+1);
nameMaxSymbol = gensym(nameCString);
if (name == TT("MaxNumChannels"))
continue; // don't expose these attributes to Max users
if (name == TT("Bypass")) {
if (wrappedMaxClass->options && !wrappedMaxClass->options->lookup(TT("generator"), v))
continue; // generators don't have inputs, and so don't really provide a bypass
}
o->findAttribute(name, &attr);
if (attr->type == kTypeFloat32)
maxType = _sym_float32;
else if (attr->type == kTypeFloat64)
maxType = _sym_float64;
else if (attr->type == kTypeSymbol || attr->type == kTypeString)
maxType = _sym_symbol;
hashtab_store(wrappedMaxClass->maxNamesToTTNames, nameMaxSymbol, (t_object*)name.rawpointer());
class_addattr(wrappedMaxClass->maxClass, attr_offset_new(nameCString, maxType, 0, (method)wrappedClass_attrGet, (method)wrappedClass_attrSet, 0));
// Add display styles for the Max 5 inspector
if (attr->type == kTypeBoolean)
CLASS_ATTR_STYLE(wrappedMaxClass->maxClass, (char*)name.c_str(), 0, "onoff");
if (name == TT("fontFace"))
CLASS_ATTR_STYLE(wrappedMaxClass->maxClass, "fontFace", 0, "font");
delete nameCString;
nameCString = NULL;
}
TTObjectBaseRelease(&o);
class_addmethod(wrappedMaxClass->maxClass, (method)MaxGraphReset, "graph.reset", A_CANT, 0);
class_addmethod(wrappedMaxClass->maxClass, (method)MaxGraphSetup, "graph.setup", A_CANT, 0);
class_addmethod(wrappedMaxClass->maxClass, (method)MaxGraphConnect, "graph.connect", A_OBJ, A_LONG, 0);
class_addmethod(wrappedMaxClass->maxClass, (method)object_obex_dumpout, "dumpout", A_CANT, 0);
class_addmethod(wrappedMaxClass->maxClass, (method)wrappedClass_assist, "assist", A_CANT, 0L);
class_addmethod(wrappedMaxClass->maxClass, (method)stdinletinfo, "inletinfo", A_CANT, 0);
class_register(_sym_box, wrappedMaxClass->maxClass);
//.........这里部分代码省略.........